Users browsing this thread: 1 Guest(s)
Giving Everyone the Same Desperation Attack

#3
Posts: 617
Threads: 49
Thanks Received: 0
Thanks Given: 5
Joined: Feb 2017
Reputation: 25
Status
None
I decided to expand this a bit. MMMMMagic leaves 3 unused abilities. My hack uses one of those as a replacement ability for "Health", so I have 2 slots remaining. I decided I wanted to do 2 tiers of desperation attack. I'm just having trouble with how to check one accumulator. Here's the logic of my hack in plain English:

1. Make sure the character is eligible for a Desperation Attack. This means:
    a. They're not a monster, but they are targeting a monster.
    b. They are in near fatal status.
    c. They have none of the following statuses: muddle, image, clear, zombie.
    d. They haven't already used a Desperation Attack this turn.
2. Do a Desperation Attack 1 in 16 times.
    a. If no characters are dead, do Desperation Lvl. 1 (Ability FA)
    b. If at least one character is dead, flip a coin. 50% of the time, upgrade to Desperation Lvl. 2 (Ability FB)

The problem is the section of code from C2/15F1-C2/15F5. Right now, the code checks for if the ATTACKER is dead (which would obviously never happen). How do I check to see if OTHER party members are dead?

Also, is there a way to do a multiplier times the number of dead party members? So, for example, if 1 party member is dead, you have a 33% (hex: $55) chance of DA Lvl2. If 2 are dead, 66% (hex: $AA). If 3 are dead, you will always do DA Lvl 2 (hex: $FF). This is my first real attempt at ASM, so any help is appreciated.

Here is the code I have so far.
Code:
(Fight - check for Desperation attack first)

C2/15C8: C0 08        CPY #$08
C2/15CA: B0 44        BCS $1610      (No Desperation Attack if attacker is a monster)
C2/15CC: B9 E5 3E     LDA $3EE5,Y
C2/15CF: 89 02        BIT #$02
C2/15D1: F0 3D        BEQ $1610      (No Desperation Attack if attacker is not near fatal)
C2/15D3: 89 24        BIT #$24
C2/15D5: D0 39        BNE $1610      (No Desperation Attack if attacker has Muddled or Image status)
C2/15D7: B9 E4 3E     LDA $3EE4,Y
C2/15DA: 89 12        BIT #$12    
C2/15DC: D0 2B        BNE $1610      (No Desperation Attack if attacker has Clear or Zombie status)
C2/15DE: A5 B9        LDA $B9
C2/15E0: F0 2E        BEQ $1610      (No Desperation Attack if target is not a monster)
C2/15E2: 20 5A 4B     JSR $4B5A      (Choose a random number between 0 and 255)
C2/15E5: C9 0F        CMP #$0F       (Is the number >15?) (15/16 chance of this being yes)
C2/15E7: D0 27        BNE $1610      (If so, branch to normal attack.)
C2/15E9: B9 18 30     LDA $3018,Y    
C2/15EC: 0C 2F 3F     TSB $3F2F      (Check if chraacter has used Desperation. If not, increment up one.)
C2/15EF: D0 20        BNE $1610      (If character has already used a Desperation, branch to normal attack)
C2/15F1: BD E4 3E     LDA $3EE4,X
C2/15F4: 89 C2        BIT #$C2       (Check for Dead, Zombie, or Petrify)
C2/15F6: F0 0B        BEQ $1603      (If no, branch to Desperation Lvl 1)
C2/15F8: 20 5A 4B     JSR $4B5A      (Choose a random number between 0 and 255)
C2/15FB: C9 80        CMP #$80       (Is the number between >128) (50% chance of this being yes)
C2/15FD: D0 04        BNE $1603      (If so, branch to Despeartion Lvl 1)
C2/15FF: A9 FB          LDA FB         (Queue Up Desperation Lvl 2 - Ability FB)
C2/1601: 80 02        BRA $1605         (and branch)
C2/1603: A9 FA        LDA FA         (Queue Up Desperation Lvl 1 - Ability FA)
C2/1605: 85 B6          STA $B6         (Save Attack #)
C2/1607: A9 10        LDA #$10
C2/1609: 14 B0        TRB $B0        (???  See functions C2/13D3 and C2/57C2 for usual
                                     purpose; dunno whether it does anything here.)
C2/160B: 4C 14 17     JMP $1714
C2/160E: EA EA        NOP


Projects:
FFVI: Divergent Paths (Completed) - a complete storyline and gameplay hack of FF6 that adds Leo as a playable character
  Find
Quote  



Messages In This Thread
RE: Giving Everyone the Same Desperation Attack - by PowerPanda - 07-20-2018, 04:38 PM

Forum Jump:

Users browsing this thread: 1 Guest(s)


Theme by Madsiur2017Custom Graphics by JamesWhite