Store main target ID and focus on target flag

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search
BATTLE.BIN : Store main target ID + focus on target
-----------------------------------------------------------------------------------------
Parameters : r4 = Targeted Unit ID

Returns : Nothing
-----------------------------------------------------------------------------------------
0019490c: 3c05801a lui r5,0x801a            |
00194910: 8ca501f8 lw r5,0x01f8(r5)         |load acting units decision data pointer
00194914: 27bdffe8 addiu r29,r29,-0x0018    |
00194918: afbf0010 sw r31,0x0010(r29)       |
0019491c: 90a20004 lbu r2,0x0004(r5)        |Load AI Behavior (Auto Battle)
00194920: a0a40005 sb r4,0x0005(r5)         |Store main target ID
00194924: 34420040 ori r2,r2,0x0040         |Enable [Focus on Target]
00194928: 304200df andi r2,r2,0x00df        |Unflag [Stay near X/Y location]
0019492c: 0c067ca9 jal 0x0019f2a4           |-->Transfer_Unit_Coordinates_to_AI Transfer X, Y elevation (and set AI decision 0x03 to 0)
00194930: a0a20004 sb r2,0x0004(r5)         |Store Updated flags
00194934: 8fbf0010 lw r31,0x0010(r29)       |
00194938: 27bd0018 addiu r29,r29,0x0018     |
0019493c: 03e00008 jr r31                   END
00194940: 00000000 nop

Return Locations

BATTLE.BIN
001948e8: Set_AI_flags_for_target_consideration
001981c0: Fight_for_Life_-_Auto_Battle_(00197ff4)
001985f8: Protect_Allies_-_Auto_Battle_(001984ec)
00198e3c: Save_Fading_Life_-_Auto_Battle_(00198df0)
00198ee0: 00198e60_-_00199058