Perform reaction abilities

From Final Fantasy Hacktics Wiki
Revision as of 21:01, 7 June 2021 by Orkney (talk | contribs) (return link)
Jump to navigation Jump to search
0018af2c: 27bdffe8 addiu r29,r29,0xffe8
0018af30: afb00010 sw r16,0x0010(r29)
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

Return locations

0018b404: Pre_Formula_Setup_(FDC)