Difference between revisions of "Check if unit can react?"

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search
 
Line 7: Line 7:
 
  0018c970: 27bdffe8 addiu r29,r29,0xffe8    |
 
  0018c970: 27bdffe8 addiu r29,r29,0xffe8    |
 
  0018c974: 14400005 bne r2,r0,0x0018c98c    {{f/Cond|<nowiki>If not a reaction (r2 = 0x00)</nowiki>}} /If already reacting branch near end setting r2 to 0x01 (skip check by jal below)
 
  0018c974: 14400005 bne r2,r0,0x0018c98c    {{f/Cond|<nowiki>If not a reaction (r2 = 0x00)</nowiki>}} /If already reacting branch near end setting r2 to 0x01 (skip check by jal below)
  0018c978: afbf0010 sw r31,0x0010(r29)       |
+
  0018c978: afbf0010 sw r31,0x0010(r29)           |
 
  0018c97c: 0c01786c jal 0x0005e1b0                |-->[[Status Checks (r5 = set to check)|<span style="color:blue">Status Checks (r5 = set to check)</span>]]  - returns r2= 0 (no status found) or r2=1 (status preventing reaction has been found)
 
  0018c97c: 0c01786c jal 0x0005e1b0                |-->[[Status Checks (r5 = set to check)|<span style="color:blue">Status Checks (r5 = set to check)</span>]]  - returns r2= 0 (no status found) or r2=1 (status preventing reaction has been found)
 
  0018c980: 34050004 ori r5,r0,0x0004              |{{f/std|<nowiki>r5 = 0x04</nowiki>}} {{f/jal|Status_Check_table_-_0x800662d0|<nowiki>Status_Check_table_-_0x800662d0</nowiki>}}
 
  0018c980: 34050004 ori r5,r0,0x0004              |{{f/std|<nowiki>r5 = 0x04</nowiki>}} {{f/jal|Status_Check_table_-_0x800662d0|<nowiki>Status_Check_table_-_0x800662d0</nowiki>}}

Latest revision as of 20:02, 24 May 2024

Parameters : r4 = unit data pointer

Returns r2 = 0x00 if unit can react, if not r2 = 0x01

0018c968: 3c028019 lui r2,0x8019            |
0018c96c: 8c42f5f0 lw r2,-0x0a10(r2)        |r2 = type of action ( 0x8018F5F0 ) 8018F5F0
0018c970: 27bdffe8 addiu r29,r29,0xffe8     |
0018c974: 14400005 bne r2,r0,0x0018c98c     #If not a reaction (r2 = 0x00) /If already reacting branch near end setting r2 to 0x01 (skip check by jal below)
0018c978: afbf0010 sw r31,0x0010(r29)            |
0018c97c: 0c01786c jal 0x0005e1b0                |-->Status Checks (r5 = set to check)  - returns r2= 0 (no status found) or r2=1 (status preventing reaction has been found)
0018c980: 34050004 ori r5,r0,0x0004              |r5 = 0x04 -->Status_Check_table_-_0x800662d0
0018c984: 08063264 j 0x0018c990                  >>jump to end
0018c988: 00000000 nop                           |
0018c98c: 34020001 ori r2,r0,0x0001         |r2 = 0x01 
0018c990: 8fbf0010 lw r31,0x0010(r29)       |
0018c994: 27bd0018 addiu r29,r29,0x0018     
0018c998: 03e00008 jr r31                   
0018c99c: 00000000 nop

Return locations

0017e094: Big..._Contains_Hamedo_check
0017e214: Main_reaction_routine?
0018c934: Check_if_unit_can_react_1
0018ca90: 'Reflect',_Blade_Grasp,_and_Arrow_Guard
001825c8: Monster_Skill_check
0018f060: Mimic_ability_setting