Calculate Accuracy for Physical

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search
No Parameters 

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

Modify Ability XA (Support, Status etc...)
Modify Ability YA (Compat)
Uses XA+YA as Hit% vs Random (0 to 100)
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------
001886d4: 27bdffe8 addiu r29,r29,-0x0018    |
001886d8: afbf0010 sw r31,0x0010(r29)       |
001886dc: 0c06217e jal 0x001885f8           |-->Physical_XA_Modifying_Statuses/Support Modify Ability XA (Support Abilities, Status, Compatibility)
001886e0: 00000000 nop                      |
001886e4: 0c061967 jal 0x0018659c           |-->Set XA + YA for Status Formulas (Stupid section) XA+YA becomes TCA HP damage (YA is processed via compatibility) 
001886e8: 00000000 nop                      |
001886ec: 0c061d44 jal 0x00187510           |-->Uses_HP_damage_as_Action_hit%25 HP damage becomes Hit% - Roll Hit% vs random (0 to 100), Set Action hit flag to miss if it fails
001886f0: 00000000 nop                      |
001886f4: 3c028019 lui r2,0x8019            |
001886f8: 8c422d90 lw r2,0x2d90(r2)         |r2 = Target Current Action (TCA) data pointer
001886fc: 00000000 nop                      |
00188700: 90420000 lbu r2,0x0000(r2)        |r2 = TCA hit flag
00188704: 00000000 nop                      |
00188708: 2c420001 sltiu r2,r2,0x0001       |r2 = 0x01 is attack miss / 0x00 if Attack hits
0018870c: 8fbf0010 lw r31,0x0010(r29)       
00188710: 27bd0018 addiu r29,r29,0x0018     
00188714: 03e00008 jr r31                   
00188718: 00000000 nop  

Return Locations

Battle.bin
00189744: Formula 25 : Equipped: Break Hit (PA+WP+X)%
00189ab8: Formula 2B : Hit(PA+X)% -PA/MA/SP(X)
00189b00: Formula 2C : DmgMP (X)% Hit (PA+Y)%