Difference between revisions of "Face Up and Absorb Used MP usability"

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search
(Created page with " Face Up and Absorb Used MP Usability: 0018cf74: 27bdffe0 addiu r29,r29,0xffe0 0018cf78: afb10014 sw r17,0x0014(r29) 0018cf7c: 3c118019 lui r17,0x8019 00...")
 
m
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
  Face Up and Absorb Used MP Usability:
+
  Parameters : r4 = Target Reaction Ability ID (determined from Target reaction set)
  0018cf74: 27bdffe0 addiu r29,r29,0xffe0     
+
  0018cf78: afb10014 sw r17,0x0014(r29)    
+
If Used Ability do not cost MP ( 0x801938eb ) - skip routine (no reaction)
  0018cf7c: 3c118019 lui r17,0x8019    
+
Test Unit Brave% as chance to react : skip the routine if failed
  0018cf80: 263138eb addiu r17,r17,0x38eb     Load MP Used
+
  0018cf84: afbf0018 sw r31,0x0018(r29)    
+
If Targeted Unit react :
  0018cf88: afb00010 sw r16,0x0010(r29)    
+
- Store Reaction Ability ID in Target Data 0x19e (= current action 0x0e)
  0018cf8c: 92220000 lbu r2,0x0000(r17)     Load MP used into R2
+
- Store Used Ability MP (from 0x801938eb) in Target data 0x1b2 (current action 0x26) - last attack received ?
  0018cf90: 00000000 nop          
+
--------------------------------------------------------------------------------------------
  0018cf94: 1040000e beq r2,r0,0x0018cfd0     Branch to end if No MP was used
+
  0018cf74: 27bdffe0 addiu r29,r29,-0x0020    |
  0018cf98: 00808021 addu r16,r4,r0    
+
  0018cf78: afb10014 sw r17,0x0014(r29)       |
  0018cf9c: 3c048019 lui r4,0x8019    
+
  0018cf7c: 3c118019 lui r17,0x8019           |
  0018cfa0: 8c842d98 lw r4,0x2d98(r4)     Load Defender's Stats
+
  0018cf80: 263138eb addiu r17,r17,0x38eb     |{{f/adr|<nowiki>r17 = 0x801938eb (Current ability used MP)</nowiki>}}
  0018cfa4: 0c0634e1 jal 0x0018d384     Chance to React
+
  0018cf84: afbf0018 sw r31,0x0018(r29)       |
  0018cfa8: 00000000 nop          
+
  0018cf88: afb00010 sw r16,0x0010(r29)       |
  0018cfac: 14400008 bne r2,r0,0x0018cfd0     Branch if Reaction Failed
+
  0018cf8c: 92220000 lbu r2,0x0000(r17)       |{{f/load|<nowiki>r2 = Current ability used MP</nowiki>}}
  0018cfb0: 00000000 nop          
+
  0018cf90: 00000000 nop                     |
  0018cfb4: 3c038019 lui r3,0x8019    
+
  0018cf94: 1040000e beq r2,r0,0x0018cfd0     {{f/Cond|If Used MP > 0x00}} /Else Branch to END
  0018cfb8: 8c632d90 lw r3,0x2d90(r3)     Current Action Data Pointer
+
  0018cf98: 00808021 addu r16,r4,r0           |{{f/std|<nowiki>r16 = Target Reaction Ability ID</nowiki>}}
  0018cfbc: 00000000 nop          
+
  0018cf9c: 3c048019 lui r4,0x8019               |
  0018cfc0: a470000e sh r16,0x000e(r3)     Store Reaction ID
+
  0018cfa0: 8c842d98 lw r4,0x2d98(r4)             |{{f/adr|<nowiki>r4 = Targeted Unit data pointer</nowiki>}}
  0018cfc4: 92220000 lbu r2,0x0000(r17)    
+
  0018cfa4: 0c0634e1 jal 0x0018d384               |{{f/jal|Chance to React|Chance to React}}  Returns r2 = 0x00 if Unit is reacting ( chances are Brave%)
  0018cfc8: 00000000 nop          
+
  0018cfa8: 00000000 nop                         |
  0018cfcc: a4620026 sh r2,0x0026(r3)     Store Last Attack on Self?
+
  0018cfac: 14400008 bne r2,r0,0x0018cfd0         {{f/Cond|If Targeting Unit is going to react}}
  0018cfd0: 8fbf0018 lw r31,0x0018(r29)    
+
  0018cfb0: 00000000 nop                             |
  0018cfd4: 8fb10014 lw r17,0x0014(r29)    
+
  0018cfb4: 3c038019 lui r3,0x8019                   |{{f/std| }}
  0018cfd8: 8fb00010 lw r16,0x0010(r29)    
+
  0018cfb8: 8c632d90 lw r3,0x2d90(r3)                 |{{f/adr|<nowiki>r3 = Target Current Action Data pointer</nowiki>}}
  0018cfdc: 27bd0020 addiu r29,r29,0x0020    
+
  0018cfbc: 00000000 nop                             |
  0018cfe0: 03e00008 jr r31        
+
  0018cfc0: a470000e sh r16,0x000e(r3)               |{{f/store|Store Reaction Ability ID in Unit 0x19a}}
 +
  0018cfc4: 92220000 lbu r2,0x0000(r17)               |{{f/load|<nowiki>r2 = Current ability used MP</nowiki>}}
 +
  0018cfc8: 00000000 nop                             |
 +
  0018cfcc: a4620026 sh r2,0x0026(r3)                 |{{f/store|<nowiki>Target last attack received = Current Ability last used MP</nowiki>}} {{f/std| Unit 0x1b2}}
 +
  0018cfd0: 8fbf0018 lw r31,0x0018(r29)       END
 +
  0018cfd4: 8fb10014 lw r17,0x0014(r29)              
 +
  0018cfd8: 8fb00010 lw r16,0x0010(r29)              
 +
  0018cfdc: 27bd0020 addiu r29,r29,0x0020            
 +
  0018cfe0: 03e00008 jr r31                          
 
  0018cfe4: 00000000 nop
 
  0018cfe4: 00000000 nop
 +
=== Return locations ===
 +
'''Battle.bin'''
 +
0018cbac: [[Sunken_State,_Caution,_Dragon_Spirit,_counters,_absorbs_usability]]
 +
0018cbf4: [[Sunken_State,_Caution,_Dragon_Spirit,_counters,_absorbs_usability]]

Latest revision as of 21:20, 14 March 2022

Parameters : r4 = Target Reaction Ability ID (determined from Target reaction set)

If Used Ability do not cost MP ( 0x801938eb ) - skip 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 MP (from 0x801938eb) in Target data 0x1b2 (current action 0x26) - last attack received ?
--------------------------------------------------------------------------------------------
0018cf74: 27bdffe0 addiu r29,r29,-0x0020    |
0018cf78: afb10014 sw r17,0x0014(r29)       |
0018cf7c: 3c118019 lui r17,0x8019           |
0018cf80: 263138eb addiu r17,r17,0x38eb     |r17 = 0x801938eb (Current ability used MP)
0018cf84: afbf0018 sw r31,0x0018(r29)       |
0018cf88: afb00010 sw r16,0x0010(r29)       |
0018cf8c: 92220000 lbu r2,0x0000(r17)       |r2 = Current ability used MP
0018cf90: 00000000 nop                      |
0018cf94: 1040000e beq r2,r0,0x0018cfd0     #If Used MP > 0x00 /Else Branch to END
0018cf98: 00808021 addu r16,r4,r0           |r16 = Target Reaction Ability ID
0018cf9c: 3c048019 lui r4,0x8019                |
0018cfa0: 8c842d98 lw r4,0x2d98(r4)             |r4 = Targeted Unit data pointer
0018cfa4: 0c0634e1 jal 0x0018d384               |-->Chance to React  Returns r2 = 0x00 if Unit is reacting ( chances are Brave%)
0018cfa8: 00000000 nop                          |
0018cfac: 14400008 bne r2,r0,0x0018cfd0         #If Targeting Unit is going to react
0018cfb0: 00000000 nop                              |
0018cfb4: 3c038019 lui r3,0x8019                    | 
0018cfb8: 8c632d90 lw r3,0x2d90(r3)                 |r3 = Target Current Action Data pointer
0018cfbc: 00000000 nop                              |
0018cfc0: a470000e sh r16,0x000e(r3)                |Store Reaction Ability ID in Unit 0x19a
0018cfc4: 92220000 lbu r2,0x0000(r17)               |r2 = Current ability used MP
0018cfc8: 00000000 nop                              |
0018cfcc: a4620026 sh r2,0x0026(r3)                 |Target last attack received = Current Ability last used MP  Unit 0x1b2
0018cfd0: 8fbf0018 lw r31,0x0018(r29)       END
0018cfd4: 8fb10014 lw r17,0x0014(r29)               
0018cfd8: 8fb00010 lw r16,0x0010(r29)               
0018cfdc: 27bd0020 addiu r29,r29,0x0020             
0018cfe0: 03e00008 jr r31                           
0018cfe4: 00000000 nop

Return locations

Battle.bin
0018cbac: Sunken_State,_Caution,_Dragon_Spirit,_counters,_absorbs_usability
0018cbf4: Sunken_State,_Caution,_Dragon_Spirit,_counters,_absorbs_usability