Attack Finalisation & Reaction Flagging

From Final Fantasy Hacktics Wiki
Revision as of 14:58, 20 November 2022 by Orkney (talk | contribs)
Jump to navigation Jump to search
Finalise attacking, set final hp/mp/stats/status change, check for golem, statuses caused by changing unit stats, if valid for exp/jp earning, flag valid target reactions
0018be08: 27bdffc8 addiu r29,r29,0xffc8
0018be0c: afb20030 sw r18,0x0030(r29)
0018be10: 00809021 addu r18,r4,r0              r18 = target ID
0018be14: afb00028 sw r16,0x0028(r29)
0018be18: 00008021 addu r16,r0,r0
0018be1c: 2a420015 slti r2,r18,0x0015
0018be20: afbf0034 sw r31,0x0034(r29)
0018be24: 10400013 beq r2,r0,0x0018be74        branch if invalid ID
0018be28: afb1002c sw r17,0x002c(r29)
0018be2c: 001218c0 sll r3,r18,0x03
0018be30: 00721823 subu r3,r3,r18
0018be34: 00031980 sll r3,r3,0x06
0018be38: 3c028019 lui r2,0x8019
0018be3c: 244208cc addiu r2,r2,0x08cc		Target Unit Data
0018be40: 00622021 addu r4,r3,r2		
0018be44: 2442018c addiu r2,r2,0x018c		
0018be48: 00622821 addu r5,r3,r2		
0018be4c: 3c018019 lui r1,0x8019		
0018be50: a03238c1 sb r18,0x38c1(r1)		store target unit ID
0018be54: 3c018019 lui r1,0x8019		
0018be58: ac242d98 sw r4,0x2d98(r1)		store target data pointer
0018be5c: 3c018019 lui r1,0x8019		
0018be60: ac252d90 sw r5,0x2d90(r1)		store target action pointer
0018be64: 90830001 lbu r3,0x0001(r4)		
0018be68: 340200ff ori r2,r0,0x00ff		
0018be6c: 14620003 bne r3,r2,0x0018be7c        branch if target exists
0018be70: 00000000 nop				
0018be74: 08063199 j 0x0018c664			
0018be78: 2402ffff addiu r2,r0,0xffff	 	

0018be7c: 90820058 lbu r2,0x0058(r4)		Load First Set of Current Status	
0018be80: 00000000 nop				
0018be84: 30420020 andi r2,r2,0x0020		
0018be88: 1040000f beq r2,r0,0x0018bec8	     Branch if unit is not dead?
0018be8c: 00000000 nop				
0018be90: 90a2001b lbu r2,0x001b(r5)		status infliction 1
0018be94: 00000000 nop
0018be98: 30420040 andi r2,r2,0x0040		
0018be9c: 14400006 bne r2,r0,0x0018beb8	     branch if crystal inflicted
0018bea0: 02402021 addu r4,r18,r0
0018bea4: 90a2001c lbu r2,0x001c(r5)		status infliction 2
0018bea8: 00000000 nop
0018beac: 30420001 andi r2,r2,0x0001
0018beb0: 10400005 beq r2,r0,0x0018bec8	     branch if treasure inflicted
0018beb4: 00000000 nop
0018beb8: 0c06381f jal 0x0018e07c		Post Ability Hardcoding?
0018bebc: 00002821 addu r5,r0,r0
0018bec0: 08063199 j 0x0018c664		jump to end
0018bec4: 00001021 addu r2,r0,r0

0018bec8: 3c028019 lui r2,0x8019
0018becc: 8c42f5f0 lw r2,-0x0a10(r2)
0018bed0: 00000000 nop
0018bed4: 14400005 bne r2,r0,0x0018beec        Branch if reacting
0018bed8: 34020001 ori r2,r0,0x0001
0018bedc: 3c038019 lui r3,0x8019
0018bee0: 8c632d98 lw r3,0x2d98(r3)		Load Defender's Data
0018bee4: 00000000 nop				
0018bee8: a0620189 sb r2,0x0189(r3)		store defender hit by ability?

0018beec: 0c0632c0 jal 0x0018cb00		Sunken State, Caution, Dragon Spirit, etc. usability
0018bef0: 00000000 nop				
0018bef4: 3c058019 lui r5,0x8019		
0018bef8: 8ca52d90 lw r5,0x2d90(r5)		Load Defender's Current Action Data
0018befc: 00000000 nop				
0018bf00: 84a3000e lh r3,0x000e(r5)		Load Reaction ID
0018bf04: 340201c2 ori r2,r0,0x01c2		
0018bf08: 14620006 bne r3,r2,0x0018bf24		Branch if Reaction ID isn't Catch
0018bf0c: 00000000 nop				

0018bf10: 3c048019 lui r4,0x8019		
0018bf14: 8c842d98 lw r4,0x2d98(r4)		Load Target Data
0018bf18: 90a50026 lbu r5,0x0026(r5)		Load Last Attack?
0018bf1c: 0c063a7a jal 0x0018e9e8		Store Caught Item in Inventory
0018bf20: 00000000 nop				

0018bf24: 3c048019 lui r4,0x8019		
0018bf28: 8c842d90 lw r4,0x2d90(r4)		Load Defender's Current Action Data
0018bf2c: 00000000 nop				
0018bf30: 90820000 lbu r2,0x0000(r4)		Load Hit Flag
0018bf34: 00000000 nop				
0018bf38: 104001ca beq r2,r0,0x0018c664		Branch if Attack Missed
0018bf3c: 00001021 addu r2,r0,r0		

0018bf40: 94830010 lhu r3,0x0010(r4)		load special flags
0018bf44: 00000000 nop				
0018bf48: 30628000 andi r2,r3,0x8000		Reducing golem amount?
0018bf4c: 10400013 beq r2,r0,0x0018bf9c		branch if not reducing golem HP
0018bf50: 30620001 andi r2,r3,0x0001		Summoning golem flag
0018bf54: 3c028019 lui r2,0x8019		
0018bf58: 8c422d98 lw r2,0x2d98(r2)		Load Defender's Data
0018bf5c: 00000000 nop				
0018bf60: 904201ba lbu r2,0x01ba(r2)		modified ENTD flags
0018bf64: 3c038019 lui r3,0x8019		
0018bf68: 2463f5f4 addiu r3,r3,0xf5f4		
0018bf6c: 30420030 andi r2,r2,0x0030		enemy team check
0018bf70: 000210c2 srl r2,r2,0x03		
0018bf74: 00432821 addu r5,r2,r3		
0018bf78: 94a30000 lhu r3,0x0000(r5)		Load Golem HP
0018bf7c: 84820004 lh r2,0x0004(r4)		Load HP Damage
0018bf80: 00000000 nop				
0018bf84: 00628823 subu r17,r3,r2		New Golem HP = Golem HP - HP damage
0018bf88: 06210002 bgez r17,0x0018bf94		if golem HP < 0, set to 0
0018bf8c: 00001021 addu r2,r0,r0		
0018bf90: 00008821 addu r17,r0,r0		Golem HP = 0
0018bf94: 08063199 j 0x0018c664			jump to end
0018bf98: a4b10000 sh r17,0x0000(r5)		store new Golem HP

0018bf9c: 1040000b beq r2,r0,0x0018bfcc		Branch if attack does not add Golem
0018bfa0: 00000000 nop				
0018bfa4: 3c028019 lui r2,0x8019		
0018bfa8: 8c422d98 lw r2,0x2d98(r2)		Load Defender's Data
0018bfac: 34100001 ori r16,r0,0x0001		
0018bfb0: 90430005 lbu r3,0x0005(r2)		Load Defender's Team
0018bfb4: 9442002a lhu r2,0x002a(r2)		Load Defender's Max HP
0018bfb8: 30630030 andi r3,r3,0x0030		enemy team check
0018bfbc: 000318c2 srl r3,r3,0x03
0018bfc0: 3c018019 lui r1,0x8019
0018bfc4: 00230821 addu r1,r1,r3
0018bfc8: a422f5f4 sh r2,-0x0a0c(r1)           Store Team's Golem Amount

0018bfcc: 0c06330d jal 0x0018cc34		MP Switch, Distribute, and Damage Split usability
0018bfd0: 00000000 nop				
0018bfd4: 3c058019 lui r5,0x8019		
0018bfd8: 8ca52d98 lw r5,0x2d98(r5)		Load Defender's Data
0018bfdc: 3c048019 lui r4,0x8019		
0018bfe0: 8c842d90 lw r4,0x2d90(r4)		Load Defender's Current Action Data
0018bfe4: 94a70028 lhu r7,0x0028(r5)		Load Defender's Current HP
0018bfe8: 84820004 lh r2,0x0004(r4)		Load HP Damage
0018bfec: 84830006 lh r3,0x0006(r4)		Load HP Recovery
0018bff0: 00e21023 subu r2,r7,r2		Defender's Current HP - HP Damage
0018bff4: 00438821 addu r17,r2,r3		Defender's Current HP - HP Damage +  HP Recovery
0018bff8: 06210002 bgez r17,0x0018c004		Branch if >= 0 
0018bffc: 00000000 nop				
0018c000: 00008821 addu r17,r0,r0		else unit ko'd
0018c004: 94a3002a lhu r3,0x002a(r5)		Load Defender's Max HP
0018c008: 00000000 nop				
0018c00c: 0071102a slt r2,r3,r17		If Defender's Max HP < above, r2 = 1;else is 0
0018c010: 10400002 beq r2,r0,0x0018c01c		branch if defenders max < hp recovery (cap check)
0018c014: 00000000 nop				
0018c018: 00608821 addu r17,r3,r0		r17 = max hp
0018c01c: 94a6002c lhu r6,0x002c(r5)		Load Defender's Current MP
0018c020: 84820008 lh r2,0x0008(r4)		Load MP Damage
0018c024: 8483000a lh r3,0x000a(r4)		Load MP Recovery
0018c028: 00c21023 subu r2,r6,r2		Defender's Current MP - MP Damage
0018c02c: 00431821 addu r3,r2,r3		Defender's Current MP - MP Damage + MP Recovery
0018c030: 04610002 bgez r3,0x0018c03c		Branch if >= 0
0018c034: 00000000 nop				
0018c038: 00001821 addu r3,r0,r0		
0018c03c: 94a4002e lhu r4,0x002e(r5)		Load Defender's Max MP
0018c040: 00000000 nop				
0018c044: 0083102a slt r2,r4,r3			If target max MP < above, r2 = 1; else is 0
0018c048: 10400002 beq r2,r0,0x0018c054		branch if max mp < mp recovery  (cap?)
0018c04c: 00000000 nop				
0018c050: 00801821 addu r3,r4,r0		r3 = max mp
0018c054: 14f10003 bne r7,r17,0x0018c064	branch if current HP != max hp or 0?	
0018c058: 00000000 nop
0018c05c: 10c30003 beq r6,r3,0x0018c06c	branch if current mp != max mp or 0?
0018c060: 34060032 ori r6,r0,0x0032		r6 = 0x32
0018c064: 34100001 ori r16,r0,0x0001		r16 = 1
0018c068: 34060032 ori r6,r0,0x0032		
0018c06c: 3c058019 lui r5,0x8019
0018c070: 8ca52d98 lw r5,0x2d98(r5)		target data
0018c074: 3c028019 lui r2,0x8019
0018c078: 8c422d90 lw r2,0x2d90(r2)		target action
0018c07c: 34070001 ori r7,r0,0x0001		r7 = 01
0018c080: a4b10028 sh r17,0x0028(r5)		Store current HP
0018c084: a4a3002c sh r3,0x002c(r5)		store current MP
0018c088: 90440012 lbu r4,0x0012(r2)		load speed change?		
0018c08c: 0c06355c jal 0x0018d570		stat change ?
0018c090: 24a50032 addiu r5,r5,0x0032		target data + 0x32 (stat change  prep?)
0018c094: 02028025 or r16,r16,r2		target action OR 0x01
0018c098: 340600ff ori r6,r0,0x00ff
0018c09c: 00003821 addu r7,r0,r0
0018c0a0: 3c028019 lui r2,0x8019
0018c0a4: 8c422d90 lw r2,0x2d90(r2)		target action
0018c0a8: 3c058019 lui r5,0x8019
0018c0ac: 8ca52d98 lw r5,0x2d98(r5)		target data
0018c0b0: 90440013 lbu r4,0x0013(r2)		load CT change
0018c0b4: 0c06355c jal 0x0018d570		Stat Increment/Decrement
0018c0b8: 24a50039 addiu r5,r5,0x0039		(stat change prep)
0018c0bc: 02028025 or r16,r16,r2		
0018c0c0: 34060063 ori r6,r0,0x0063		
0018c0c4: 34070001 ori r7,r0,0x0001
0018c0c8: 3c028019 lui r2,0x8019
0018c0cc: 8c422d90 lw r2,0x2d90(r2)		target action
0018c0d0: 3c058019 lui r5,0x8019
0018c0d4: 8ca52d98 lw r5,0x2d98(r5)		target data
0018c0d8: 90440014 lbu r4,0x0014(r2)		load PA change
0018c0dc: 0c06355c jal 0x0018d570              Stat Increment/Decrement
0018c0e0: 24a50030 addiu r5,r5,0x0030
0018c0e4: 02028025 or r16,r16,r2
0018c0e8: 34060063 ori r6,r0,0x0063
0018c0ec: 34070001 ori r7,r0,0x0001
0018c0f0: 3c028019 lui r2,0x8019
0018c0f4: 8c422d90 lw r2,0x2d90(r2)		target action
0018c0f8: 3c058019 lui r5,0x8019
0018c0fc: 8ca52d98 lw r5,0x2d98(r5)		target data
0018c100: 90440015 lbu r4,0x0015(r2)		load MA change
0018c104: 0c06355c jal 0x0018d570              Stat Increment/Decrement
0018c108: 24a50031 addiu r5,r5,0x0031
0018c10c: 02028025 or r16,r16,r2
0018c110: 34060064 ori r6,r0,0x0064
0018c114: 3c038019 lui r3,0x8019
0018c118: 8c632d98 lw r3,0x2d98(r3)		target data
0018c11c: 3c028019 lui r2,0x8019
0018c120: 8c422d90 lw r2,0x2d90(r2)		target action
0018c124: 24650024 addiu r5,r3,0x0024		
0018c128: 90670182 lbu r7,0x0182(r3)		load mount info
0018c12c: 90440016 lbu r4,0x0016(r2)		load brave change
0018c130: 000739c2 srl r7,r7,0x07
0018c134: 00073823 subu r7,r0,r7
0018c138: 0c06355c jal 0x0018d570	       Stat Increment/Decrement
0018c13c: 30e7000a andi r7,r7,0x000a
0018c140: 02028025 or r16,r16,r2
0018c144: 34060064 ori r6,r0,0x0064
0018c148: 00003821 addu r7,r0,r0
0018c14c: 3c028019 lui r2,0x8019
0018c150: 8c422d90 lw r2,0x2d90(r2)		target action
0018c154: 3c058019 lui r5,0x8019
0018c158: 8ca52d98 lw r5,0x2d98(r5)		target data
0018c15c: 90440017 lbu r4,0x0017(r2)		load faith change
0018c160: 0c06355c jal 0x0018d570             Stat Increment/Decrement
0018c164: 24a50026 addiu r5,r5,0x0026

0018c168: 0c0634f0 jal 0x0018d3c0		Steal Routine
0018c16c: 02028025 or r16,r16,r2
0018c170: 3c038019 lui r3,0x8019
0018c174: 8c632d90 lw r3,0x2d90(r3)		target action
0018c178: 00000000 nop
0018c17c: 94630010 lhu r3,0x0010(r3)		load special flags
0018c180: 00000000 nop
0018c184: 30630008 andi r3,r3,0x0008		Stealing enemies item check?
0018c188: 10600007 beq r3,r0,0x0018c1a8		
0018c18c: 02028025 or r16,r16,r2
0018c190: 3c048019 lui r4,0x8019
0018c194: 8c842d98 lw r4,0x2d98(r4)		target data
0018c198: 00000000 nop
0018c19c: 90850176 lbu r5,0x0176(r4)		load used item/equip ID
0018c1a0: 0c063a7a jal 0x0018e9e8		Item quantity increment for steal/break?
0018c1a4: 00000000 nop

0018c1a8: 3c038019 lui r3,0x8019
0018c1ac: 8c632d90 lw r3,0x2d90(r3)		target action
0018c1b0: 00000000 nop
0018c1b4: 8462000c lh r2,0x000c(r3)		load gil lost/stolen		
0018c1b8: 00000000 nop
0018c1bc: 14400005 bne r2,r0,0x0018c1d4		skip if not 0
0018c1c0: 00000000 nop
0018c1c4: 90620028 lbu r2,0x0028(r3)		load stolen exp
0018c1c8: 00000000 nop
0018c1cc: 10400002 beq r2,r0,0x0018c1d8		skip if 0
0018c1d0: 00000000 nop
0018c1d4: 36100001 ori r16,r16,0x0001		sets 1 if exp/gil stolen
0018c1d8: 3c028019 lui r2,0x8019
0018c1dc: 8c422d90 lw r2,0x2d90(r2)		target action pointer
0018c1e0: 3c048019 lui r4,0x8019
0018c1e4: 8c842d98 lw r4,0x2d98(r4)		target data pointer
0018c1e8: 8445000c lh r5,0x000c(r2)
0018c1ec: 0c063aa6 jal 0x0018ea98		Add price of item / 4 to total gil
0018c1f0: 00003021 addu r6,r0,r0
0018c1f4: 3c028019 lui r2,0x8019
0018c1f8: 8c422d90 lw r2,0x2d90(r2)		target action pointer
0018c1fc: 3c048019 lui r4,0x8019
0018c200: 8c842d98 lw r4,0x2d98(r4)		target data pointer
0018c204: 90450028 lbu r5,0x0028(r2)		
0018c208: 0c063ad4 jal 0x0018eb50		Apply Exp gain / Level up
0018c20c: 00000000 nop
0018c210: 3c028019 lui r2,0x8019
0018c214: 8c422d90 lw r2,0x2d90(r2)		target action pointer
0018c218: 00000000 nop
0018c21c: 90420029 lbu r2,0x0029(r2)		stolen jp? unknown data
0018c220: 00000000 nop
0018c224: 10400005 beq r2,r0,0x0018c23c	branch if 0
0018c228: 00000000 nop
0018c22c: 3c048019 lui r4,0x8019
0018c230: 8c842d98 lw r4,0x2d98(r4)		target data
0018c234: 0c0637fe jal 0x0018dff8		Main Reaction subroutine - ENTD/ID stuff
0018c238: 00000000 nop
0018c23c: 0c063217 jal 0x0018c85c              Level up/down ability
0018c240: 00000000 nop
0018c244: 0c0631a0 jal 0x0018c680		Poach Inventory Routine
0018c248: 02028025 or r16,r16,r2
0018c24c: 3c038019 lui r3,0x8019
0018c250: 8c632d90 lw r3,0x2d90(r3)
0018c254: 00000000 nop
0018c258: 94630010 lhu r3,0x0010(r3)		load special flags (marlboro)
0018c25c: 00000000 nop
0018c260: 30630002 andi r3,r3,0x0002		murbol morph check
0018c264: 1060000a beq r3,r0,0x0018c290	branch if not morbolized
0018c268: 02028025 or r16,r16,r2
0018c26c: 3c028019 lui r2,0x8019
0018c270: 8c42f5fc lw r2,-0x0a04(r2)		targeting/attacking check	
0018c274: 00000000 nop
0018c278: 14400005 bne r2,r0,0x0018c290	skip if targeting unit?
0018c27c: 36100001 ori r16,r16,0x0001		
0018c280: 3c048019 lui r4,0x8019
0018c284: 8c842d98 lw r4,0x2d98(r4)		target data
0018c288: 0c0603d0 jal 0x00180f40		00180f40 - 00180fe0 special status flag enabling?
0018c28c: 00000000 nop

<If HP = 0> (Fatal Damage)

0018c290: 16200028 bne r17,r0,0x0018c334	branch if Target curHP =/= 0
0018c294: 00000000 nop
0018c298: 3c028019 lui r2,0x8019
0018c29c: 8c422d98 lw r2,0x2d98(r2)		target data
0018c2a0: 00000000 nop
0018c2a4: 94420058 lhu r2,0x0058(r2)		current status 1 and 2
0018c2a8: 00000000 nop
0018c2ac: 30420160 andi r2,r2,0x0160		
0018c2b0: 14400020 bne r2,r0,0x0018c334	Branch if target is already Dead/Crystal/Treasure
0018c2b4: 00000000 nop
0018c2b8: 3c048019 lui r4,0x8019
0018c2bc: 8c842d90 lw r4,0x2d90(r4)		target action
0018c2c0: 0c062f75 jal 0x0018bdd4		Null Some Status Data
0018c2c4: 00000000 nop
0018c2c8: 02402021 addu r4,r18,r0
0018c2cc: 34050001 ori r5,r0,0x0001
0018c2d0: 3c028019 lui r2,0x8019
0018c2d4: 8c422d90 lw r2,0x2d90(r2)		target action
0018c2d8: 34030020 ori r3,r0,0x0020
0018c2dc: 0c06381f jal 0x0018e07c		Post Ability Hardcoding?
0018c2e0: a043001b sb r3,0x001b(r2)		Inflict Dead on target
0018c2e4: 3c028019 lui r2,0x8019
0018c2e8: 8c42f5fc lw r2,-0x0a04(r2)		display data
0018c2ec: 00000000 nop
0018c2f0: 14400008 bne r2,r0,0x0018c314        Branch if targeting
0018c2f4: 00000000 nop
0018c2f8: 3c038019 lui r3,0x8019
0018c2fc: 8c632d98 lw r3,0x2d98(r3)		target data
0018c300: 00000000 nop
0018c304: 9062015c lbu r2,0x015c(r3)		load killed unit flag
0018c308: 00000000 nop
0018c30c: 24420001 addiu r2,r2,0x0001		
0018c310: a062015c sb r2,0x015c(r3)		store killed unit
0018c314: 0c063588 jal 0x0018d620		Attacker's Earned Experience
0018c318: 34040002 ori r4,r0,0x0002
0018c31c: 3c028019 lui r2,0x8019
0018c320: 8c422d98 lw r2,0x2d98(r2)		target data
0018c324: 00000000 nop
0018c328: 90420182 lbu r2,0x0182(r2)		mount flags
0018c32c: 08063198 j 0x0018c660			end
0018c330: 000211c2 srl r2,r2,0x07

0018c334: 3c028019 lui r2,0x8019
0018c338: 8c422d98 lw r2,0x2d98(r2)		target data
0018c33c: 3c03cccc lui r3,0xcccc
0018c340: 9442002a lhu r2,0x002a(r2)		load max HP		
0018c344: 3463cccd ori r3,r3,0xcccd
0018c348: 00430019 multu r2,r3
0018c34c: 00001010 mfhi r2
0018c350: 00021082 srl r2,r2,0x02
0018c354: 3042ffff andi r2,r2,0xffff		checking if max hp = fraction of max hp 
(critical)
0018c358: 0051102a slt r2,r2,r17
0018c35c: 14400009 bne r2,r0,0x0018c384		branch if not critical?
0018c360: 00000000 nop
0018c364: 3c038019 lui r3,0x8019
0018c368: 8c632d90 lw r3,0x2d90(r3)		target action pointer
0018c36c: 00000000 nop
0018c370: 9062001d lbu r2,0x001d(r3)		status infliction 3
0018c374: 00000000 nop
0018c378: 34420001 ori r2,r2,0x0001		critical
0018c37c: 080630e8 j 0x0018c3a0			skip next rountine
0018c380: a062001d sb r2,0x001d(r3)		store set critical status

0018c384: 3c038019 lui r3,0x8019
0018c388: 8c632d90 lw r3,0x2d90(r3)		target action
0018c38c: 00000000 nop
0018c390: 90620022 lbu r2,0x0022(r3)		load status removal 3
0018c394: 00000000 nop
0018c398: 34420001 ori r2,r2,0x0001
0018c39c: a0620022 sb r2,0x0022(r3)		store remove critical status
0018c3a0: 3c028019 lui r2,0x8019
0018c3a4: 8c422d98 lw r2,0x2d98(r2)		target data
0018c3a8: 00000000 nop
0018c3ac: 90420024 lbu r2,0x0024(r2)		load brave
0018c3b0: 00000000 nop
0018c3b4: 2c42000a sltiu r2,r2,0x000a		set if less than 10
0018c3b8: 10400009 beq r2,r0,0x0018c3e0		branch if not less than 10 brave
0018c3bc: 00000000 nop
0018c3c0: 3c038019 lui r3,0x8019
0018c3c4: 8c632d90 lw r3,0x2d90(r3)
0018c3c8: 00000000 nop
0018c3cc: 9062001d lbu r2,0x001d(r3)		load status infliction
0018c3d0: 00000000 nop
0018c3d4: 34420004 ori r2,r2,0x0004            add chicken status
0018c3d8: 080630ff j 0x0018c3fc			skip brave increment
0018c3dc: a062001d sb r2,0x001d(r3)		store chicken status

0018c3e0: 3c038019 lui r3,0x8019
0018c3e4: 8c632d90 lw r3,0x2d90(r3)		target action
0018c3e8: 00000000 nop
0018c3ec: 90620022 lbu r2,0x0022(r3)		load status removal
0018c3f0: 00000000 nop
0018c3f4: 34420004 ori r2,r2,0x0004
0018c3f8: a0620022 sb r2,0x0022(r3)		store remove chicken status

0018c3fc: 3c038019 lui r3,0x8019
0018c400: 8c632d90 lw r3,0x2d90(r3)
0018c404: 00000000 nop
0018c408: 90620025 lbu r2,0x0025(r3)		load attack type
0018c40c: 00000000 nop
0018c410: 30420080 andi r2,r2,0x0080		HP damage check
0018c414: 10400013 beq r2,r0,0x0018c464		branch if not HP damage
0018c418: 00000000 nop
0018c41c: 90620024 lbu r2,0x0024(r3)		load status removal 5
0018c420: 00000000 nop
0018c424: 34420030 ori r2,r2,0x0030		store charm/sleep
0018c428: a0620024 sb r2,0x0024(r3)		remove ^	
	
0018c42c: 3c038019 lui r3,0x8019
0018c430: 8c632d90 lw r3,0x2d90(r3)		target action
0018c434: 00000000 nop
0018c438: 90620022 lbu r2,0x0022(r3)		status removal 3
0018c43c: 00000000 nop
0018c440: 34420010 ori r2,r2,0x0010		
0018c444: a0620022 sb r2,0x0022(r3)		store remove transparent

0018c448: 3c038019 lui r3,0x8019
0018c44c: 8c632d90 lw r3,0x2d90(r3)		target current action
0018c450: 00000000 nop
0018c454: 90620021 lbu r2,0x0021(r3)		status removal 2
0018c458: 00000000 nop
0018c45c: 34420010 ori r2,r2,0x0010
0018c460: a0620021 sb r2,0x0021(r3)		store remove confusion

0018c464: 3c028019 lui r2,0x8019
0018c468: 8c422d90 lw r2,0x2d90(r2)		target current action
0018c46c: 00000000 nop
0018c470: 94420010 lhu r2,0x0010(r2)		special flags
0018c474: 00000000 nop
0018c478: 30424000 andi r2,r2,0x4000		switch team?
0018c47c: 10400012 beq r2,r0,0x0018c4c8		branch if no team switch
0018c480: 00000000 nop

0018c484: 3c048019 lui r4,0x8019
0018c488: 8c842d98 lw r4,0x2d98(r4)		target data
0018c48c: 0c06005e jal 0x00180178		Remove charging status/ability CT
0018c490: 00002821 addu r5,r0,r0		r5 = 0
0018c494: 1040000c beq r2,r0,0x0018c4c8		branch if ?
0018c498: 00000000 nop

0018c49c: 3c038019 lui r3,0x8019
0018c4a0: 8c632d90 lw r3,0x2d90(r3)		target current action
0018c4a4: 00000000 nop
0018c4a8: 90620020 lbu r2,0x0020(r3)		attack status removal 1
0018c4ac: 00000000 nop
0018c4b0: 34420008 ori r2,r2,0x0008		charging
0018c4b4: a0620020 sb r2,0x0020(r3)		remove charging

0018c4b8: 3c038019 lui r3,0x8019
0018c4bc: 8c632d98 lw r3,0x2d98(r3)		target data
0018c4c0: 340200ff ori r2,r0,0x00ff		ff
0018c4c4: a062015d sb r2,0x015d(r3)		store current ability CT ff (no  charge?)
0018c4c8: 0c0612c9 jal 0x00184b24		Validate Status Changes
0018c4cc: 00002021 addu r4,r0,r0
0018c4d0: 00002021 addu r4,r0,r0
0018c4d4: 27a30010 addiu r3,r29,0x0010		Stack location of new status flags

0018c4d8: 3c028019 lui r2,0x8019
0018c4dc: 8c422d98 lw r2,0x2d98(r2)		target data
0018c4e0: 00000000 nop
0018c4e4: 00441021 addu r2,r2,r4
0018c4e8: 90420058 lbu r2,0x0058(r2)		load current status 1
0018c4ec: 24840001 addiu r4,r4,0x0001		??
0018c4f0: a0620000 sb r2,0x0000(r3)		store current status ??
0018c4f4: 28820005 slti r2,r4,0x0005
0018c4f8: 1440fff7 bne r2,r0,0x0018c4d8		??
0018c4fc: 24630001 addiu r3,r3,0x0001

0018c500: 00002021 addu r4,r0,r0		counter = 0
0018c504: 27a30018 addiu r3,r29,0x0018		Stack location of status CT
0018c508: 3c028019 lui r2,0x8019
0018c50c: 8c422d98 lw r2,0x2d98(r2)		target data
0018c510: 00000000 nop
0018c514: 00441021 addu r2,r2,r4		Counter
0018c518: 9042005d lbu r2,0x005d(r2)		load status CT
0018c51c: 24840001 addiu r4,r4,0x0001		Increment counter
0018c520: a0620000 sb r2,0x0000(r3)		store status CT in stack
0018c524: 28820010 slti r2,r4,0x0010			
0018c528: 1440fff7 bne r2,r0,0x0018c508		Loop 16 times
0018c52c: 24630001 addiu r3,r3,0x0001		increment stack pointer by 1
0018c530: 02402021 addu r4,r18,r0		Unit ID
0018c534: 0c06381f jal 0x0018e07c			Post Ability Hardcoding?
0018c538: 00002821 addu r5,r0,r0		
0018c53c: 3c038019 lui r3,0x8019
0018c540: 8c632d98 lw r3,0x2d98(r3)		target data
0018c544: 00000000 nop
0018c548: 90620058 lbu r2,0x0058(r3)		current status 1
0018c54c: 00000000 nop
0018c550: 30420020 andi r2,r2,0x0020		dead
0018c554: 10400014 beq r2,r0,0x0018c5a8		branch if not
0018c558: 00002021 addu r4,r0,r0		r4 = 0
0018c55c: 93a20010 lbu r2,0x0010(r29)		stack status set 1
0018c560: 00000000 nop
0018c564: 30420020 andi r2,r2,0x0020
0018c568: 1440000f bne r2,r0,0x0018c5a8	skip if not dead
0018c56c: 00000000 nop
0018c570: 3c028019 lui r2,0x8019
0018c574: 8c42f5fc lw r2,-0x0a04(r2)		display data
0018c578: 00000000 nop
0018c57c: 14400023 bne r2,r0,0x0018c60c	branch if not dead?
0018c580: 34100002 ori r16,r0,0x0002		r16 = 02
0018c584: 9062015c lbu r2,0x015c(r3)		load dead flag?
0018c588: 00000000 nop
0018c58c: 24420001 addiu r2,r2,0x0001		add 0x01
0018c590: 08063183 j 0x0018c60c			
0018c594: a062015c sb r2,0x015c(r3)		store unit killed

0018c598: 08063176 j 0x0018c5d8			If new status found:
0018c59c: 34100001 ori r16,r0,0x0001		Attack success, exit status loop

0018c5a0: 08063183 j 0x0018c60c			if status CT refreshed:
0018c5a4: 34100001 ori r16,r0,0x0001		Attack success, exit CT loop

0018c5a8: 3c068019 lui r6,0x8019
0018c5ac: 8cc62d98 lw r6,0x2d98(r6)		target data
0018c5b0: 27a50010 addiu r5,r29,0x0010		statuses to inflict (stack)
0018c5b4: 00c41021 addu r2,r6,r4
0018c5b8: 90430058 lbu r3,0x0058(r2)		load current status as indexed
0018c5bc: 90a20000 lbu r2,0x0000(r5)		load statuses to be inflicted (from stack)
0018c5c0: 00000000 nop
0018c5c4: 1462fff4 bne r3,r2,0x0018c598		goto if New status Found
0018c5c8: 24840001 addiu r4,r4,0x0001		if no new status found:
0018c5cc: 28820005 slti r2,r4,0x0005		Set if still not checked every status set
0018c5d0: 1440fff8 bne r2,r0,0x0018c5b4		Loop for every status set
0018c5d4: 24a50001 addiu r5,r5,0x0001

0018c5d8: 00002021 addu r4,r0,r0
0018c5dc: 3c068019 lui r6,0x8019
0018c5e0: 8cc62d98 lw r6,0x2d98(r6)		target data
0018c5e4: 27a50018 addiu r5,r29,0x0018		status CT to inflict (stack)
0018c5e8: 00c41021 addu r2,r6,r4
0018c5ec: 9043005d lbu r3,0x005d(r2)		load status CT left
0018c5f0: 90a20000 lbu r2,0x0000(r5)		Load refreshed status CT
0018c5f4: 00000000 nop
0018c5f8: 1462ffe9 bne r3,r2,0x0018c5a0		goto if refreshed CT found
0018c5fc: 24840001 addiu r4,r4,0x0001		
0018c600: 28820010 slti r2,r4,0x0010
0018c604: 1440fff8 bne r2,r0,0x0018c5e8	loop if still not checked every status CT yet
0018c608: 24a50001 addiu r5,r5,0x0001

0018c60c: 0c063588 jal 0x0018d620		Attacker's Earned Experience
0018c610: 02002021 addu r4,r16,r0
0018c614: 12000005 beq r16,r0,0x0018c62c	Branch if no change happened due to attack
0018c618: 34020002 ori r2,r0,0x0002		r2 = 02
0018c61c: 3c038019 lui r3,0x8019
0018c620: 8c632d98 lw r3,0x2d98(r3)		target data
0018c624: 00000000 nop
0018c628: a0620189 sb r2,0x0189(r3)		store attack success
0018c62c: 0c063336 jal 0x0018ccd8		PA Save, MA Save, etc check
0018c630: 00000000 nop
0018c634: 3c048019 lui r4,0x8019
0018c638: 8c842d98 lw r4,0x2d98(r4)		target data
0018c63c: 00000000 nop
0018c640: 90830058 lbu r3,0x0058(r4)		load current status
0018c644: 00000000 nop
0018c648: 30630060 andi r3,r3,0x0060		
0018c64c: 10600005 beq r3,r0,0x0018c664		branch if not dead/crystal
0018c650: 00001021 addu r2,r0,r0
0018c654: 90820182 lbu r2,0x0182(r4)		set mount flags = 0
0018c658: 00000000 nop
0018c65c: 000211c2 srl r2,r2,0x07
0018c660: 00021023 subu r2,r0,r2
0018c664: 8fbf0034 lw r31,0x0034(r29)
0018c668: 8fb20030 lw r18,0x0030(r29)
0018c66c: 8fb1002c lw r17,0x002c(r29)
0018c670: 8fb00028 lw r16,0x0028(r29)
0018c674: 27bd0038 addiu r29,r29,0x0038
0018c678: 03e00008 jr r31
0018c67c: 00000000 no


Return Locations

00070f6c: In between turn events
0007201c: Main Post Movement
00073c3c: Set some target coordinates/attacker animation, others
00076724: 00076658 - 00076918
0018d784: Store target stats pointer data
0018df6c: Prep gained exp/jp/level/job level
0019d5d0: AI Act phase handling (in between turn, end of turn, etc.)