Calculate Accuracy for Magical

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

Returns r2 = 0x00 If Attack hits / Else 0x00

Set Ability XA (MA) and YA (Ability X)
Modify XA (Status / Support / Compat / Element strengthened)
Modify YA (Compatibility)
Add XA and YA to becomes Hit% (it is stored in Target Current Action HP damage (0x04))
Modify Hit% with Faith (while sotred in HP damage)
Roll Hit% Vs Random (from 0 to 100)
 - Returns r2 = 0x01 if Attack misses
 - Returns r2 = 0x00 if Attack hits
---------------------------------------------------------------------------------------------
00188a24: 27bdffe8 addiu r29,r29,-0x0018    
00188a28: afbf0010 sw r31,0x0010(r29)       
00188a2c: 0c061760 jal 0x00185d80           |-->Load MA and X Set Ability XA = Attacker's MA and YA = used Ability X
00188a30: 00000000 nop                      |
00188a34: 0c0617ff jal 0x00185ffc           |-->Elemental_Strengthen XA +25% if used Ability elements is strengthened
00188a38: 00000000 nop                      |
00188a3c: 0c0621d1 jal 0x00188744           |-->Magical_Support/Status/Compat Modifiy XA (Status / Support / Compatibility)
00188a40: 00000000 nop                      |
00188a44: 0c061967 jal 0x0018659c           |-->XA + YA for Accuracy  XA+YA becomes TCA HP damage (YA is processed via compatibility)
00188a48: 00000000 nop                      |
00188a4c: 0c061c54 jal 0x00187150           |-->Faith Calculation HP damage becomes Base HP damage * Target faith/100 * Attacker faith/100
00188a50: 00000000 nop                      |
00188a54: 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
00188a58: 00000000 nop                      |
00188a5c: 3c028019 lui r2,0x8019            |
00188a60: 8c422d90 lw r2,0x2d90(r2)         |r2 = TCA data pointer
00188a64: 00000000 nop                      |
00188a68: 90420000 lbu r2,0x0000(r2)        |r2 = TCA hit flag
00188a6c: 00000000 nop                      |
00188a70: 2c420001 sltiu r2,r2,0x0001       r2 = 0x01 if Action misses / Else r2 = 0x00
00188a74: 8fbf0010 lw r31,0x0010(r29)       
00188a78: 27bd0018 addiu r29,r29,0x0018     
00188a7c: 03e00008 jr r31                   
00188a80: 00000000 nop   

Returns locations

Battle.bin
00188e14: Formula 09 - Dmg (Y/100)% Hit F(MA+X)%
00188e98: Formula 0A - Hit F(MA+X)%
0018935c: Formula 1B - DmgMP (MA+Y)% Hit F(X)%
0018ab38: Formula 61 - –Brave (Y) Hit F(MA+X)%