FF6 Hacking
Edit GP Rain damage - Printable Version

+- FF6 Hacking (https://www.ff6hacking.com/forums)
+-- Forum: Discussion Forums (https://www.ff6hacking.com/forums/forum-5.html)
+--- Forum: Magitek Research Facility (https://www.ff6hacking.com/forums/forum-9.html)
+--- Thread: Edit GP Rain damage (/thread-3921.html)



Edit GP Rain damage - doofenH - 01-01-2020

I'm looking for an edit tool to change the formula of GP Rain because the damage is pitiful. Is there such tool? Thank.


RE: Edit GP Rain damage - madsiur - 01-01-2020

Does GP rain do as damage the cost in GP for casting it? If it's the case you may only need to increase the #$1E to a higher value at the beginning of the special effect, but it will cost more GP.. You'll need to test this because I know little about the battle engine ad I'm not sure if this sole change will do the job..

Code:
Special effect $51
GP Rain

C2/3FB7: B9 18 3B     LDA $3B18,Y (Attacker's Level)
C2/3FBA: EB           XBA
C2/3FBB: A9 1E        LDA #$1E    (change this)
C2/3FBD: 20 81 47     JSR $4781   (attack will cost: Attacker's Level * 30)
C2/3FC0: C2 20        REP #$20    (Set 16-bit accumulator)
C2/3FC2: C0 08        CPY #$08
C2/3FC4: B0 0D        BCS $3FD3   (Branch if attacker is monster)
C2/3FC6: 20 B6 37     JSR $37B6   (deduct thrown gold from party's inventory)
C2/3FC9: D0 1E        BNE $3FE9   (branch if there was actually some GP to throw)
C2/3FCB: 64 A4        STZ $A4     (Makes attack target nothing)
C2/3FCD: A2 08        LDX #$08
C2/3FCF: 8E 01 34     STX $3401   (Set to display text 8 - "No money!!")
C2/3FD2: 60           RTS



RE: Edit GP Rain damage - C-Dude - 01-01-2020

This is the only other code relevant to GP Rain.
Code:
GP Rain

C2/1907: BB           TYX
C2/1908: 20 8A 29     JSR $298A      (Load command data, and clear special effect,
                                      magic power, etc.)
C2/190B: EE A6 11     INC $11A6      (Set spell power to 1)
C2/190E: A9 60        LDA #$60
C2/1910: 0C A2 11     TSB $11A2      (Set ignore defense, no split damage)
C2/1913: 9C 14 34     STZ $3414      (Skip damage modification)
C2/1916: E0 08        CPX #$08
C2/1918: 90 05        BCC $191F      (branch if character)
C2/191A: A9 05        LDA #$05
C2/191C: 8D 12 34     STA $3412      (will display "GP Rain" atop screen.
                                      differentiated from "Health" and "Shock"
                                      by $B5 holding command 18h in this case.)
C2/191F: A9 A2        LDA #$A2
C2/1921: 8D A9 11     STA $11A9      (Store GP Rain in special effect)
C2/1924: 4C 7B 31     JMP $317B      (entity executes one hit)
So Madsiur is correct. When the GP Rain command is selected, an animation override is put in place (making the character throw coins instead of using their normal fight movement), base battle power is set to 1 and set to be unmodified (to ensure that the character's stats do not influence the attack), and then battle power is set to Level * 30. The game deducts a comparable quantity of gold from the party's inventory when the attack is attempted.

What Madsiur described is thus the only good way to tweak GP Rain: change the amount of money that it costs per level. Otherwise you'd have to rewrite the special effect to allow for a multiplier or a flat base damage.


EDIT: Keep in mind $1E is a signed hex value; if you set it any higher than $80 (128 gold per level) the game will interpret it as a negative number and will either crash or do something erratic like heal the enemies and give your party gold for it.


RE: Edit GP Rain damage - Subtraction - 01-02-2020

There's one other relevant bit. The code Madsiur posted has
Code:
BNE $3FE9   (branch if there was actually some GP to throw)

Here's the code that jumps to:

Code:
C2/3FE9: A2 02        LDX #$02
C2/3FEB: 86 E8        STX $E8
C2/3FED: 20 B7 47     JSR $47B7      (24-bit $E8 = A * 2)
C2/3FF0: A5 E8        LDA $E8        (A = gold to consume * 2)
C2/3FF2: AE C9 3E     LDX $3EC9      (Number of targets)
C2/3FF5: 20 92 47     JSR $4792      (A / number of targets)
C2/3FF8: 8D B0 11     STA $11B0      (Sets maximum damage)
C2/3FFB: 60           RTS

GP Rain does a total 2 damage per GP thrown, divided equally among the targets. If you want to change the 2x multiplier instead of/in addition to the cost, C2/3FE9 is the place to do it.


RE: Edit GP Rain damage - doofenH - 01-02-2020

Thank you all. Will try.