Damage Split Usability

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search
If HP damage > 0 , Checks random vs Brave%, if ok Store Damage Split ID in TCA Reaction ID and HP damage/2 in TCA 0x26

TCA = Targeted unit Current Action data pointer
------------------------------------------------------------------------------------------------------------------------
0018d318: 3c028019 lui r2,0x8019            |
0018d31c: 8c422d90 lw r2,0x2d90(r2)         |r2 = TCA data pointer
0018d320: 27bdffe8 addiu r29,r29,-0x0018    |
0018d324: afbf0014 sw r31,0x0014(r29)       |
0018d328: afb00010 sw r16,0x0010(r29)       |
0018d32c: 94500004 lhu r16,0x0004(r2)       |r16 = TCA HP damage amount
0018d330: 00000000 nop                      |
0018d334: 1200000e beq r16,r0,0x0018d370    #If HP damage > 0 /Else branch to  END
0018d338: 00000000 nop                          |
0018d33c: 3c048019 lui r4,0x8019                |
0018d340: 8c842d98 lw r4,0x2d98(r4)             |r4 = Targeted Unit data pointer
0018d344: 0c0634e1 jal 0x0018d384               |-->Chance to React Returns r2 = 0x00 If Unit will react (Chances are Br%)
0018d348: 00000000 nop                          |
0018d34c: 14400008 bne r2,r0,0x0018d370         #If Targeted Unit is reacting
0018d350: 26100001 addiu r16,r16,0x0001             |r16 = TCA HP damage + 0x01
0018d354: 3202ffff andi r2,r16,0xffff               |r2 = TCA HP damage (halfword)
0018d358: 00028042 srl r16,r2,0x01                  |r16 = TCA HP Damage / 2 (rounded up)
0018d35c: 3c038019 lui r3,0x8019                    |
0018d360: 8c632d90 lw r3,0x2d90(r3)                 |r3 = TCA data poijter
0018d364: 340201be ori r2,r0,0x01be                 |r2 = 0x1be (Damage split ability ID)
0018d368: a4700026 sh r16,0x0026(r3)                |Store HP dmg/2 in TCA 0x26 (Unit 0x1b2 )
0018d36c: a462000e sh r2,0x000e(r3)                 |Store Damage split ID in TCA 0x0e (Unit 0x19a)
0018d370: 8fbf0014 lw r31,0x0014(r29)       END
0018d374: 8fb00010 lw r16,0x0010(r29)      
0018d378: 27bd0018 addiu r29,r29,0x0018     
0018d37c: 03e00008 jr r31                   
0018d380: 00000000 nop

Return location

Battle.bin
0018ccc8: MP_Switch,_Distribute,_and_Damage_Split_usability