Difference between revisions of "Counter, Counter Tackle, Counter Flood, Brave Up, Dragon Spirit, Sunken State, and Caution Usability usability"

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search
(Created page with " Counter, Counter Tackle, Counter Magic, Counter Flood, Brave Up, Dragon Spirit, Sunken State, and Caution Usability: 0018ce04: 27bdffe8 addiu r29,r29,0xffe8 0018ce0...")
 
m
 
(5 intermediate revisions by 4 users not shown)
Line 1: Line 1:
  Counter, Counter Tackle, Counter Magic, Counter Flood, Brave Up, Dragon Spirit,  Sunken State, and Caution Usability:
+
  '''Counter, Counter Tackle, Counter Magic, Counter Flood, Brave Up, Dragon Spirit,  Sunken State, and Caution Usability:'''
  0018ce04: 27bdffe8 addiu r29,r29,0xffe8     
+
  0018ce08: afb00010 sw r16,0x0010(r29)    
+
Parameters : r4 = Target Reaction Ability ID (determined from Target reaction set)
  0018ce0c: 00808021 addu r16,r4,r0    
+
              r5 = Ability flag to check (0x80 = Counterflood flag - 0x40 = counter Magic flag / 0x10 = Counter Grasp flag)
  0018ce10: 3c038019 lui r3,0x8019    
+
  0018ce14: 906338d4 lbu r3,0x38d4(r3)     ???
+
If Used skillset ( 0x801938d4 ) is Math skill : skip the routine (no reaction)
  0018ce18: 34020015 ori r2,r0,0x0015    
+
Checks if Used Ability has desired flag enable (using 0x801938f6) if not, skip the routine (no reaction)
  0018ce1c: 10620015 beq r3,r2,0x0018ce74    
+
Test Unit Brave% as chance to react : skip the routine if failed
  0018ce20: afbf0014 sw r31,0x0014(r29)    
+
  0018ce24: 3c028019 lui r2,0x8019    
+
If Targeted Unit react :
  0018ce28: 904238f6 lbu r2,0x38f6(r2)     Ability flags 4
+
- Store Reaction Ability ID in Target Data 0x19e (= current action 0x0e)
  0018ce2c: 00000000 nop
+
- Store Used Ability ID (from 0x801938d6) in Target data 0x1b2 (current action 0x26) - last attack received ?
  0018ce30: 00451024 and r2,r2,r5        
+
--------------------------------------------------------------------------------------------
  0018ce34: 1040000f beq r2,r0,0x0018ce74     Branch if ability is not using  specific ability flag (counter magic/flood/etc.)
+
  0018ce04: 27bdffe8 addiu r29,r29,-0x0018    |
  0018ce38: 00000000 nop          
+
  0018ce08: afb00010 sw r16,0x0010(r29)       |
  0018ce3c: 3c048019 lui r4,0x8019    
+
  0018ce0c: 00808021 addu r16,r4,r0           |{{f/std|<nowiki>r16 = Targeted Unit's Reaction Ability ID</nowiki>}}
  0018ce40: 8c842d98 lw r4,0x2d98(r4)     Load Defender's Stats
+
  0018ce10: 3c038019 lui r3,0x8019           |
  0018ce44: 0c0634e1 jal 0x0018d384     Chance to react
+
  0018ce14: 906338d4 lbu r3,0x38d4(r3)       |{{f/load|<nowiki>r3 = Current action used skillset (by Attacker)</nowiki>}} {{f/std| 0x801938d4 / 801938d4}}
  0018ce48: 00000000 nop          
+
  0018ce18: 34020015 ori r2,r0,0x0015         |{{f/std|<nowiki>r2 = 0x15</nowiki>}}
  0018ce4c: 14400009 bne r2,r0,0x0018ce74    
+
  0018ce1c: 10620015 beq r3,r2,0x0018ce74     {{f/Cond|If Attacker used skillset is NOT math skill}} /Else branch to {{f/loc|END}} (no reaction)
  0018ce50: 00000000 nop          
+
  0018ce20: afbf0014 sw r31,0x0014(r29)           |
  0018ce54: 3c038019 lui r3,0x8019    
+
  0018ce24: 3c028019 lui r2,0x8019               |{{f/std|<nowiki>r2 = 0x8019</nowiki>}}
  0018ce58: 8c632d90 lw r3,0x2d90(r3)     Current Action Data Pointer
+
  0018ce28: 904238f6 lbu r2,0x38f6(r2)           |{{f/load|<nowiki>r2 = Attacker's used ability flags 4</nowiki>}}
  0018ce5c: 00000000 nop          
+
  0018ce2c: 00000000 nop                         |
  0018ce60: a470000e sh r16,0x000e(r3)     Reaction ID  
+
  0018ce30: 00451024 and r2,r2,r5                 |{{f/std|r2 <> 0x00 if Desired Ability Flag is enabled}}
  0018ce64: 3c028019 lui r2,0x8019    
+
  0018ce34: 1040000f beq r2,r0,0x0018ce74         {{f/Cond|If Desired Ability Flag is enabled}} /Else branch to {{f/loc|END}} (no reaction)
  0018ce68: 944238d6 lhu r2,0x38d6(r2)     Used Ability ID
+
  0018ce38: 00000000 nop                             |{{f/std| }}
  0018ce6c: 00000000 nop          
+
  0018ce3c: 3c048019 lui r4,0x8019                   |{{f/std| }}
  0018ce70: a4620026 sh r2,0x0026(r3)    
+
  0018ce40: 8c842d98 lw r4,0x2d98(r4)                 |{{f/adr|<nowiki>r4 = Targeted Unit data pointer</nowiki>}}
  0018ce74: 8fbf0014 lw r31,0x0014(r29)    
+
  0018ce44: 0c0634e1 jal 0x0018d384                   |{{f/jal|Chance_to_React|Chance_to_React}}  Returns r2 = 0x00 if Unit is reacting ( chances are Brave%)
  0018ce78: 8fb00010 lw r16,0x0010(r29)    
+
  0018ce48: 00000000 nop                             |
  0018ce7c: 27bd0018 addiu r29,r29,0x0018    
+
  0018ce4c: 14400009 bne r2,r0,0x0018ce74             {{f/Cond|If Targeted unit is reacting}} /Else branch to {{f/loc|END}} (no reaction)
  0018ce80: 03e00008 jr r31        
+
  0018ce50: 00000000 nop                                 |
 +
  0018ce54: 3c038019 lui r3,0x8019                       |{{f/std| }}
 +
  0018ce58: 8c632d90 lw r3,0x2d90(r3)                     |{{f/adr|<nowiki>r3 = Targeted Unit current action data pointer</nowiki>}}
 +
  0018ce5c: 00000000 nop                                 |
 +
  0018ce60: a470000e sh r16,0x000e(r3)                   |{{f/store|Store Reaction Ability ID in Unit 0x19a}}
 +
  0018ce64: 3c028019 lui r2,0x8019                       |
 +
  0018ce68: 944238d6 lhu r2,0x38d6(r2)                   |{{f/load|<nowiki>r2 = Current Ability Attacker used Ability ID</nowiki>}} {{f/std| 0x801938d6}}
 +
  0018ce6c: 00000000 nop                                 |
 +
  0018ce70: a4620026 sh r2,0x0026(r3)                     |{{f/store|<nowiki>Target last attack received = Current Ability last used Ability ID</nowiki>}} {{f/std| Unit 0x1b2}}
 +
  0018ce74: 8fbf0014 lw r31,0x0014(r29)       END                 
 +
  0018ce78: 8fb00010 lw r16,0x0010(r29)                  
 +
  0018ce7c: 27bd0018 addiu r29,r29,0x0018                
 +
  0018ce80: 03e00008 jr r31                              
 
  0018ce84: 00000000 nop
 
  0018ce84: 00000000 nop
 +
=== Return locations ===
 +
'''Battle.bin'''
 +
0018cc24: [[Sunken_State,_Caution,_Dragon_Spirit,_counters,_absorbs_usability]]

Latest revision as of 21:21, 14 March 2022

Counter, Counter Tackle, Counter Magic, Counter Flood, Brave Up, Dragon Spirit,  Sunken State, and Caution Usability:

Parameters : r4 = Target Reaction Ability ID (determined from Target reaction set)
             r5 = Ability flag to check (0x80 = Counterflood flag - 0x40 = counter Magic flag / 0x10 = Counter Grasp flag)

If Used skillset ( 0x801938d4 ) is Math skill : skip the routine (no reaction)
Checks if Used Ability has desired flag enable (using 0x801938f6) if not, skip the routine (no reaction)
Test Unit Brave% as chance to react : skip the routine if failed

If Targeted Unit react :
- Store Reaction Ability ID in Target Data 0x19e (= current action 0x0e)
- Store Used Ability ID (from 0x801938d6) in Target data 0x1b2 (current action 0x26) - last attack received ?
--------------------------------------------------------------------------------------------
0018ce04: 27bdffe8 addiu r29,r29,-0x0018    |
0018ce08: afb00010 sw r16,0x0010(r29)       |
0018ce0c: 00808021 addu r16,r4,r0           |r16 = Targeted Unit's Reaction Ability ID
0018ce10: 3c038019 lui r3,0x8019            |
0018ce14: 906338d4 lbu r3,0x38d4(r3)        |r3 = Current action used skillset (by Attacker)  0x801938d4 / 801938d4
0018ce18: 34020015 ori r2,r0,0x0015         |r2 = 0x15
0018ce1c: 10620015 beq r3,r2,0x0018ce74     #If Attacker used skillset is NOT math skill /Else branch to END (no reaction)
0018ce20: afbf0014 sw r31,0x0014(r29)           |
0018ce24: 3c028019 lui r2,0x8019                |r2 = 0x8019
0018ce28: 904238f6 lbu r2,0x38f6(r2)            |r2 = Attacker's used ability flags 4
0018ce2c: 00000000 nop                          |
0018ce30: 00451024 and r2,r2,r5                 |r2 <> 0x00 if Desired Ability Flag is enabled
0018ce34: 1040000f beq r2,r0,0x0018ce74         #If Desired Ability Flag is enabled /Else branch to END (no reaction)
0018ce38: 00000000 nop                              | 
0018ce3c: 3c048019 lui r4,0x8019                    | 
0018ce40: 8c842d98 lw r4,0x2d98(r4)                 |r4 = Targeted Unit data pointer
0018ce44: 0c0634e1 jal 0x0018d384                   |-->Chance_to_React  Returns r2 = 0x00 if Unit is reacting ( chances are Brave%)
0018ce48: 00000000 nop                              |
0018ce4c: 14400009 bne r2,r0,0x0018ce74             #If Targeted unit is reacting /Else branch to END (no reaction)
0018ce50: 00000000 nop                                  |
0018ce54: 3c038019 lui r3,0x8019                        | 
0018ce58: 8c632d90 lw r3,0x2d90(r3)                     |r3 = Targeted Unit current action data pointer
0018ce5c: 00000000 nop                                  |
0018ce60: a470000e sh r16,0x000e(r3)                    |Store Reaction Ability ID in Unit 0x19a
0018ce64: 3c028019 lui r2,0x8019                        |
0018ce68: 944238d6 lhu r2,0x38d6(r2)                    |r2 = Current Ability Attacker used Ability ID  0x801938d6
0018ce6c: 00000000 nop                                  |
0018ce70: a4620026 sh r2,0x0026(r3)                     |Target last attack received = Current Ability last used Ability ID  Unit 0x1b2
0018ce74: 8fbf0014 lw r31,0x0014(r29)       END                  
0018ce78: 8fb00010 lw r16,0x0010(r29)                   
0018ce7c: 27bd0018 addiu r29,r29,0x0018                 
0018ce80: 03e00008 jr r31                               
0018ce84: 00000000 nop

Return locations

Battle.bin
0018cc24: Sunken_State,_Caution,_Dragon_Spirit,_counters,_absorbs_usability