0019c20c - 0019c27c

From Final Fantasy Hacktics Wiki
Revision as of 09:02, 16 May 2024 by Orkney (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
BATTLE.BIN :  - 0019c20c_-_0019c27c
------------------------------------------------------------------------------------------
Parameter : Nothing
Return : Nothing
------------------------------------------------------------------------------------------
0019c20c: 27bdffe8 addiu r29,r29,-0x0018     |
0019c210: 3c03801a lui r3,0x801a             |
0019c214: 8c63f3dc lw r3,-0x0c24(r3)         |Coordinates if interest AI 0x0018
0019c218: 3c02801a lui r2,0x801a             |
0019c21c: 8c4201f4 lw r2,0x01f4(r2)          |Acting Unit Coordinates AI 0x0e30
0019c220: 3c04801a lui r4,0x801a             |
0019c224: 2484f3c4 addiu r4,r4,-0x0c3c       |0x8019f3c4
0019c228: 10620005 beq r3,r2,0x0019c240      #If Acting Unit is not at considered coordinates
0019c22c: afbf0010 sw r31,0x0010(r29)            |
0019c230: 3c01801a lui r1,0x801a                 |
0019c234: a020f3d8 sb r0,-0x0c28(r1)             |Set AI 0x14 to 0x00
0019c238: 0806709a j 0x0019c268                  >>Avoid opposite section (keep coordinates)
0019c23c: 00000000 nop                           |
                                             Else : Acting Unit coordinates = considered coordinates
0019c240: 3c02801a lui r2,0x801a                 |
0019c244: 904201f1 lbu r2,0x01f1(r2)             |AI 0xe2d
0019c248: 34030001 ori r3,r0,0x0001              |
0019c24c: 3c01801a lui r1,0x801a                 |
0019c250: a023f3d8 sb r3,-0x0c28(r1)             |Set AI 0x14 to 0x01
0019c254: 00021080 sll r2,r2,0x02                |
0019c258: 00441021 addu r2,r2,r4                 |
0019c25c: 8c420cc4 lw r2,0x0cc4(r2)              |Load AI 0xcc4 Coordinates based on 0xe2d Reachable +/- Closer or Farther of Target
0019c260: 3c01801a lui r1,0x801a                 |
0019c264: ac22f3dc sw r2,-0x0c24(r1)             |Update coordinates of interest with Coordinates at 0x0cc4 (+0xe2d offset)
0019c268: 0c066ec8 jal 0x0019bb20            |-->AI_Check_if_Unit_is_a_Crystal/Treasure_(0019bb20) Set AI 0xcbf = 0x1 if there is a crystal on Tile
0019c26c: 00000000 nop                       |
0019c270: 8fbf0010 lw r31,0x0010(r29)
0019c274: 27bd0018 addiu r29,r29,0x0018
0019c278: 03e00008 jr r31
0019c27c: 00000000 nop

Return locations

BATTLE.BIN
 0019c0bc: Find_Highest_Target_Priority_in_Ability_Range_(0019bf2c)
 0019c164: Find_Highest_Target_Priority_in_Ability_Range_(0019bf2c)