Target XA affecting Statuses (Physical)

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

Checks for Target's statuses and modify Ability XA (0x801938ce) if needed (all cumulative):
- Target has Protect : XA = 66% of XA
- Target is sleeping or charging : XA = 150% of XA
- Target is a frog or a chicken : XA = 150% of XA
-----------------------------------------------------------------------------------------------------------
0018636c: 3c028019 lui r2,0x8019            |
00186370: 8c422d98 lw r2,0x2d98(r2)         |r2 = Target's Data Pointer
00186374: 00000000 nop                      |
00186378: 9042005b lbu r2,0x005b(r2)        |r2 = Target's 4th set of Statuses byte
0018637c: 00000000 nop                      |
00186380: 30420020 andi r2,r2,0x0020        |r2 = 0x20 if TargetHas protect
00186384: 1040000b beq r2,r0,0x001863b4     #If Target has Protect
00186388: 3c025555 lui r2,0x5555                |
0018638c: 3c048019 lui r4,0x8019                |
00186390: 248438ce addiu r4,r4,0x38ce           |r4 = 0x801938ce (Ability XA pointer)  801938ce
00186394: 84830000 lh r3,0x0000(r4)             |r3 = Ability XA
00186398: 34425556 ori r2,r2,0x5556             |r2 = 0x55555556 (0,33 * 2^32)
0018639c: 00031840 sll r3,r3,0x01               |XA * 2
001863a0: 00620018 mult r3,r2                   |XA * 2 * 0.33 * 2^32
001863a4: 00031fc3 sra r3,r3,0x1f               |r3 = Higher bit of r3 (should be 0x00)
001863a8: 00001010 mfhi r2                      |r2 = XA * 2/3
001863ac: 00431023 subu r2,r2,r3                |r2 = XA * 2/3 - 0x00
001863b0: a4820000 sh r2,0x0000(r4)             |Store XA (66% of its initial value)
001863b4: 3c038019 lui r3,0x8019            |
001863b8: 8c632d98 lw r3,0x2d98(r3)         |r3 = Target's Data Pointer
001863bc: 00000000 nop                      |
001863c0: 9062005c lbu r2,0x005c(r3)        |r3 = Target's 5th set of Statuses byte
001863c4: 00000000 nop                      |
001863c8: 30420010 andi r2,r2,0x0010        |r2 = 0x10 if Target is sleeping
001863cc: 14400006 bne r2,r0,0x001863e8     #If Target is not Sleeping /Else branch to increase XA section
001863d0: 00000000 nop                          |
001863d4: 90620058 lbu r2,0x0058(r3)            |r2 = Target's 1st set of Statuses byte
001863d8: 00000000 nop                          |
001863dc: 30420008 andi r2,r2,0x0008            |r2 = 0x08 if Target is Charging
001863e0: 1040000b beq r2,r0,0x00186410         #If Target is charging /Else avoid increase XA section
001863e4: 00000000 nop                              |
001863e8: 3c048019 lui r4,0x8019            #E      |
001863ec: 248438ce addiu r4,r4,0x38ce               |r4 = 0x801938ce (Ability XA pointer)  801938ce
001863f0: 84830000 lh r3,0x0000(r4)                 |r3 = Ability XA
001863f4: 00000000 nop                              |
001863f8: 00031040 sll r2,r3,0x01                   |XA * 2
001863fc: 00431021 addu r2,r2,r3                    |XA * 3
00186400: 00021fc2 srl r3,r2,0x1f                   |r3 = higher bit of r2 (should be 0x00)
00186404: 00431021 addu r2,r2,r3                    |XA*3 + 0x00
00186408: 00021043 sra r2,r2,0x01                   |r2 = XA *3/2
0018640c: a4820000 sh r2,0x0000(r4)                 |Store XA (150% of previous value)
00186410: 3c028019 lui r2,0x8019            |
00186414: 8c422d98 lw r2,0x2d98(r2)         |r2 =  Target's Data Pointer
00186418: 00000000 nop                      |
0018641c: 9042005a lbu r2,0x005a(r2)        |r2 = Target's 3rd set of Statuses byte
00186420: 00000000 nop                      |
00186424: 30420006 andi r2,r2,0x0006        |r2 <> 0x00if Target has Chicken or Frog
00186428: 1040000b beq r2,r0,0x00186458     #If Target is a Chicken or a Frog
0018642c: 00000000 nop                          |
00186430: 3c048019 lui r4,0x8019                |
00186434: 248438ce addiu r4,r4,0x38ce           |r4 = Ability XA pointer
00186438: 84830000 lh r3,0x0000(r4)             |r3 = Ability XA
0018643c: 00000000 nop                          |
00186440: 00031040 sll r2,r3,0x01               |XA * 2
00186444: 00431021 addu r2,r2,r3                |XA * 3
00186448: 00021fc2 srl r3,r2,0x1f               |r3 = higher bit of r2 (should be 0x00)
0018644c: 00431021 addu r2,r2,r3                |XA*3 + 0x00
00186450: 00021043 sra r2,r2,0x01               |r2 = XA *3/2
00186454: a4820000 sh r2,0x0000(r4)             |Store XA (150% of previous value)
00186458: 03e00008 jr r31                   END
0018645c: 00000000 nop           

Return Locations

Battle.bin
00188620: Physical XA Modifying Statuses/Support 
00188afc: Cluster of Physical Routines
001898b0: 28 StealExp_(Lowest of TarCurExp & SP+Y) Hit_(SP+X)%