Gravi2 Damage Routine

From Final Fantasy Hacktics Wiki
Revision as of 19:34, 24 April 2022 by Orkney (talk | contribs) (→‎Return locations)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
No Parameters - Returns nothing

Set Target Current Action (TCA) HP damage = Target current HP - 1 (Target is left with 1 HP)
Set TCA Attack type = HP damage
----------------------------------------------------------------------------------------- 
001866ec: 3c038019 lui r3,0x8019            |
001866f0: 8c632d98 lw r3,0x2d98(r3)         |r3 = Target data pointer
001866f4: 00000000 nop                      |
001866f8: 94620028 lhu r2,0x0028(r3)        |r2 = Target current HP
001866fc: 00000000 nop                      |
00186700: 10400007 beq r2,r0,0x00186720     #If Target HP <> 0x00
00186704: 00000000 nop                          |
00186708: 94620028 lhu r2,0x0028(r3)            |r2 = Target Current HP
0018670c: 3c038019 lui r3,0x8019                |
00186710: 8c632d90 lw r3,0x2d90(r3)             |r3 = Target Current Action (TCA) data pointer
00186714: 2442ffff addiu r2,r2,-0x0001          |r2 = Target Current HP - 1
00186718: 080619cc j 0x00186730                 >>Jump After HP = 0 section
0018671c: a4620004 sh r2,0x0004(r3)             |Set TCA HP damage = Current HP - 1
                                            #Else : Target HP is 0x00
00186720: 3c028019 lui r2,0x8019                |
00186724: 8c422d90 lw r2,0x2d90(r2)             |r2 = TCA data pointer
00186728: 00000000 nop                          |
0018672c: a4400004 sh r0,0x0004(r2)             |Set TCA HP damage = 0x00
00186730: 3c038019 lui r3,0x8019            |
00186734: 8c632d90 lw r3,0x2d90(r3)         |r3 = TCA data pointer
00186738: 34020080 ori r2,r0,0x0080         |r2 = 0x80 (HP damage Attack type
0018673c: 03e00008 jr r31                   |
00186740: a0620025 sb r2,0x0025(r3)         |Set TCA Attack type = HP damage

Return locations

Battle.bin
0018928c: Formula 17 - Dmg (TarCurHP-1) Hit F(MA+X)%
0018a01c: Formula 3E - Dmg (TarCurHP-1)