Difference between revisions of "Reaction check"

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search
(Created page with " Reaction check r4 = unit data 0018c9a0: 3c028019 lui r2,0x8019 0018c9a4: 944238c6 lhu r2,0x38c6(r2) load reaction ID 0018c9a8: 00000000 nop 0018c9ac: 10400006 beq r2,r0...")
 
m (Notes and links)
Line 1: Line 1:
 
  Reaction check
 
  Reaction check
 +
-----------------------------------------
 
  r4 = unit data
 
  r4 = unit data
  0018c9a0: 3c028019 lui r2,0x8019
+
Returns r2
  0018c9a4: 944238c6 lhu r2,0x38c6(r2) load reaction ID
+
    r2 = 0x00 if target 0x019a = 0x00 (Target current action reaction ID)
  0018c9a8: 00000000 nop
+
    r2 = 0x01 if current ability reaction ID <> 0x00 ( 0x801938c6 ) AND 0x801938c8 = 0x00 (current ability post action flag ?)
  0018c9ac: 10400006 beq r2,r0,0x 0018c9c8 branch if no reaction
+
    r2 = 0x02 if target 0x019a <> 0x00 (Target current action reaction ID)
  0018c9b0: 00000000 nop
+
-----------------------------------------
  0018c9b4: 3c028019 lui r2,0x8019
+
  0018c9a0: 3c028019 lui r2,0x8019           |
  0018c9b8: 944238c8 lhu r2,0x38c8(r2) load post action flags?
+
  0018c9a4: 944238c6 lhu r2,0x38c6(r2)       |{{f/load|<nowiki>r2 = current ability reaction ID</nowiki>}} {{f/std|<nowiki> 0x801938c6 </nowiki>}}
  0018c9bc: 00000000 nop
+
  0018c9a8: 00000000 nop                     |
  0018c9c0: 10400006 beq r2,r0,0x 0018c9dc branch if ?? = 0, return r2= 01
+
  0018c9ac: 10400006 beq r2,r0,0x0018c9c8    {{f/Cond|<nowiki>If reaction ID <> 0x00</nowiki>}} /Else branch to target current action reaction ID check
  0018c9c4: 34020001 ori r2,r0,0x0001
+
  0018c9b0: 00000000 nop                     |
  0018c9c8: 8482019a lh r2,0x019a(r4) load reaction ID
+
  0018c9b4: 3c028019 lui r2,0x8019           |
  0018c9cc: 00000000 nop
+
  0018c9b8: 944238c8 lhu r2,0x38c8(r2)             |{{f/load|<nowiki>r2 = ? Flag (pos action ?)</nowiki>}} {{f/std|<nowiki> 0x801938c8</nowiki>}}
  0018c9d0: 10400002 beq r2,r0,0x 0018c9dc return r2 = 0 if no reaction ID
+
  0018c9bc: 00000000 nop                           |
  0018c9d4: 00000000 nop
+
  0018c9c0: 10400006 beq r2,r0,0x0018c9dc          {{f/Cond|<nowiki>If post action flag is <> 0x00</nowiki>}} /Else branch to end (r2 = 0x01)
  0018c9d8: 34020002 ori r2,r0,0x0002 return r2 = 0x02 if self reaction
+
  0018c9c4: 34020001 ori r2,r0,0x0001             |{{f/std|<nowiki>r2 = 0x01</nowiki>}}
  0018c9dc: 03e00008 jr r31
+
  0018c9c8: 8482019a lh r2,0x019a(r4)         |{{f/load|<nowiki>r2 = target current data reaction ID</nowiki>}}
  0018c9e0: 00000000 nop
+
  0018c9cc: 00000000 nop                     |
 +
  0018c9d0: 10400002 beq r2,r0,0x0018c9dc    {{f/Cond|<nowiki>If reaction ID <> 0x00</nowiki>}} /Else branch to end (r2 = 0x00)
 +
  0018c9d4: 00000000 nop                     |
 +
  0018c9d8: 34020002 ori r2,r0,0x0002             |{{f/std|<nowiki>r2 = 0x02 (if self reaction ? / Guard reaction ?)</nowiki>}}
 +
  0018c9dc: 03e00008 jr r31                      
 +
  0018c9e0: 00000000 nop  
 +
 
 +
==Return locations==
 +
0018c944: [[Check_if_unit_can_react_1]]
 +
0018ca1c: [[%27Reflect%27,_Blade_Grasp,_and_Arrow_Guard]]

Revision as of 21:29, 24 November 2021

Reaction check
-----------------------------------------
r4 = unit data
Returns r2
    r2 = 0x00 if target 0x019a = 0x00 (Target current action reaction ID)
    r2 = 0x01 if current ability reaction ID <> 0x00 ( 0x801938c6 ) AND 0x801938c8 = 0x00 (current ability post action flag ?)
    r2 = 0x02 if target 0x019a <> 0x00 (Target current action reaction ID)
-----------------------------------------
0018c9a0: 3c028019 lui r2,0x8019            |
0018c9a4: 944238c6 lhu r2,0x38c6(r2)        |r2 = current ability reaction ID  0x801938c6 
0018c9a8: 00000000 nop                      |
0018c9ac: 10400006 beq r2,r0,0x0018c9c8     #If reaction ID <> 0x00 /Else branch to target current action reaction ID check
0018c9b0: 00000000 nop                      |
0018c9b4: 3c028019 lui r2,0x8019            |
0018c9b8: 944238c8 lhu r2,0x38c8(r2)             |r2 = ? Flag (pos action ?)  0x801938c8
0018c9bc: 00000000 nop                           |
0018c9c0: 10400006 beq r2,r0,0x0018c9dc          #If post action flag is <> 0x00 /Else branch to end (r2 = 0x01)
0018c9c4: 34020001 ori r2,r0,0x0001              |r2 = 0x01
0018c9c8: 8482019a lh r2,0x019a(r4)         |r2 = target current data reaction ID
0018c9cc: 00000000 nop                      |
0018c9d0: 10400002 beq r2,r0,0x0018c9dc     #If reaction ID <> 0x00 /Else branch to end (r2 = 0x00)
0018c9d4: 00000000 nop                      |
0018c9d8: 34020002 ori r2,r0,0x0002              |r2 = 0x02 (if self reaction ? / Guard reaction ?)
0018c9dc: 03e00008 jr r31                        
0018c9e0: 00000000 nop    

Return locations

0018c944: Check_if_unit_can_react_1
0018ca1c: 'Reflect',_Blade_Grasp,_and_Arrow_Guard