Difference between revisions of "Perform reaction abilities"

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search
 
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 +
Support some reaction abilities
 +
returns r2 :
 +
    = 0x01 if ability is supported (current action will be modified)
 +
    = 0x00 if reaction flag as 0x01 is enabled but not 0x02
 +
              rq : reflect is here, but reacting unit ID is stored in attacker data pointer before exiting the routine
 +
    = -0x01 if ability ID is > 0x1be (damage split)
 +
-------------------------------------------------------------------------------------------------------
 +
0018af2c: 27bdffe8 addiu r29,r29,0xffe8    |
 +
0018af30: afb00010 sw r16,0x0010(r29)      |
 +
0018af34: 34100001 ori r16,r0,0x0001        |{{f/std|<nowiki>r16 = 0x01 (for current action attack type - pseudo status change by default)</nowiki>}}
 +
0018af38: 3c048019 lui r4,0x8019            |
 +
0018af3c: 84842d9c lh r4,0x2d9c(r4)        |{{f/load|<nowiki>r4 = Current action : reaction ID</nowiki>}}
 +
0018af40: 340201b8 ori r2,r0,0x01b8        |{{f/std|<nowiki>r2 = 0x1b8 (Reflect ID)</nowiki>}}
 +
0018af44: 1482000c bne r4,r2,0x0018af78    {{f/Cond|<nowiki>If Current reaction reaction is reflect</nowiki>}}
 +
0018af48: afbf0014 sw r31,0x0014(r29)            |{{f/store|<nowiki> </nowiki>}}
 +
0018af4c: 3c028019 lui r2,0x8019                |{{f/std|<nowiki> </nowiki>}}
 +
0018af50: 8c42f8c8 lw r2,-0x0738(r2)            |{{f/load|<nowiki>r2 = Acting unit ID</nowiki>}}
 +
0018af54: 00000000 nop                          |
 +
0018af58: 000218c0 sll r3,r2,0x03                |{{f/std|<nowiki>unit ID * 0x8</nowiki>}}
 +
0018af5c: 00621823 subu r3,r3,r2                |{{f/std|<nowiki>unit ID * 0x7</nowiki>}}
 +
0018af60: 00031980 sll r3,r3,0x06                |{{f/std|<nowiki>unit ID * 0x1c0</nowiki>}}
 +
0018af64: 3c028019 lui r2,0x8019                |
 +
0018af68: 244208cc addiu r2,r2,0x08cc            |{{f/std|<nowiki>r2 = 0x801908cc (unit data start)</nowiki>}}
 +
0018af6c: 00621821 addu r3,r3,r2                |{{f/std|<nowiki>r3 = 0x801908cc + ID * 0x1c0 (Reacting unit data pointer)</nowiki>}}
 +
0018af70: 3c018019 lui r1,0x8019                |
 +
0018af74: ac232d94 sw r3,0x2d94(r1)              |{{f/store|<nowiki>Store (re)acting unit data pointer in attacker data pointer</nowiki>}}
 +
0018af78: 3c018006 lui r1,0x8006                |
 +
0018af7c: 00240821 addu r1,r1,r4            |{{f/std|<nowiki>r1 = 0x8006 + Reaction ID</nowiki>}}
 +
0018af80: 9022ea2a lbu r2,-0x15d6(r1)      |{{f/load|<nowiki>r2 = Reaction flag of used reaction</nowiki>}} {{f/jal|Reaction_Flags|<nowiki>Reaction_Flags</nowiki>}}
 +
0018af84: 34030001 ori r3,r0,0x0001        |{{f/std|<nowiki>r3 = 0x1</nowiki>}}
 +
0018af88: 30420003 andi r2,r2,0x0003        |{{f/std|<nowiki>if reaction flags have 0x1, or 0x2 set, return either (or both) values / Else 0x00</nowiki>}}
 +
0018af8c: 104300b4 beq r2,r3,0x0018b260    {{f/Cond|<nowiki>if reaction don't have the flag 0x01 without 0x02</nowiki>}} /Else branch to {{f/loc|<nowiki>end</nowiki>}}
 +
0018af90: 00001021 addu r2,r0,r0            |{{f/std|<nowiki>r2 = 0x00</nowiki>}}
 +
0018af94: 0c062b7d jal 0x0018adf4                |{{f/jal|Action_data_nulling|<nowiki>Action_data_nulling</nowiki>}} {{f/std|<nowiki>reset most of target and attacker current action data</nowiki>}}
 +
0018af98: 00000000 nop                          |
 +
0018af9c: 3c028019 lui r2,0x8019                |
 +
0018afa0: 94422d9c lhu r2,0x2d9c(r2)            |{{f/load|<nowiki>r2 = current action reaction ID</nowiki>}}
 +
0018afa4: 00000000 nop                          |
 +
0018afa8: 2442fe5a addiu r2,r2,-0x01a6          |{{f/std|<nowiki>reaction ID - 0x01a6 (A Save = 0x00 , Hamedo = 0x1f)  (will be refered as reaction number)</nowiki>}}
 +
0018afac: 00021400 sll r2,r2,0x10                |
 +
0018afb0: 00021c03 sra r3,r2,0x10                |{{f/std|<nowiki>r3 = reaction number</nowiki>}} {{f/std|<nowiki>Clear a potential upper part of r2 ? (r2 unchanged)</nowiki>}}
 +
0018afb4: 2c620019 sltiu r2,r3,0x0019            |{{f/std|<nowiki>r2 = 0x01 if reaction is between A-Save and damage split</nowiki>}}
 +
0018afb8: 10400092 beq r2,r0,0x0018b204          {{f/Cond|<nowiki>if reaction is between A-Save and damage split</nowiki>}} {{f/std|<nowiki>Else go to non supported reactions</nowiki>}}
 +
0018afbc: 00031080 sll r2,r3,0x02                    |{{f/std|<nowiki>r2 = reactionID * 4</nowiki>}}
 +
0018afc0: 3c018017 lui r1,0x8017                    |
 +
0018afc4: 00220821 addu r1,r1,r2                    |{{f/std|<nowiki>r1 = 8017 + Reaction number</nowiki>}}
 +
0018afc8: 8c22429c lw r2,0x429c(r1)                  |{{f/adr|<nowiki>r2 = jump adress from table</nowiki>}} {{f/jal|Reaction_abilities_return_adress_table|<nowiki>Reaction_abilities_return_adress_table</nowiki>}}
 +
0018afcc: 00000000 nop                              |
 +
0018afd0: 00400008 jr r2                            {{f/jump|<nowiki>jump to case pointer</nowiki>}}
 +
0018afd4: 00000000 nop                              |
 +
 +
                                            {{f/com|--- A-Save section ---}}
 +
0018afd8: 3c038019 lui r3,0x8019                    |{{f/std|<nowiki> </nowiki>}}
 +
0018afdc: 8c632d90 lw r3,0x2d90(r3)                  |{{f/adr|<nowiki>r3 = target current action data pointer</nowiki>}}
 +
0018afe0: 34020081 ori r2,r0,0x0081                  |{{f/std|<nowiki>r2 = 0x81</nowiki>}}
 +
0018afe4: 08062c86 j 0x0018b218                      {{f/jump|<nowiki>jump to </nowiki>{{f/loc|<nowiki>store attack type section</nowiki>}}<nowiki></nowiki>}}
 +
0018afe8: a0620014 sb r2,0x0014(r3)                  |{{f/store|<nowiki>store 0x81 in Target current action PA change (Bonus + 1 PA)</nowiki>}}
 +
 +
                                            {{f/com|--- MA-Save section ---}}
 +
0018afec: 3c038019 lui r3,0x8019                    |{{f/std|<nowiki> </nowiki>}}
 +
0018aff0: 8c632d90 lw r3,0x2d90(r3)                  |{{f/adr|<nowiki>r3 = target current action data pointer</nowiki>}}
 +
0018aff4: 34020081 ori r2,r0,0x0081                  |{{f/std|<nowiki>r2 = 0x81</nowiki>}}
 +
0018aff8: 08062c86 j 0x0018b218                      {{f/jump|<nowiki>jump to </nowiki>{{f/loc|<nowiki>store attack type section</nowiki>}}<nowiki></nowiki>}}
 +
0018affc: a0620015 sb r2,0x0015(r3)                  |{{f/store|<nowiki>store 0x81 in Target current action MA change (Bonus + 1 MA)</nowiki>}}
 +
 +
                                            {{f/com|--- Speed-Save section ---}}
 +
0018b000: 3c038019 lui r3,0x8019                    |{{f/std|<nowiki> </nowiki>}}
 +
0018b004: 8c632d90 lw r3,0x2d90(r3)                  |{{f/adr|<nowiki>r3 = target current action data pointer</nowiki>}}
 +
0018b008: 34020081 ori r2,r0,0x0081                  |{{f/std|<nowiki>r2 = 0x81</nowiki>}}
 +
0018b00c: 08062c86 j 0x0018b218                      {{f/jump|<nowiki>jump to </nowiki>{{f/loc|<nowiki>store attack type section</nowiki>}}<nowiki></nowiki>}}
 +
0018b010: a0620012 sb r2,0x0012(r3)                  |{{f/store|<nowiki>store 0x81 in Target current action speed change (Bonus + 1 speed)</nowiki>}}
 +
 +
                                            {{f/com|--- Sunken State---}}
 +
0018b014: 00002021 addu r4,r0,r0                    |{{f/std|<nowiki>r4 = 0 (for status validation jal)</nowiki>}}
 +
0018b018: 3c038019 lui r3,0x8019                    |
 +
0018b01c: 8c632d90 lw r3,0x2d90(r3)                  |{{f/adr|<nowiki>r3 = target current action data pointer</nowiki>}}
 +
0018b020: 34020010 ori r2,r0,0x0010                  |{{f/std|<nowiki>r2 = 0x10 (sunken state flag)</nowiki>}}
 +
0018b024: 08062c1c j 0x0018b070                      {{f/jump|<nowiki>jump to end of regenerator section :  </nowiki>{{f/loc|<nowiki>Status change validation</nowiki>}}<nowiki></nowiki>}}
 +
0018b028: a062001d sb r2,0x001d(r3)                  |{{f/store|<nowiki>Store transparent in target current action status infliction set 3</nowiki>}}
 +
 +
                                            {{f/com|---  Caution ---}}
 +
0018b02c: 00002021 addu r4,r0,r0                    |{{f/std|<nowiki>r4 = 0 (for status validation jal)</nowiki>}}
 +
0018b030: 3c038019 lui r3,0x8019                    |
 +
0018b034: 8c632d90 lw r3,0x2d90(r3)                  |{{f/adr|<nowiki>r3 = target current action data pointer</nowiki>}}
 +
0018b038: 34020002 ori r2,r0,0x0002                  |{{f/std|<nowiki>r2 = 02 (defending flag)</nowiki>}}
 +
0018b03c: 08062c1c j 0x0018b070                      {{f/jump|<nowiki>jump to end of regenerator section :  </nowiki>{{f/loc|<nowiki>Status change validation</nowiki>}}<nowiki></nowiki>}}
 +
0018b040: a062001b sb r2,0x001b(r3)                  |{{f/store|<nowiki>Store defending in target current action status infliction set 1</nowiki>}}
 +
 +
                                            {{f/com|--- Dragon Spirit ---}}
 +
0018b044: 00002021 addu r4,r0,r0                    |{{f/std|<nowiki>r4 = 0 (for status validation jal)</nowiki>}}
 +
0018b048: 3c038019 lui r3,0x8019                    |
 +
0018b04c: 8c632d90 lw r3,0x2d90(r3)                  |{{f/adr|<nowiki>r3 = target current action data pointer</nowiki>}}
 +
0018b050: 34020020 ori r2,r0,0x0020                  |{{f/std|<nowiki>r2 = 0x20 (reraise flag)</nowiki>}}
 +
0018b054: 08062c1c j 0x0018b070                      {{f/jump|<nowiki>jump to end of regenerator section :  </nowiki>{{f/loc|<nowiki>Status change validation</nowiki>}}<nowiki></nowiki>}}
 +
0018b058: a062001d sb r2,0x001d(r3)                  |{{f/store|<nowiki>Store reraise in target current action status infliction set 3</nowiki>}}
 +
 +
                                            {{f/com|---  Regenerator ---}}
 +
0018b05c: 00002021 addu r4,r0,r0                    |{{f/std|<nowiki>r4 = 0 (for status validation jal)</nowiki>}}
 +
0018b060: 3c038019 lui r3,0x8019                    |
 +
0018b064: 8c632d90 lw r3,0x2d90(r3)                  |{{f/adr|<nowiki>r3 = target current action data pointer</nowiki>}}
 +
0018b068: 34020040 ori r2,r0,0x0040                  |{{f/std|<nowiki>r2 = 0x40 (regen flag)</nowiki>}}
 +
0018b06c: a062001e sb r2,0x001e(r3)                  |{{f/store|<nowiki>Store regen in target current action status infliction set 4</nowiki>}}
 +
0018b070: 0c0612c9 jal 0x00184b24                    |{{f/jal|Modify_Status_Inflictions|<nowiki>Modify_Status_Inflictions</nowiki>}} {{f/std|<nowiki>Multiples check - may result in no status infliction</nowiki>}}
 +
0018b074: 00000000 nop                              |
 +
0018b078: 10400067 beq r2,r0,0x0018b218              {{f/Cond|<nowiki>If status infliction is ok</nowiki>}} /Else no status infliction : branch to to {{f/loc|<nowiki>store attack type section</nowiki>}}
 +
0018b07c: 00000000 nop                              |
 +
0018b080: 08062c86 j 0x0018b218                          {{f/jump|<nowiki>jump to </nowiki>{{f/loc|<nowiki>store attack type section</nowiki>}}<nowiki></nowiki>}}
 +
0018b084: 34100008 ori r16,r0,0x0008                    |{{f/std|<nowiki>r16 = 0x08 (status change flag for current action attack type)</nowiki>}}
 +
 +
                                            {{f/com|--- Brave Up ---}}
 +
0018b088: 3c038019 lui r3,0x8019                    |{{f/std|<nowiki> </nowiki>}}
 +
0018b08c: 8c632d90 lw r3,0x2d90(r3)                  |{{f/adr|<nowiki>r3 = target current action data pointer</nowiki>}}
 +
0018b090: 34020083 ori r2,r0,0x0083                  |{{f/std|<nowiki>r2 = 0x83</nowiki>}}
 +
0018b094: 08062c86 j 0x0018b218                      {{f/jump|<nowiki>jump to </nowiki>{{f/loc|<nowiki>store attack type section</nowiki>}}<nowiki></nowiki>}}
 +
0018b098: a0620016 sb r2,0x0016(r3)                  |{{f/store|<nowiki>store 0x83 in Target current action brave change (Bonus + 3)</nowiki>}}
 +
 +
                                            {{f/com|---  Faith Up ---}}
 +
0018b09c: 3c038019 lui r3,0x8019                    |{{f/std|<nowiki> </nowiki>}}
 +
0018b0a0: 8c632d90 lw r3,0x2d90(r3)                  |{{f/adr|<nowiki>r3 = target current action data pointer</nowiki>}}
 +
0018b0a4: 34020083 ori r2,r0,0x0083                  |{{f/std|<nowiki>r2 = 0x83</nowiki>}}
 +
0018b0a8: 08062c86 j 0x0018b218                      {{f/jump|<nowiki>jump to </nowiki>{{f/loc|<nowiki>store attack type section</nowiki>}}<nowiki></nowiki>}}
 +
0018b0ac: a0620017 sb r2,0x0017(r3)                  |{{f/store|<nowiki>store 0x83 in Target current action faith change (Bonus + 3)</nowiki>}}
 +
 +
                                            {{f/com|--- HP restore ---}}
 +
0018b0b0: 3c038019 lui r3,0x8019                    |{{f/std|<nowiki> </nowiki>}}
 +
0018b0b4: 8c632d98 lw r3,0x2d98(r3)                  |{{f/adr|<nowiki>r3 = target data pointer</nowiki>}}
 +
0018b0b8: 34100040 ori r16,r0,0x0040                |{{f/std|<nowiki>r16 = 0x40 (attack type will be HP recovery)</nowiki>}}
 +
0018b0bc: 9462002a lhu r2,0x002a(r3)                |{{f/load|<nowiki>r2 =  target Max HP</nowiki>}}
 +
0018b0c0: 94630028 lhu r3,0x0028(r3)                |{{f/load|<nowiki>r3 =  target HP</nowiki>}}
 +
0018b0c4: 3c048019 lui r4,0x8019                    |
 +
0018b0c8: 8c842d90 lw r4,0x2d90(r4)                  |{{f/adr|<nowiki>r4 = target current action data pointer</nowiki>}}
 +
0018b0cc: 00431023 subu r2,r2,r3                    |{{f/std|<nowiki>r2 = target missing HP</nowiki>}}
 +
0018b0d0: 08062c86 j 0x0018b218                      {{f/jump|<nowiki>jump to </nowiki>{{f/loc|<nowiki>store attack type section</nowiki>}}<nowiki></nowiki>}}
 +
0018b0d4: a4820006 sh r2,0x0006(r4)                  |{{f/store|<nowiki>Store missing HP as Target current action HP recovery</nowiki>}}
 +
 +
                                            {{f/com|--- MP restore ---}}
 +
0018b0d8: 3c038019 lui r3,0x8019                    |{{f/std|<nowiki> </nowiki>}}
 +
0018b0dc: 8c632d98 lw r3,0x2d98(r3)                  |{{f/adr|<nowiki>r3 = target data pointer</nowiki>}}
 +
0018b0e0: 34100010 ori r16,r0,0x0010                |{{f/std|<nowiki>r16 = 0x10 (attack type will be MP recovery)</nowiki>}}
 +
0018b0e4: 9462002e lhu r2,0x002e(r3)                |{{f/load|<nowiki>r2 =  target Max MP</nowiki>}}
 +
0018b0e8: 9463002c lhu r3,0x002c(r3)                |{{f/load|<nowiki>r3 =  target current MP</nowiki>}}
 +
0018b0ec: 3c048019 lui r4,0x8019                    |
 +
0018b0f0: 8c842d90 lw r4,0x2d90(r4)                  |{{f/adr|<nowiki>r4 = target current action data pointer</nowiki>}}
 +
0018b0f4: 00431023 subu r2,r2,r3                    |{{f/std|<nowiki>r2 = target missing MP</nowiki>}}
 +
0018b0f8: 08062c86 j 0x0018b218                      {{f/jump|<nowiki>jump to </nowiki>{{f/loc|<nowiki>store attack type section</nowiki>}}<nowiki></nowiki>}}
 +
0018b0fc: a482000a sh r2,0x000a(r4)                  |{{f/store|<nowiki>Store missing MP as Target current action MP recovery</nowiki>}}
 +
 +
                                            {{f/com|--- Critical quick  ---}}
 +
0018b100: 3c038019 lui r3,0x8019                    |{{f/std|<nowiki> </nowiki>}}
 +
0018b104: 8c632d90 lw r3,0x2d90(r3)                  |{{f/adr|<nowiki>r3 = target current action data pointer</nowiki>}}
 +
0018b108: 340200ff ori r2,r0,0x00ff                  |{{f/std|<nowiki>r2 = 0xff (will be CT100)</nowiki>}}
 +
0018b10c: 08062c86 j 0x0018b218                      {{f/jump|<nowiki>jump to </nowiki>{{f/loc|<nowiki>store attack type section</nowiki>}}<nowiki></nowiki>}}
 +
0018b110: a0620013 sb r2,0x0013(r3)                  |{{f/store|<nowiki>store Target current action CT change  =  CT100</nowiki>}}
 +
 +
                                            {{f/com|--- Meatbone slash  ---}}
 +
0018b114: 3c028019 lui r2,0x8019                    |{{f/std|<nowiki> </nowiki>}}
 +
0018b118: 8c422d94 lw r2,0x2d94(r2)                  |{{f/adr|<nowiki>r2 = Attacker data pointer</nowiki>}}
 +
0018b11c: 3c038019 lui r3,0x8019                    |
 +
0018b120: 8c632d90 lw r3,0x2d90(r3)                  |{{f/adr|<nowiki>r3 = Target current action data pointer</nowiki>}}
 +
0018b124: 9442002a lhu r2,0x002a(r2)                |{{f/load|<nowiki>r2 = Attacker max HP</nowiki>}}
 +
0018b128: 34100080 ori r16,r0,0x0080                |{{f/std|<nowiki>r16 = 0x80 (attack type will be HP damage)</nowiki>}}
 +
0018b12c: 08062c86 j 0x0018b218                      {{f/jump|<nowiki>jump to </nowiki>{{f/loc|<nowiki>store attack type section</nowiki>}}<nowiki></nowiki>}}
 +
0018b130: a4620004 sh r2,0x0004(r3)                  |{{f/store|<nowiki>Store attacker max HP as Target current action HP damage</nowiki>}}
 +
 +
                                            {{f/com|--- Absorb used MP  ---}}
 +
0018b134: 3c028019 lui r2,0x8019                    |{{f/std|<nowiki> </nowiki>}}
 +
0018b138: 8c422d90 lw r2,0x2d90(r2)                  |{{f/adr|<nowiki>r2 = Target current action data pointer</nowiki>}}
 +
0018b13c: 00000000 nop                              |
 +
0018b140: 94430026 lhu r3,0x0026(r2)                |{{f/load|<nowiki>r3 = Target last attack received</nowiki>}}
 +
0018b144: 34100010 ori r16,r0,0x0010                |{{f/std|<nowiki>r16 = 0x10 (attack type will be MP recovery)</nowiki>}}
 +
0018b148: 08062c86 j 0x0018b218                      {{f/jump|<nowiki>jump to </nowiki>{{f/loc|<nowiki>store attack type section</nowiki>}}<nowiki></nowiki>}}
 +
0018b14c: a443000a sh r3,0x000a(r2)                  |{{f/store|<nowiki>store last attack received as target current action MP recovery ? (is this value transformed by another routine?)</nowiki>}}
 +
 +
                                            {{f/com|---  Gilgame heart  ---}}
 +
0018b150: 3c038019 lui r3,0x8019                    |{{f/std|<nowiki> </nowiki>}}
 +
0018b154: 8c632d90 lw r3,0x2d90(r3)                  |{{f/adr|<nowiki>r3 = Target current action data pointer</nowiki>}}
 +
0018b158: 00000000 nop                              |
 +
0018b15c: 94620026 lhu r2,0x0026(r3)                |{{f/load|<nowiki>r2 = Target last attack received</nowiki>}}
 +
0018b160: 08062c86 j 0x0018b218                      {{f/jump|<nowiki>jump to </nowiki>{{f/loc|<nowiki>store attack type section</nowiki>}}<nowiki></nowiki>}}
 +
0018b164: a462000c sh r2,0x000c(r3)                  |{{f/store|<nowiki>store last attack received as  target current action  gil stolen/lost ? (is this value transformed by another routine?)</nowiki>}}
 +
 +
                                            {{f/com|---  Distribute ---}}
 +
0018b168: 3c038019 lui r3,0x8019                    |{{f/std|<nowiki> </nowiki>}}
 +
0018b16c: 8c633878 lw r3,0x3878(r3)                  |{{f/adr|<nowiki>r3 = Targets hit counter</nowiki>}}
 +
0018b170: 00000000 nop                              |
 +
0018b174: 1060000c beq r3,r0,0x0018b1a8              {{f/Cond|<nowiki>If number of targets hit <> 0x00</nowiki>}}
 +
0018b178: 00000000 nop                                  |{{f/std|<nowiki> </nowiki>}}
 +
0018b17c: 3c028019 lui r2,0x8019                        |{{f/std|<nowiki> </nowiki>}}
 +
0018b180: 8c422d94 lw r2,0x2d94(r2)                      |{{f/adr|<nowiki>r2 = Attacker data pointer</nowiki>}}
 +
0018b184: 00000000 nop                                  |
 +
0018b188: 944201b2 lhu r2,0x01b2(r2)                    |{{f/load|<nowiki>r2 = attacker last attack received</nowiki>}}
 +
0018b18c: 00000000 nop                                  |
 +
0018b190: 00431021 addu r2,r2,r3                        |{{f/std|<nowiki>r2 = last attack received + targets hit counter</nowiki>}}
 +
0018b194: 2442ffff addiu r2,r2,-0x0001                  |{{f/std|<nowiki>r2 = last attack received + targets hit counter -1 (it's a way to round up the fraction of heal ?)</nowiki>}}
 +
0018b198: 0043001a div r2,r3                            |{{f/std|<nowiki>r2 / number of targets</nowiki>}}
 +
0018b19c: 00001812 mflo r3                              |{{f/std|<nowiki>r3 =(last attack received + targets hit counter -1)/targets hit counter</nowiki>}}
 +
0018b1a0: 08062c6b j 0x0018b1ac                          {{f/jump|<nowiki>jump keeping r3 value</nowiki>}}
 +
0018b1a4: 00000000 nop                                  |
 +
0018b1a8: 00001821 addu r3,r0,r0                    {{f/Cond|<nowiki>E r3 = 0x00</nowiki>}}
 +
0018b1ac: 3c028019 lui r2,0x8019                    |
 +
0018b1b0: 8c422d90 lw r2,0x2d90(r2)                  |{{f/adr|<nowiki>r2 = Target current action data pointer</nowiki>}}
 +
0018b1b4: 34100040 ori r16,r0,0x0040                |{{f/std|<nowiki>r16 = 0x40 (attack type will be HP recovery)</nowiki>}}
 +
0018b1b8: 08062c86 j 0x0018b218                      {{f/jump|<nowiki>jump to </nowiki>{{f/loc|<nowiki>store attack type section</nowiki>}}<nowiki></nowiki>}}
 +
0018b1bc: a4430006 sh r3,0x0006(r2)                  |{{f/store|<nowiki>store r3 as target current action hp recovery</nowiki>}}
 +
 +
                                            {{f/com|---  Damage Split ---}}
 +
0018b1c0: 3c028019 lui r2,0x8019                    |{{f/std|<nowiki> </nowiki>}}
 +
0018b1c4: 8c422d94 lw r2,0x2d94(r2)                  |{{f/adr|<nowiki>r2 = Attacker data pointer</nowiki>}}
 +
0018b1c8: 3c048019 lui r4,0x8019                    |
 +
0018b1cc: 8c842d90 lw r4,0x2d90(r4)                  |{{f/adr|<nowiki>r4 = Target current action data pointer</nowiki>}}
 +
0018b1d0: 3c038019 lui r3,0x8019                    |
 +
0018b1d4: 8c632d8c lw r3,0x2d8c(r3)                  |{{f/adr|<nowiki>r3 = Attacker current action data pointer</nowiki>}}
 +
0018b1d8: 944201b2 lhu r2,0x01b2(r2)                |{{f/load|<nowiki>r2 = attacker last attack received</nowiki>}}
 +
0018b1dc: 34100080 ori r16,r0,0x0080                |{{f/std|<nowiki>r16 = 0x80 (attack type will be HP damage)</nowiki>}}
 +
0018b1e0: a4820004 sh r2,0x0004(r4)                  |{{f/store|<nowiki>store last attack received as target current action HP damage</nowiki>}}
 +
0018b1e4: a4620006 sh r2,0x0006(r3)                  |{{f/store|<nowiki>store last attack received as attacker current action HP recovery</nowiki>}}
 +
0018b1e8: 34020040 ori r2,r0,0x0040                  |{{f/std|<nowiki>r2 = 0x40</nowiki>}}
 +
0018b1ec: a0620025 sb r2,0x0025(r3)                  |{{f/store|<nowiki>Store Attacker current action attack type as HP recovery</nowiki>}}
 +
0018b1f0: 3c038019 lui r3,0x8019                    |
 +
0018b1f4: 8c632d8c lw r3,0x2d8c(r3)                  |{{f/adr|<nowiki>r3 = Attacker current action data pointer</nowiki>}}
 +
0018b1f8: 34020001 ori r2,r0,0x0001                  |{{f/std|<nowiki>r2 = 0x01</nowiki>}}
 +
0018b1fc: 08062c86 j 0x0018b218                      {{f/jump|<nowiki>jump to </nowiki>{{f/loc|<nowiki>store attack type section</nowiki>}}<nowiki></nowiki>}}
 +
0018b200: a0620000 sb r2,0x0000(r3)                  |{{f/store|<nowiki>Store Attacker current action hit flag as hit</nowiki>}}
 +
 +
                                            {{f/com|-- Post Damage split reaction abilities--}}
 +
0018b204: 3c038019 lui r3,0x8019                |{{f/std|<nowiki> </nowiki>}}
 +
0018b208: 8c632d90 lw r3,0x2d90(r3)              |{{f/adr|<nowiki>r3 = Target current action data pointer</nowiki>}}
 +
0018b20c: 2402ffff addiu r2,r0,-0x0001          |{{f/std|<nowiki>r2 = -0x0001</nowiki>}}
 +
0018b210: 08062c98 j 0x0018b260                  {{f/jump|<nowiki>jumps to end  </nowiki>}}
 +
0018b214: a0600025 sb r0,0x0025(r3)              |{{f/store|<nowiki>Store target current action hit flag as miss</nowiki>}} {{f/std|<nowiki>(Talcall here, This jump is for reactions that trigger a counter-ability, like counter Magic, or Counter attack.)</nowiki>}}
 +
 
 +
                                            {{f/com|-- Store attack type section --}}
 +
0018b218: 3c028019 lui r2,0x8019                |{{f/std|<nowiki> </nowiki>}}
 +
0018b21c: 8c422d90 lw r2,0x2d90(r2)              |{{f/adr|<nowiki>r2 = target current action data pointer</nowiki>}}
 +
0018b220: 0c062e91 jal 0x0018ba44                |{{f/jal|Set_some_data_for_current_attack|<nowiki>Set_some_data_for_current_attack</nowiki>}} {{f/std|<nowiki> Check target status (targetable ?), cap HP and MP to 999, deals with killing blows and golem</nowiki>}}
 +
0018b224: a0500025 sb r16,0x0025(r2)            |{{f/store|<nowiki>store target current action attack type (depend of sections above)</nowiki>}}
 +
0018b228: 3c038019 lui r3,0x8019                |
 +
0018b22c: 8c632d90 lw r3,0x2d90(r3)              |{{f/adr|<nowiki>r3 = target current action data pointer</nowiki>}}
 +
0018b230: 00000000 nop                          |
 +
0018b234: 94620010 lhu r2,0x0010(r3)            |{{f/load|<nowiki>r2 = Target current action specials flags</nowiki>}}
 +
0018b238: 00000000 nop                          |
 +
0018b23c: 10400005 beq r2,r0,0x0018b254          {{f/Cond|<nowiki>If there is a special flag enabled</nowiki>}} /Else branch to almost end
 +
0018b240: 00000000 nop                              |{{f/std|<nowiki> </nowiki>}}
 +
0018b244: 90620025 lbu r2,0x0025(r3)                |{{f/load|<nowiki>r2 = Target current action attack type</nowiki>}}
 +
0018b248: 00000000 nop                              |{{f/std|<nowiki> </nowiki>}}
 +
0018b24c: 34420001 ori r2,r2,0x0001                  |{{f/std|<nowiki>Update r2 with 0x01 enabled</nowiki>}}
 +
0018b250: a0620025 sb r2,0x0025(r3)                  |{{f/store|<nowiki>store updated attack type with pseudo status flags enabled</nowiki>}}
 +
0018b254: 3c018019 lui r1,0x8019                    |
 +
0018b258: a42038c6 sh r0,0x38c6(r1)              |{{f/store|<nowiki>Clear current ability reaction ID</nowiki>}}
 +
0018b25c: 34020001 ori r2,r0,0x0001              |{{f/std|<nowiki>r2 = 0x1</nowiki>}}
 +
0018b260: 8fbf0014 lw r31,0x0014(r29)            |{{f/std|<nowiki>(landing site of jump for abilities not supported b this routine)</nowiki>}}
 +
0018b264: 8fb00010 lw r16,0x0010(r29)            |
 +
0018b268: 27bd0018 addiu r29,r29,0x0018         
 +
0018b26c: 03e00008 jr r31                       
 +
0018b270: 00000000 nop                         
  
0018af2c: 27bdffe8 addiu r29,r29,0xffe8
+
==Return locations==
0018af30: afb00010 sw r16,0x0010(r29)
+
  0018b404: [[Pre_Formula_Setup_(FDC)]]
0018af34: 34100001 ori r16,r0,0x0001
 
0018af38: 3c048019 lui r4,0x8019
 
0018af3c: 84842d9c lh r4,0x2d9c(r4) load reaction ID
 
0018af40: 340201b8 ori r2,r0,0x01b8                    r2 = Reflect
 
0018af44: 1482000c bne r4,r2,0x 0018af78 branch if reaction =/= reflect
 
0018af48: afbf0014 sw r31,0x0014(r29)
 
0018af4c: 3c028019 lui r2,0x8019
 
0018af50: 8c42f8c8 lw r2,-0x0738(r2) reacting unit ID
 
0018af54: 00000000 nop
 
0018af58: 000218c0 sll r3,r2,0x03 unit ID * 0x8
 
0018af5c: 00621823 subu r3,r3,r2 unit ID * 0x7
 
0018af60: 00031980 sll r3,r3,0x06                      unit ID * 0x1c0
 
0018af64: 3c028019 lui r2,0x8019
 
0018af68: 244208cc addiu r2,r2,0x08cc r2 = 0x801908cc (unit data start)
 
0018af6c: 00621821 addu r3,r3,r2 r3 = 0x801908cc + ID * 0x1c0 (Reacting unit data pointer)
 
0018af70: 3c018019 lui r1,0x8019
 
0018af74: ac232d94 sw r3,0x2d94(r1) store reacting unit data pointer
 
0018af78: 3c018006 lui r1,0x8006
 
0018af7c: 00240821 addu r1,r1,r4 r1 = 0x800601b8
 
0018af80: 9022ea2a lbu r2,-0x15d6(r1) load reflect reaction flags
 
0018af84: 34030001 ori r3,r0,0x0001 r3 = 0x1
 
0018af88: 30420003 andi r2,r2,0x0003 if reflect reaction flags have 0x1, or 0x2 set, return either (or both) values
 
0018af8c: 104300b4 beq r2,r3,0x 0018b260 branch if reaction flags have 0x01 set
 
0018af90: 00001021 addu r2,r0,r0
 
  0018af94: 0c062b7d jal 0x 0018adf4 [[Action data nulling]]
 
0018af98: 00000000 nop
 
0018af9c: 3c028019 lui r2,0x8019
 
0018afa0: 94422d9c lhu r2,0x2d9c(r2) load reaction ID
 
0018afa4: 00000000 nop
 
0018afa8: 2442fe5a addiu r2,r2,0xfe5a reaction ID - 0x01a6
 
0018afac: 00021400 sll r2,r2,0x10
 
0018afb0: 00021c03 sra r3,r2,0x10 reaction ID - 0x1a6
 
0018afb4: 2c620019 sltiu r2,r3,0x0019 set true if reaction ID is less than 19 (damage split or earlier)
 
0018afb8: 10400092 beq r2,r0,0x 0018b204 branch if reaction > weapon guard
 
0018afbc: 00031080 sll r2,r3,0x02 reactionID * 4
 
0018afc0: 3c018017 lui r1,0x8017
 
0018afc4: 00220821 addu r1,r1,r2
 
0018afc8: 8c22429c lw r2,0x429c(r1)                 load case pointer for this reactionID
 
0018afcc: 00000000 nop
 
0018afd0: 00400008 jr r2 jump to case pointer
 
0018afd4: 00000000 nop
 
 
 
A Save
 
0018afd8: 3c038019 lui r3,0x8019
 
0018afdc: 8c632d90 lw r3,0x2d90(r3) loads target current action data
 
0018afe0: 34020081 ori r2,r0,0x0081 r2 = + 1PA
 
0018afe4: 08062c86 j 0x 0018b218 jump to finish pseudo-status change
 
0018afe8: a0620014 sb r2,0x0014(r3) saves +PA change
 
 
 
MA Save
 
0018afec: 3c038019 lui r3,0x8019
 
0018aff0: 8c632d90 lw r3,0x2d90(r3) loads target current action data
 
0018aff4: 34020081 ori r2,r0,0x0081 r2 = + 1MA
 
0018aff8: 08062c86 j 0x 0018b218 jumps to finish pseudo-status change
 
0018affc: a0620015 sb r2,0x0015(r3) saves +MA change
 
 
 
Speed Save
 
0018b000: 3c038019 lui r3,0x8019
 
0018b004: 8c632d90 lw r3,0x2d90(r3) loads target current action data
 
0018b008: 34020081 ori r2,r0,0x0081 r2 = + 1SP
 
0018b00c: 08062c86 j 0x 0018b218 jumps to finish pseudo-status change
 
0018b010: a0620012 sb r2,0x0012(r3) saves +SP change
 
 
 
Sunken State
 
0018b014: 00002021 addu r4,r0,r0 r4 = 0
 
0018b018: 3c038019 lui r3,0x8019
 
0018b01c: 8c632d90 lw r3,0x2d90(r3) loads target current action data
 
0018b020: 34020010 ori r2,r0,0x0010 r2 = transparent
 
0018b024: 08062c1c j 0x 0018b070 jumps to validate status change (reused regenerator code)
 
0018b028: a062001d sb r2,0x001d(r3) saves transparent
 
 
 
Caution
 
0018b02c: 00002021 addu r4,r0,r0 r4 = 0
 
0018b030: 3c038019 lui r3,0x8019
 
0018b034: 8c632d90 lw r3,0x2d90(r3) loads target current action data
 
0018b038: 34020002 ori r2,r0,0x0002 r2 = defending
 
0018b03c: 08062c1c j 0x 0018b070 jumps to validate status change (reused regenerator code)
 
0018b040: a062001b sb r2,0x001b(r3) saves defending
 
 
 
Dragon Spirit
 
0018b044: 00002021 addu r4,r0,r0 r4 = 0
 
0018b048: 3c038019 lui r3,0x8019
 
0018b04c: 8c632d90 lw r3,0x2d90(r3) loads target current action data
 
0018b050: 34020020 ori r2,r0,0x0020 r2 = reraise
 
0018b054: 08062c1c j 0x 0018b070 jumps to validate status change
 
0018b058: a062001d sb r2,0x001d(r3) saves reraise
 
 
 
Regenerator
 
0018b05c: 00002021 addu r4,r0,r0
 
0018b060: 3c038019 lui r3,0x8019
 
0018b064: 8c632d90 lw r3,0x2d90(r3) loads target current action data
 
0018b068: 34020040 ori r2,r0,0x0040 r2 = regen
 
0018b06c: a062001e sb r2,0x001e(r3) saves regen
 
0018b070: 0c0612c9 jal 0x00184b24 [[Validate Status Changes]]
 
0018b074: 00000000 nop
 
0018b078: 10400067 beq r2,r0,0x 0018b218 branch to finish pseudo status change if fail
 
0018b07c: 00000000 nop
 
0018b080: 08062c86 j 0x 0018b218 jumps to finish pseudo status change (r16 makes this status change instead)
 
0018b084: 34100008 ori r16,r0,0x0008 r16 = status change
 
 
 
Brave up
 
0018b088: 3c038019 lui r3,0x8019
 
0018b08c: 8c632d90 lw r3,0x2d90(r3) loads target current action data
 
0018b090: 34020083 ori r2,r0,0x0083 r2 = + 3 Brave
 
0018b094: 08062c86 j 0x 0018b218 jumps to finish pseudo-status change
 
0018b098: a0620016 sb r2,0x0016(r3) save + Brave
 
 
 
Faith up
 
0018b09c: 3c038019 lui r3,0x8019
 
0018b0a0: 8c632d90 lw r3,0x2d90(r3) loads target current action data
 
0018b0a4: 34020083 ori r2,r0,0x0083 r2 = + 3 faith
 
0018b0a8: 08062c86 j 0x 0018b218 jumps to finish pseudo-status change
 
0018b0ac: a0620017 sb r2,0x0017(r3) save + faith
 
 
 
HP restore
 
0018b0b0: 3c038019 lui r3,0x8019
 
0018b0b4: 8c632d98 lw r3,0x2d98(r3) loads target's statistics
 
0018b0b8: 34100040 ori r16,r0,0x0040 attack type = hp recovery
 
0018b0bc: 9462002a lhu r2,0x002a(r3) load target Max HP
 
0018b0c0: 94630028 lhu r3,0x0028(r3) load target HP
 
0018b0c4: 3c048019 lui r4,0x8019
 
0018b0c8: 8c842d90 lw r4,0x2d90(r4) load target current action
 
0018b0cc: 00431023 subu r2,r2,r3 max hp - hp
 
0018b0d0: 08062c86 j 0x 0018b218 jumps to finish pseudo-status change (r16 changes this to hp recov)
 
0018b0d4: a4820006 sh r2,0x0006(r4) store hp recovery as lost HP
 
 
 
MP restore
 
0018b0d8: 3c038019 lui r3,0x8019
 
0018b0dc: 8c632d98 lw r3,0x2d98(r3) load target's statistics
 
0018b0e0: 34100010 ori r16,r0,0x0010 attack type = mp recovery
 
0018b0e4: 9462002e lhu r2,0x002e(r3) load target Max MP
 
0018b0e8: 9463002c lhu r3,0x002c(r3) load target MP
 
0018b0ec: 3c048019 lui r4,0x8019
 
0018b0f0: 8c842d90 lw r4,0x2d90(r4) load target current action data
 
0018b0f4: 00431023 subu r2,r2,r3 max mp - mp
 
0018b0f8: 08062c86 j 0x 0018b218 jumps to finish pseudo-status (r16 changes this to mp recov)
 
0018b0fc: a482000a sh r2,0x000a(r4) store mp recovery?
 
 
 
Critical quick
 
0018b100: 3c038019 lui r3,0x8019
 
0018b104: 8c632d90 lw r3,0x2d90(r3) loads target current action data
 
0018b108: 340200ff ori r2,r0,0x00ff r2 = CT100
 
0018b10c: 08062c86 j 0x 0018b218 jumps to finish pseudo-status change
 
0018b110: a0620013 sb r2,0x0013(r3) store CT change? = 0xFF (quick)
 
 
 
Meatbone slash
 
0018b114: 3c028019 lui r2,0x8019
 
0018b118: 8c422d94 lw r2,0x2d94(r2) loads attacker statistics data
 
0018b11c: 3c038019 lui r3,0x8019
 
0018b120: 8c632d90 lw r3,0x2d90(r3) loads target current action data
 
0018b124: 9442002a lhu r2,0x002a(r2) attacker max HP
 
0018b128: 34100080 ori r16,r0,0x0080 attack type = hp damage
 
0018b12c: 08062c86 j 0x 0018b218 jumps to finish pseudo-status change (r16 changes this to hp damage)
 
0018b130: a4620004 sh r2,0x0004(r3) save HP damage
 
 
 
absorb used MP?
 
0018b134: 3c028019 lui r2,0x8019
 
0018b138: 8c422d90 lw r2,0x2d90(r2) load target current action data
 
0018b13c: 00000000 nop
 
0018b140: 94430026 lhu r3,0x0026(r2) last attack received?
 
0018b144: 34100010 ori r16,r0,0x0010 attack type = mp recovery
 
0018b148: 08062c86 j 0x 0018b218 jumps to finish pseudo-status change (r16 changes this to MP recovery)
 
0018b14c: a443000a sh r3,0x000a(r2) store MP recovery as last attack received? (is this value transformed by another routine?)
 
 
 
Gilgame heart
 
0018b150: 3c038019 lui r3,0x8019
 
0018b154: 8c632d90 lw r3,0x2d90(r3) load target current action data
 
0018b158: 00000000 nop
 
0018b15c: 94620026 lhu r2,0x0026(r3) load last attack received?
 
0018b160: 08062c86 j 0x 0018b218 jumps to finish pseudo-status change
 
0018b164: a462000c sh r2,0x000c(r3) store gil stolen/lost as last attack received? (is this value transformed by another routine?)
 
 
 
Distribute
 
0018b168: 3c038019 lui r3,0x8019
 
0018b16c: 8c633878 lw r3,0x3878(r3) load distribute hit counter
 
0018b170: 00000000 nop
 
0018b174: 1060000c beq r3,r0,0x 0018b1a8 branch if no hits
 
0018b178: 00000000 nop
 
0018b17c: 3c028019 lui r2,0x8019
 
0018b180: 8c422d94 lw r2,0x2d94(r2) load attacker statistics data
 
0018b184: 00000000 nop
 
0018b188: 944201b2 lhu r2,0x01b2(r2) load last attack received
 
0018b18c: 00000000 nop
 
0018b190: 00431021 addu r2,r2,r3 last attack + hit counter?
 
0018b194: 2442ffff addiu r2,r2,0xffff last attack + hit counter + 0xffff?
 
0018b198: 0043001a div r2,r3 divide this value by the hit counter?
 
0018b19c: 00001812 mflo r3 get fraction of heal?
 
0018b1a0: 08062c6b j 0x 0018b1ac skips setting r3 to 0
 
0018b1a4: 00000000 nop
 
0018b1a8: 00001821 addu r3,r0,r0 sets r3 to 0
 
0018b1ac: 3c028019 lui r2,0x8019
 
0018b1b0: 8c422d90 lw r2,0x2d90(r2) loads target current action data
 
0018b1b4: 34100040 ori r16,r0,0x0040 r16 = hp recovery
 
0018b1b8: 08062c86 j 0x 0018b218 jumps to finish pseudo-status change (r16 makes this hp recov)
 
0018b1bc: a4430006 sh r3,0x0006(r2) store hp recovery
 
 
 
Damage Split
 
0018b1c0: 3c028019 lui r2,0x8019
 
0018b1c4: 8c422d94 lw r2,0x2d94(r2) r2 = attacker stats
 
0018b1c8: 3c048019 lui r4,0x8019
 
0018b1cc: 8c842d90 lw r4,0x2d90(r4) r4 = target action
 
0018b1d0: 3c038019 lui r3,0x8019
 
0018b1d4: 8c632d8c lw r3,0x2d8c(r3) r3 = attacker action
 
0018b1d8: 944201b2 lhu r2,0x01b2(r2) load last attack received
 
0018b1dc: 34100080 ori r16,r0,0x0080 attack type = HP damage
 
0018b1e0: a4820004 sh r2,0x0004(r4) store hp damage vs. target
 
0018b1e4: a4620006 sh r2,0x0006(r3) store hp recovery for attacker
 
0018b1e8: 34020040 ori r2,r0,0x0040
 
0018b1ec: a0620025 sb r2,0x0025(r3) store hp recovery
 
0018b1f0: 3c038019 lui r3,0x8019
 
0018b1f4: 8c632d8c lw r3,0x2d8c(r3) r3 = attacker action
 
0018b1f8: 34020001 ori r2,r0,0x0001 r2 = hit flag
 
0018b1fc: 08062c86 j 0x 0018b218
 
0018b200: a0620000 sb r2,0x0000(r3) save hit flag
 
 
 
 
 
0018b204: 3c038019 lui r3,0x8019
 
0018b208: 8c632d90 lw r3,0x2d90(r3) load target current action data
 
0018b20c: 2402ffff addiu r2,r0,0xffff r2 = 0xffff
 
0018b210: 08062c98 j 0x 0018b260 jumps to very end if reaction fails
 
0018b214: a0600025 sb r0,0x0025(r3) store no attack type
 
 
 
0018b218: 3c028019 lui r2,0x8019
 
0018b21c: 8c422d90 lw r2,0x2d90(r2) loads target current action data
 
0018b220: 0c062e91 jal 0x 0018ba44 set some data for current attack
 
0018b224: a0500025 sb r16,0x0025(r2) store target attack type
 
0018b228: 3c038019 lui r3,0x8019
 
0018b22c: 8c632d90 lw r3,0x2d90(r3) loads target current action data
 
0018b230: 00000000 nop
 
0018b234: 94620010 lhu r2,0x0010(r3) load special flags
 
0018b238: 00000000 nop
 
0018b23c: 10400005 beq r2,r0,0x 0018b254 branch if no flags set
 
0018b240: 00000000 nop
 
0018b244: 90620025 lbu r2,0x0025(r3) load attack type
 
0018b248: 00000000 nop
 
0018b24c: 34420001 ori r2,r2,0x0001 attack type also includes pseudo status change
 
0018b250: a0620025 sb r2,0x0025(r3) store pseudo status flags on target
 
0018b254: 3c018019 lui r1,0x8019
 
0018b258: a42038c6 sh r0,0x38c6(r1) clear reaction ID
 
0018b25c: 34020001 ori r2,r0,0x0001 r2 = 0x1
 
0018b260: 8fbf0014 lw r31,0x0014(r29)
 
0018b264: 8fb00010 lw r16,0x0010(r29)
 
0018b268: 27bd0018 addiu r29,r29,0x0018
 
0018b26c: 03e00008 jr r31
 
0018b270: 00000000 nop
 

Latest revision as of 19:45, 20 November 2021

Support some reaction abilities
returns r2 :
   = 0x01 if ability is supported (current action will be modified)
   = 0x00 if reaction flag as 0x01 is enabled but not 0x02
             rq : reflect is here, but reacting unit ID is stored in attacker data pointer before exiting the routine
   = -0x01 if ability ID is > 0x1be (damage split)
-------------------------------------------------------------------------------------------------------
0018af2c: 27bdffe8 addiu r29,r29,0xffe8     |
0018af30: afb00010 sw r16,0x0010(r29)       |
0018af34: 34100001 ori r16,r0,0x0001        |r16 = 0x01 (for current action attack type - pseudo status change by default)
0018af38: 3c048019 lui r4,0x8019            |
0018af3c: 84842d9c lh r4,0x2d9c(r4)         |r4 = Current action : reaction ID
0018af40: 340201b8 ori r2,r0,0x01b8         |r2 = 0x1b8 (Reflect ID)
0018af44: 1482000c bne r4,r2,0x0018af78     #If Current reaction reaction is reflect
0018af48: afbf0014 sw r31,0x0014(r29)            | 
0018af4c: 3c028019 lui r2,0x8019                 | 
0018af50: 8c42f8c8 lw r2,-0x0738(r2)             |r2 = Acting unit ID
0018af54: 00000000 nop                           |
0018af58: 000218c0 sll r3,r2,0x03                |unit ID * 0x8
0018af5c: 00621823 subu r3,r3,r2                 |unit ID * 0x7
0018af60: 00031980 sll r3,r3,0x06                |unit ID * 0x1c0
0018af64: 3c028019 lui r2,0x8019                 |
0018af68: 244208cc addiu r2,r2,0x08cc            |r2 = 0x801908cc (unit data start)
0018af6c: 00621821 addu r3,r3,r2                 |r3 = 0x801908cc + ID * 0x1c0 (Reacting unit data pointer)
0018af70: 3c018019 lui r1,0x8019                 |
0018af74: ac232d94 sw r3,0x2d94(r1)              |Store (re)acting unit data pointer in attacker data pointer
0018af78: 3c018006 lui r1,0x8006                 |
0018af7c: 00240821 addu r1,r1,r4            |r1 = 0x8006 + Reaction ID
0018af80: 9022ea2a lbu r2,-0x15d6(r1)       |r2 = Reaction flag of used reaction -->Reaction_Flags
0018af84: 34030001 ori r3,r0,0x0001         |r3 = 0x1
0018af88: 30420003 andi r2,r2,0x0003        |if reaction flags have 0x1, or 0x2 set, return either (or both) values / Else 0x00
0018af8c: 104300b4 beq r2,r3,0x0018b260     #if reaction don't have the flag 0x01 without 0x02 /Else branch to end
0018af90: 00001021 addu r2,r0,r0            |r2 = 0x00
0018af94: 0c062b7d jal 0x0018adf4                |-->Action_data_nulling reset most of target and attacker current action data
0018af98: 00000000 nop                           |
0018af9c: 3c028019 lui r2,0x8019                 |
0018afa0: 94422d9c lhu r2,0x2d9c(r2)             |r2 = current action reaction ID
0018afa4: 00000000 nop                           |
0018afa8: 2442fe5a addiu r2,r2,-0x01a6           |reaction ID - 0x01a6 (A Save = 0x00 , Hamedo = 0x1f)  (will be refered as reaction number)
0018afac: 00021400 sll r2,r2,0x10                |
0018afb0: 00021c03 sra r3,r2,0x10                |r3 = reaction number Clear a potential upper part of r2 ? (r2 unchanged)
0018afb4: 2c620019 sltiu r2,r3,0x0019            |r2 = 0x01 if reaction is between A-Save and damage split
0018afb8: 10400092 beq r2,r0,0x0018b204          #if reaction is between A-Save and damage split Else go to non supported reactions
0018afbc: 00031080 sll r2,r3,0x02                    |r2 = reactionID * 4
0018afc0: 3c018017 lui r1,0x8017                     |
0018afc4: 00220821 addu r1,r1,r2                     |r1 = 8017 + Reaction number
0018afc8: 8c22429c lw r2,0x429c(r1)                  |r2 = jump adress from table -->Reaction_abilities_return_adress_table
0018afcc: 00000000 nop                               |
0018afd0: 00400008 jr r2                             >>jump to case pointer
0018afd4: 00000000 nop                               |

                                            --- A-Save section ---
0018afd8: 3c038019 lui r3,0x8019                     | 
0018afdc: 8c632d90 lw r3,0x2d90(r3)                  |r3 = target current action data pointer
0018afe0: 34020081 ori r2,r0,0x0081                  |r2 = 0x81
0018afe4: 08062c86 j 0x0018b218                      >>jump to store attack type section
0018afe8: a0620014 sb r2,0x0014(r3)                  |store 0x81 in Target current action PA change (Bonus + 1 PA)

                                            --- MA-Save section ---
0018afec: 3c038019 lui r3,0x8019                     | 
0018aff0: 8c632d90 lw r3,0x2d90(r3)                  |r3 = target current action data pointer
0018aff4: 34020081 ori r2,r0,0x0081                  |r2 = 0x81
0018aff8: 08062c86 j 0x0018b218                      >>jump to store attack type section
0018affc: a0620015 sb r2,0x0015(r3)                  |store 0x81 in Target current action MA change (Bonus + 1 MA)

                                            --- Speed-Save section ---
0018b000: 3c038019 lui r3,0x8019                     | 
0018b004: 8c632d90 lw r3,0x2d90(r3)                  |r3 = target current action data pointer
0018b008: 34020081 ori r2,r0,0x0081                  |r2 = 0x81
0018b00c: 08062c86 j 0x0018b218                      >>jump to store attack type section
0018b010: a0620012 sb r2,0x0012(r3)                  |store 0x81 in Target current action speed change (Bonus + 1 speed)

                                            --- Sunken State---
0018b014: 00002021 addu r4,r0,r0                     |r4 = 0 (for status validation jal)
0018b018: 3c038019 lui r3,0x8019                     |
0018b01c: 8c632d90 lw r3,0x2d90(r3)                  |r3 = target current action data pointer
0018b020: 34020010 ori r2,r0,0x0010                  |r2 = 0x10 (sunken state flag)
0018b024: 08062c1c j 0x0018b070                      >>jump to end of regenerator section :  Status change validation
0018b028: a062001d sb r2,0x001d(r3)                  |Store transparent in target current action status infliction set 3

                                            ---  Caution ---
0018b02c: 00002021 addu r4,r0,r0                     |r4 = 0 (for status validation jal)
0018b030: 3c038019 lui r3,0x8019                     |
0018b034: 8c632d90 lw r3,0x2d90(r3)                  |r3 = target current action data pointer
0018b038: 34020002 ori r2,r0,0x0002                  |r2 = 02 (defending flag)
0018b03c: 08062c1c j 0x0018b070                      >>jump to end of regenerator section :  Status change validation
0018b040: a062001b sb r2,0x001b(r3)                  |Store defending in target current action status infliction set 1

                                            --- Dragon Spirit ---
0018b044: 00002021 addu r4,r0,r0                     |r4 = 0 (for status validation jal)
0018b048: 3c038019 lui r3,0x8019                     |
0018b04c: 8c632d90 lw r3,0x2d90(r3)                  |r3 = target current action data pointer
0018b050: 34020020 ori r2,r0,0x0020                  |r2 = 0x20 (reraise flag)
0018b054: 08062c1c j 0x0018b070                      >>jump to end of regenerator section :  Status change validation
0018b058: a062001d sb r2,0x001d(r3)                  |Store reraise in target current action status infliction set 3

                                            ---  Regenerator ---
0018b05c: 00002021 addu r4,r0,r0                     |r4 = 0 (for status validation jal)
0018b060: 3c038019 lui r3,0x8019                     |
0018b064: 8c632d90 lw r3,0x2d90(r3)                  |r3 = target current action data pointer
0018b068: 34020040 ori r2,r0,0x0040                  |r2 = 0x40 (regen flag)
0018b06c: a062001e sb r2,0x001e(r3)                  |Store regen in target current action status infliction set 4
0018b070: 0c0612c9 jal 0x00184b24                    |-->Modify_Status_Inflictions Multiples check - may result in no status infliction
0018b074: 00000000 nop                               |
0018b078: 10400067 beq r2,r0,0x0018b218              #If status infliction is ok /Else no status infliction : branch to to store attack type section
0018b07c: 00000000 nop                               |
0018b080: 08062c86 j 0x0018b218                          >>jump to store attack type section
0018b084: 34100008 ori r16,r0,0x0008                     |r16 = 0x08 (status change flag for current action attack type)

                                            --- Brave Up ---
0018b088: 3c038019 lui r3,0x8019                     | 
0018b08c: 8c632d90 lw r3,0x2d90(r3)                  |r3 = target current action data pointer
0018b090: 34020083 ori r2,r0,0x0083                  |r2 = 0x83
0018b094: 08062c86 j 0x0018b218                      >>jump to store attack type section
0018b098: a0620016 sb r2,0x0016(r3)                  |store 0x83 in Target current action brave change (Bonus + 3)

                                            ---  Faith Up ---
0018b09c: 3c038019 lui r3,0x8019                     | 
0018b0a0: 8c632d90 lw r3,0x2d90(r3)                  |r3 = target current action data pointer
0018b0a4: 34020083 ori r2,r0,0x0083                  |r2 = 0x83
0018b0a8: 08062c86 j 0x0018b218                      >>jump to store attack type section
0018b0ac: a0620017 sb r2,0x0017(r3)                  |store 0x83 in Target current action faith change (Bonus + 3)

                                            --- HP restore ---
0018b0b0: 3c038019 lui r3,0x8019                     | 
0018b0b4: 8c632d98 lw r3,0x2d98(r3)                  |r3 = target data pointer
0018b0b8: 34100040 ori r16,r0,0x0040                 |r16 = 0x40 (attack type will be HP recovery)
0018b0bc: 9462002a lhu r2,0x002a(r3)                 |r2 =  target Max HP
0018b0c0: 94630028 lhu r3,0x0028(r3)                 |r3 =  target HP
0018b0c4: 3c048019 lui r4,0x8019                     |
0018b0c8: 8c842d90 lw r4,0x2d90(r4)                  |r4 = target current action data pointer
0018b0cc: 00431023 subu r2,r2,r3                     |r2 = target missing HP
0018b0d0: 08062c86 j 0x0018b218                      >>jump to store attack type section
0018b0d4: a4820006 sh r2,0x0006(r4)                  |Store missing HP as Target current action HP recovery

                                            --- MP restore ---
0018b0d8: 3c038019 lui r3,0x8019                     | 
0018b0dc: 8c632d98 lw r3,0x2d98(r3)                  |r3 = target data pointer
0018b0e0: 34100010 ori r16,r0,0x0010                 |r16 = 0x10 (attack type will be MP recovery)
0018b0e4: 9462002e lhu r2,0x002e(r3)                 |r2 =  target Max MP
0018b0e8: 9463002c lhu r3,0x002c(r3)                 |r3 =  target current MP
0018b0ec: 3c048019 lui r4,0x8019                     |
0018b0f0: 8c842d90 lw r4,0x2d90(r4)                  |r4 = target current action data pointer
0018b0f4: 00431023 subu r2,r2,r3                     |r2 = target missing MP
0018b0f8: 08062c86 j 0x0018b218                      >>jump to store attack type section
0018b0fc: a482000a sh r2,0x000a(r4)                  |Store missing MP as Target current action MP recovery

                                            --- Critical quick  ---
0018b100: 3c038019 lui r3,0x8019                     | 
0018b104: 8c632d90 lw r3,0x2d90(r3)                  |r3 = target current action data pointer
0018b108: 340200ff ori r2,r0,0x00ff                  |r2 = 0xff (will be CT100)
0018b10c: 08062c86 j 0x0018b218                      >>jump to store attack type section
0018b110: a0620013 sb r2,0x0013(r3)                  |store Target current action CT change  =  CT100

                                            --- Meatbone slash  ---
0018b114: 3c028019 lui r2,0x8019                     | 
0018b118: 8c422d94 lw r2,0x2d94(r2)                  |r2 = Attacker data pointer
0018b11c: 3c038019 lui r3,0x8019                     |
0018b120: 8c632d90 lw r3,0x2d90(r3)                  |r3 = Target current action data pointer
0018b124: 9442002a lhu r2,0x002a(r2)                 |r2 = Attacker max HP
0018b128: 34100080 ori r16,r0,0x0080                 |r16 = 0x80 (attack type will be HP damage)
0018b12c: 08062c86 j 0x0018b218                      >>jump to store attack type section
0018b130: a4620004 sh r2,0x0004(r3)                  |Store attacker max HP as Target current action HP damage

                                            --- Absorb used MP  ---
0018b134: 3c028019 lui r2,0x8019                     | 
0018b138: 8c422d90 lw r2,0x2d90(r2)                  |r2 = Target current action data pointer
0018b13c: 00000000 nop                               |
0018b140: 94430026 lhu r3,0x0026(r2)                 |r3 = Target last attack received
0018b144: 34100010 ori r16,r0,0x0010                 |r16 = 0x10 (attack type will be MP recovery)
0018b148: 08062c86 j 0x0018b218                      >>jump to store attack type section
0018b14c: a443000a sh r3,0x000a(r2)                  |store last attack received as target current action MP recovery ? (is this value transformed by another routine?)

                                            ---  Gilgame heart  ---
0018b150: 3c038019 lui r3,0x8019                     | 
0018b154: 8c632d90 lw r3,0x2d90(r3)                  |r3 = Target current action data pointer
0018b158: 00000000 nop                               |
0018b15c: 94620026 lhu r2,0x0026(r3)                 |r2 = Target last attack received
0018b160: 08062c86 j 0x0018b218                      >>jump to store attack type section
0018b164: a462000c sh r2,0x000c(r3)                  |store last attack received as  target current action  gil stolen/lost ? (is this value transformed by another routine?)

                                            ---  Distribute ---
0018b168: 3c038019 lui r3,0x8019                     | 
0018b16c: 8c633878 lw r3,0x3878(r3)                  |r3 = Targets hit counter
0018b170: 00000000 nop                               |
0018b174: 1060000c beq r3,r0,0x0018b1a8              #If number of targets hit <> 0x00
0018b178: 00000000 nop                                   | 
0018b17c: 3c028019 lui r2,0x8019                         | 
0018b180: 8c422d94 lw r2,0x2d94(r2)                      |r2 = Attacker data pointer
0018b184: 00000000 nop                                   |
0018b188: 944201b2 lhu r2,0x01b2(r2)                     |r2 = attacker last attack received
0018b18c: 00000000 nop                                   |
0018b190: 00431021 addu r2,r2,r3                         |r2 = last attack received + targets hit counter
0018b194: 2442ffff addiu r2,r2,-0x0001                   |r2 = last attack received + targets hit counter -1 (it's a way to round up the fraction of heal ?)
0018b198: 0043001a div r2,r3                             |r2 / number of targets
0018b19c: 00001812 mflo r3                               |r3 =(last attack received + targets hit counter -1)/targets hit counter
0018b1a0: 08062c6b j 0x0018b1ac                          >>jump keeping r3 value
0018b1a4: 00000000 nop                                   |
0018b1a8: 00001821 addu r3,r0,r0                     #E r3 = 0x00
0018b1ac: 3c028019 lui r2,0x8019                     |
0018b1b0: 8c422d90 lw r2,0x2d90(r2)                  |r2 = Target current action data pointer
0018b1b4: 34100040 ori r16,r0,0x0040                 |r16 = 0x40 (attack type will be HP recovery)
0018b1b8: 08062c86 j 0x0018b218                      >>jump to store attack type section
0018b1bc: a4430006 sh r3,0x0006(r2)                  |store r3 as target current action hp recovery

                                            ---  Damage Split ---
0018b1c0: 3c028019 lui r2,0x8019                     | 
0018b1c4: 8c422d94 lw r2,0x2d94(r2)                  |r2 = Attacker data pointer
0018b1c8: 3c048019 lui r4,0x8019                     |
0018b1cc: 8c842d90 lw r4,0x2d90(r4)                  |r4 = Target current action data pointer
0018b1d0: 3c038019 lui r3,0x8019                     |
0018b1d4: 8c632d8c lw r3,0x2d8c(r3)                  |r3 = Attacker current action data pointer
0018b1d8: 944201b2 lhu r2,0x01b2(r2)                 |r2 = attacker last attack received
0018b1dc: 34100080 ori r16,r0,0x0080                 |r16 = 0x80 (attack type will be HP damage)
0018b1e0: a4820004 sh r2,0x0004(r4)                  |store last attack received as target current action HP damage
0018b1e4: a4620006 sh r2,0x0006(r3)                  |store last attack received as attacker current action HP recovery
0018b1e8: 34020040 ori r2,r0,0x0040                  |r2 = 0x40
0018b1ec: a0620025 sb r2,0x0025(r3)                  |Store Attacker current action attack type as HP recovery
0018b1f0: 3c038019 lui r3,0x8019                     |
0018b1f4: 8c632d8c lw r3,0x2d8c(r3)                  |r3 = Attacker current action data pointer
0018b1f8: 34020001 ori r2,r0,0x0001                  |r2 = 0x01
0018b1fc: 08062c86 j 0x0018b218                      >>jump to store attack type section
0018b200: a0620000 sb r2,0x0000(r3)                  |Store Attacker current action hit flag as hit

                                            -- Post Damage split reaction abilities--
0018b204: 3c038019 lui r3,0x8019                 | 
0018b208: 8c632d90 lw r3,0x2d90(r3)              |r3 = Target current action data pointer
0018b20c: 2402ffff addiu r2,r0,-0x0001           |r2 = -0x0001
0018b210: 08062c98 j 0x0018b260                  >>jumps to end  
0018b214: a0600025 sb r0,0x0025(r3)              |Store target current action hit flag as miss (Talcall here, This jump is for reactions that trigger a counter-ability, like counter Magic, or Counter attack.)
 
                                            -- Store attack type section --
0018b218: 3c028019 lui r2,0x8019                 | 
0018b21c: 8c422d90 lw r2,0x2d90(r2)              |r2 = target current action data pointer
0018b220: 0c062e91 jal 0x0018ba44                |-->Set_some_data_for_current_attack  Check target status (targetable ?), cap HP and MP to 999, deals with killing blows and golem
0018b224: a0500025 sb r16,0x0025(r2)             |store target current action attack type (depend of sections above)
0018b228: 3c038019 lui r3,0x8019                 |
0018b22c: 8c632d90 lw r3,0x2d90(r3)              |r3 = target current action data pointer
0018b230: 00000000 nop                           |
0018b234: 94620010 lhu r2,0x0010(r3)             |r2 = Target current action specials flags
0018b238: 00000000 nop                           |
0018b23c: 10400005 beq r2,r0,0x0018b254          #If there is a special flag enabled /Else branch to almost end
0018b240: 00000000 nop                               | 
0018b244: 90620025 lbu r2,0x0025(r3)                 |r2 = Target current action attack type
0018b248: 00000000 nop                               | 
0018b24c: 34420001 ori r2,r2,0x0001                  |Update r2 with 0x01 enabled
0018b250: a0620025 sb r2,0x0025(r3)                  |store updated attack type with pseudo status flags enabled
0018b254: 3c018019 lui r1,0x8019                     |
0018b258: a42038c6 sh r0,0x38c6(r1)              |Clear current ability reaction ID
0018b25c: 34020001 ori r2,r0,0x0001              |r2 = 0x1
0018b260: 8fbf0014 lw r31,0x0014(r29)            |(landing site of jump for abilities not supported b this routine)
0018b264: 8fb00010 lw r16,0x0010(r29)            |
0018b268: 27bd0018 addiu r29,r29,0x0018          
0018b26c: 03e00008 jr r31                        
0018b270: 00000000 nop                          

Return locations

0018b404: Pre_Formula_Setup_(FDC)