Execute Ability

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search

000740d4: 27bdffe8 addiu r29,r29,0xffe8
000740d8: 00002021 addu r4,r0,r0
000740dc: 00002821 addu r5,r0,r0
000740e0: 00003021 addu r6,r0,r0
000740e4: afbf0014 sw r31,0x0014(r29)
000740e8: 0c04f58d jal 0x0013d634                  # Store unit names and some event block data
000740ec: afb00010 sw r16,0x0010(r29)
000740f0: 0c01e886 jal 0x0007a218                  # Get Caster's Misc Data
000740f4: 00000000 nop
000740f8: 00408021 addu r16,r2,r0                  # r6 = Unit misc data pointer
000740fc: 8e020134 lw r2,0x0134(r16)               # r2 = Unit Battle Stats pointer
00074100: 00000000 nop
00074104: 9044018a lbu r4,0x018a(r2)               # r4 = Unit Battle Stats index
00074108: 0c060eea jal 0x00183ba8                  # Set Only Action Taken
0007410c: 00000000 nop
00074110: 9202013c lbu r2,0x013c(r16)              # Misc offset 0x13c: set to 0 when ability CT resolves/mimic ability used
00074114: 02002021 addu r4,r16,r0                  # r4 = Unit misc data pointer
00074118: 34420002 ori r2,r2,0x0002                # r2 = Misc 0ffset 0x13c OR 0x02
0007411c: 0c01c99d jal 0x00072674                  # 00072674 - 00072708 
00074120: a202013c sb r2,0x013c(r16)               # Store modified offset 0x13c
00074124: 0c05f0f7 jal 0x0017c3dc                  # Call Attack Preparation (AT list preview)
00074128: 2604015c addiu r4,r16,0x015c             # r4 = Misc data pointer + 0x15C
0007412c: 00401821 addu r3,r2,r0                   # r3 = 0x00 if ability has CT, 0x01 if no CT, -0x01 if invalid data
00074130: 34020001 ori r2,r0,0x0001                # r2 = 0x01
00074134: 10620013 beq r3,r2,0x00074184            # Branch if ability has no CT
00074138: ae03017c sw r3,0x017c(r16)               # Save CT result to misc data offset 0x017c
0007413c: 28620002 slti r2,r3,0x0002
00074140: 10400005 beq r2,r0,0x00074158            # Branch if CT result was 2+
00074144: 00000000 nop
00074148: 1060000a beq r3,r0,0x00074174            # Branch if ability had CT
0007414c: 00000000 nop
00074150: 0801d078 j 0x000741e0                    # Jump to near end if CT result was invalid
00074154: 00000000 nop
00074158: 34020002 ori r2,r0,0x0002                # Result = 2+ | r2 = 2
0007415c: 10620020 beq r3,r2,0x000741e0            #             | Branch if CT result was 2
00074160: 34020003 ori r2,r0,0x0003                #             | r2 = 3
00074164: 10620007 beq r3,r2,0x00074184            #             | Branch if CT result was 3
00074168: 00000000 nop                             #             |
0007416c: 0801d078 j 0x000741e0                    #             | Jump to near end if CT result was 4+
00074170: 00000000 nop                         
00074174: 0c020ae0 jal 0x00082b80                  # Result = 0 | Set attack animation flags and facing 2
00074178: 02002021 addu r4,r16,r0                  #            | r4 = Unit misc data pointer
0007417c: 0801d07a j 0x000741e8                    #            | Jump to end
00074180: 00000000 nop                          
00074184: 0c01bbbc jal 0x0006eef0                  # Result = 1 or 3 | Set Game Flow Variable to 0
00074188: 00000000 nop                             #                 | 
0007418c: 3402001e ori r2,r0,0x001e                #                 | r2 = 0x1E
00074190: 3c018009 lui r1,0x8009                   #                 | 
00074194: ac2260e4 sw r2,0x60e4(r1)                #                 | Store 0x1E at 0x800960e4 
00074198: 3c01800a lui r1,0x800a                   #                 | 
0007419c: ac208db8 sw r0,-0x7248(r1)               #                 | Clear 0x8009edb8
000741a0: 9202013c lbu r2,0x013c(r16)              #                 | r2 = Misc data offset 0x13c
000741a4: 96030138 lhu r3,0x0138(r16)              #                 | r3 = Used Ability ID
000741a8: 34420002 ori r2,r2,0x0002                #                 | r2 = *0x13c OR 0x02
000741ac: a202013c sb r2,0x013c(r16)               #                 | Store modified 0x13c
000741b0: 00031040 sll r2,r3,0x01                  #                 | r2 = Ability ID * 2
000741b4: 00431021 addu r2,r2,r3                   #                 | r2 = Ability ID * 3
000741b8: 3c018009 lui r1,0x8009                   #                 | 
000741bc: 00220821 addu r1,r1,r2                   #                 | 
000741c0: 90223e10 lbu r2,0x3e10(r1)               #                 | r2 = Ability Animation Flags
000741c4: 00000000 nop                             #                 | 
000741c8: 10400009 beq r2,r0,0x000741f0            #                 | Branch if no animation flags
000741cc: 00000000 nop                             #                 | 
000741d0: 0c020ae0 jal 0x00082b80                  #                 | Set attack animation flags and facing 2
000741d4: 02002021 addu r4,r16,r0                  #                 | r4 = Unit misc data pointer
000741d8: 0801d07c j 0x000741f0                    #                 | Jump to end
000741dc: 00000000 nop
000741e0: 0c01128d jal 0x00044a34                  # 0x44a34
000741e4: 34040013 ori r4,r0,0x0013                # r4 = 13
000741e8: 0c01cac5 jal 0x00072b14                  # 00072b14 - 00072b4c
000741ec: 02002021 addu r4,r16,r0                  # r4 = Unit misc data pointer
000741f0: 8fbf0014 lw r31,0x0014(r29)
000741f4: 8fb00010 lw r16,0x0010(r29)
000741f8: 27bd0018 addiu r29,r29,0x0018
000741fc: 03e00008 jr r31
00074200: 00000000 nop