34 Heal (PA*Y) HealMP (PA*Y/2)

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search
[34]
00189e94: 27bdffe8 addiu r29,r29,-0x0018    |
00189e98: afbf0010 sw r31,0x0010(r29)       |
00189e9c: 0c061781 jal 0x00185e04           |-->Store PA and Y - XA = Attacker's PA and YA = Ability Y
00189ea0: 00000000 nop                      |
00189ea4: 0c061853 jal 0x0018614c           |-->Attack Up and Martial Arts Increase XA if Attacker uses Attack Up or Martial art with elligible weapon
00189ea8: 00000000 nop                      |
00189eac: 0c061259 jal 0x00184964           |-->Compatibility Modify Ability XA : from -50% to + 50%
00189eb0: 00000000 nop                      |
00189eb4: 0c06195a jal 0x00186568           |-->XA * YA Calculation - Store XA*YA as Target Current Action HP damage (TCA 0x04) and Set TCA Attack type to 0x80 (HP damage)
00189eb8: 00000000 nop                      |
00189ebc: 3c048019 lui r4,0x8019            |
00189ec0: 8c842d90 lw r4,0x2d90(r4)         |r4 = Target Current Action (TCA) data pointer
00189ec4: 00000000 nop                      |
00189ec8: 94820004 lhu r2,0x0004(r4)        |r2 = TCA HP damage
00189ecc: a4800004 sh r0,0x0004(r4)         |Nullify TCA HP damage
00189ed0: a4820006 sh r2,0x0006(r4)         |Set TCA HP recovery = previous HP Damage (XA*YA)
00189ed4: 94830006 lhu r3,0x0006(r4)        |r3 = HP recovery
00189ed8: 34020050 ori r2,r0,0x0050         |r2 = 0x50
00189edc: a0820025 sb r2,0x0025(r4)         |Set TCA Attack type = HP and MP recovery
00189ee0: 00031c00 sll r3,r3,0x10           |Left shift HP recovery in upper registery
00189ee4: 00031403 sra r2,r3,0x10           |Right shift HP recovery in lower registery (set word higher bit to 1 if halfword higher bit was 1)
00189ee8: 00031fc2 srl r3,r3,0x1f           |r3 = Higher bit of r3 (rounding prep)
00189eec: 00431021 addu r2,r2,r3            |r2 = HP recovery +0 or +1
00189ef0: 00021043 sra r2,r2,0x01           |r2 = HP receovery / 2
00189ef4: a482000a sh r2,0x000a(r4)         |Set TCA MP recovery = HP recovery/2
00189ef8: 8fbf0010 lw r31,0x0010(r29)
00189efc: 27bd0018 addiu r29,r29,0x0018
00189f00: 03e00008 jr r31
00189f04: 00000000 nop

Return location

Battle.bin
0018b97c - Pre Formula Setup