Physical Routine for Hit % abilities

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search

Physical Routine for Hit % abilities : (Contains superfluous checks for berserk and frog on the user when the user can't use this while berserk or frogged.)

No Parameters 

Returns r2 = 0x00 if Attack hits / Else 0x01

Applies physical modifiers to XA (Status, Support)
Applies compatibility effects on XA and YA
Set Attack Hit% = XA + YA and roll it Vs a random number (0 to 100)
--------------------------------------------------------------------------
00188b14: 27bdffe8 addiu r29,r29,-0x0018    |
00188b18: afbf0010 sw r31,0x0010(r29)       |
00188b1c: 0c061853 jal 0x0018614c           |-->Formula 32, 33, 34, 35 Attack Up and Martial Arts  Increase XA if Attacker uses Attack Up or Martial art with elligible weapon
00188b20: 00000000 nop                      |
00188b24: 0c0622b7 jal 0x00188adc           |-->Cluster of Physical Routines Modify XA (Attacker status, Target Status/Support, Compatibility)
00188b28: 00000000 nop                      |
00188b2c: 0c061967 jal 0x0018659c           |-->XA + YA for Accuracy XA+YA becomes TCA HP damage (YA is processed via compatibility) - Will be used as accuracy
00188b30: 00000000 nop                      |
00188b34: 0c061d44 jal 0x00187510           |-->Uses_HP_damage_as_Action_hit% HP damage becomes Hit% - Roll Hit% vs random (0 to 100), Set Action hit flag to miss if it fails
00188b38: 00000000 nop                      |
00188b3c: 3c028019 lui r2,0x8019            |
00188b40: 8c422d90 lw r2,0x2d90(r2)         |r2 = Target Current Action (TCA) data pointer
00188b44: 00000000 nop                      |
00188b48: 90420000 lbu r2,0x0000(r2)        |r2 = TCA hit flag
00188b4c: 00000000 nop                      |
00188b50: 2c420001 sltiu r2,r2,0x0001       |r2 = 0x01 if Attack miss / Else 0x00
00188b54: 8fbf0010 lw r31,0x0010(r29)       
00188b58: 27bd0018 addiu r29,r29,0x0018     
00188b5c: 03e00008 jr r31                   
00188b60: 00000000 nop

Return locations

Battle.bin
001897e8: 26_Equipped:_Steal_Hit_(SP+X)%
00189850: 27_StealGil_(CasLVL*SP)_Hit_(SP+X)%
0018a3f8: 4D_AbsHP_(Y)%_Hit_(MA+X)%
0018a480: 4F_Dmg_(CasMaxHP-CasCurHP)_Hit_(PA+X)%
0018a4c8: 50_Hit_(MA+X)%