Finger Guard

From Final Fantasy Hacktics Wiki
Revision as of 19:42, 22 April 2022 by Orkney (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
No Parameters - Returns Nothing

If Unit can react and is using Finger Guard
  - Roll react chances (random from 0 to 100 Vs Target's Brave)
  - If Target is reacting:- Set Action hit flag to MISS
                           - Store 0x1c0 as reaction ID 
                           - Set Evade type = 0x0b
--------------------------------------------------------------------------------------------
001882f8: 3c048019 lui r4,0x8019            |
001882fc: 8c842d98 lw r4,0x2d98(r4)         |r2 = Target data pointer Load Defender's Stats
00188300: 27bdffe8 addiu r29,r29,-0x0018    |
00188304: afbf0010 sw r31,0x0010(r29)       |
00188308: 0c063248 jal 0x0018c920           |-->Check if unit can react 1 r2 = 0x00 if unit can react (check status, depth, action state etc..)
0018830c: 00000000 nop                      |
00188310: 14400022 bne r2,r0,0x0018839c     #If Unit can react /Else branch to  END
00188314: 00000000 nop                          |
00188318: 3c058019 lui r5,0x8019                |
0018831c: 8ca52d98 lw r5,0x2d98(r5)             |r5 = Target data pointer
00188320: 00000000 nop                          |
00188324: 90a2008e lbu r2,0x008e(r5)            |r2 = Target Reaction Abilities (4th set)
00188328: 00000000 nop                          |
0018832c: 30420020 andi r2,r2,0x0020            |r2 = 0x20 if Target uses Finger Guard
00188330: 1040001a beq r2,r0,0x0018839c         #If Target uses Finger Guard /Else branch to  END
00188334: 34020064 ori r2,r0,0x0064                 |r2 = 0x64 (100)
00188338: 90a30024 lbu r3,0x0024(r5)                |r3 = Target Brave
0018833c: 3c048019 lui r4,0x8019                    |
00188340: 8c842d90 lw r4,0x2d90(r4)                 |r4 = Target Current Action (TCA) data pointer
00188344: 00431023 subu r2,r2,r3                    |r2 = 100 - Target's Brave
00188348: 1040000a beq r2,r0,0x00188374             #If Target Brave < 100 /Else 100% of guarding, branch to Attack fail section
0018834c: a482002a sh r2,0x002a(r4)                 |Set TCA Hit% = 100 - Brave
00188350: 0c0634e1 jal 0x0018d384                       |-->Chance_to_React Returns r2 = 0x00 if Target is reacting ( Random (0 to 100) < Target Brave)
00188354: 00a02021 addu r4,r5,r0                        |r4 = Target data pointer
00188358: 14400010 bne r2,r0,0x0018839c                 #If Target is reacting /Else branch to  END
0018835c: 00000000 nop                                      |
00188360: 3c028019 lui r2,0x8019                            |
00188364: 8c42f5fc lw r2,-0x0a04(r2)                        |r2 = Action State
00188368: 00000000 nop                                      |
0018836c: 1440000b bne r2,r0,0x0018839c                     #If Action is being executed /Else branch to  END
00188370: 00000000 nop                                          |
00188374: 3c028019 lui r2,0x8019                    #E          |
00188378: 8c422d90 lw r2,0x2d90(r2)                             |r2 = TCA data pointer
0018837c: 00000000 nop                                          |
00188380: a0400000 sb r0,0x0000(r2)                             |Set TCA hit flag to MISS
00188384: 3c038019 lui r3,0x8019                                |
00188388: 8c632d90 lw r3,0x2d90(r3)                             |r3 = TCA data pointer
0018838c: 340201c0 ori r2,r0,0x01c0                             |r2 = 0x1c0 (Finger Guard ID)
00188390: a462000e sh r2,0x000e(r3)                             |Store Finger Guard ID in TCA Reaction ID
00188394: 3402000b ori r2,r0,0x000b                             |r2 = 0x0b
00188398: a0620002 sb r2,0x0002(r3)                             |Store TCA Evade Type = 0x0b (shared with blade grasp)
0018839c: 8fbf0010 lw r31,0x0010(r29)       END
001883a0: 27bd0018 addiu r29,r29,0x0018
001883a4: 03e00008 jr r31
001883a8: 00000000 nop

Return locations

Battle.bin
00189a20: 2A_Hit_(MA%2BX)%25_//_AffectBraveOrFaith(Y)