XA * YA Calculation

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search
No Parameters - Returns nothing

Load Current Ability XA and YA and Store XA * YA as Target current action HP Damage
Enable Target current action Type HP Damage flag

Note : past this routine, any change of XA or YA will be pointless (this is why oil doesn't work as intended in vanilla)
------------------------------------------------------------------------------------------------------------------------
00186568: 3c038019 lui r3,0x8019            |
0018656c: 946338ce lhu r3,0x38ce(r3)        |r3 = Current Ability XA ( 0x801938ce )
00186570: 3c028019 lui r2,0x8019            |
00186574: 944238d0 lhu r2,0x38d0(r2)        |r3 = Current Ability YA ( 0x801938d0 )
00186578: 00000000 nop                      |
0018657c: 00620018 mult r3,r2               |XA * YA
00186580: 3c038019 lui r3,0x8019            |
00186584: 8c632d90 lw r3,0x2d90(r3)         |r3 = Target Current Action Data Pointer
00186588: 34020080 ori r2,r0,0x0080         |r2 = 0x80 (Attack Type = HP Damage)
0018658c: a0620025 sb r2,0x0025(r3)         |Store Attack Type is HP Damage
00186590: 00001012 mflo r2                  |r2 = XA *  YA
00186594: 03e00008 jr r31                   |
00186598: a4620004 sh r2,0x0004(r3)         |Store Target Current Action HP Damage

Return Location

Battle.bin
001886c4: Damage Calculation
0018878c: Elemental XA * YA
00188878: Magical XA * YA
00188d6c: 07 Heal_(Weapon)
0018969c: 23 Heal_(MA*Y)
00189d18: 31 Dmg_((PA+Y)/2*PA)
00189ebc: 34 Heal_(PA*Y) HealMP_(PA*Y/2)
0018ac08: 63 Dmg_(SP*WP)
0018ac64: 64 Dmg_(PA * WP); if using Spear (PA * 3/2 * WP); if weaponless (PA * Brave /100 * WP)