Check if Unit can be Targeted
Jump to navigation
Jump to search
0017bdd0: 27bdffe0 addiu r29,r29,0xffe0 0017bdd4: afb00010 sw r16,0x0010(r29) 0017bdd8: 00a08021 addu r16,r5,r0 r16 = Stack Pointer 0017bddc: 000410c0 sll r2,r4,0x03 Unit ID * 8 0017bde0: 00441023 subu r2,r2,r4 ID * 7 0017bde4: 00021180 sll r2,r2,0x06 ID * 448 0017bde8: 3c038019 lui r3,0x8019 0017bdec: 246308cc addiu r3,r3,0x08cc 0017bdf0: afb10014 sw r17,0x0014(r29) 0017bdf4: 00438821 addu r17,r2,r3 r17 = Unit's Data Pointer 0017bdf8: afbf0018 sw r31,0x0018(r29) 0017bdfc: 0c060428 jal 0x001810a0 Map Location Calculation 0017be00: 02202021 addu r4,r17,r0 r4 = Unit's Data Pointer 0017be04: ae020000 sw r2,0x0000(r16) Store Tile ID 0017be08: 92230001 lbu r3,0x0001(r17) Load Unit's ID 0017be0c: 340200ff ori r2,r0,0x00ff 0017be10: 1062000f beq r3,r2,0x0017be50 Branch if Unit doesn't exist 0017be14: 34020001 ori r2,r0,0x0001 r2 = 1 0017be18: 92220058 lbu r2,0x0058(r17) Load Unit's Current Statuses 1 0017be1c: 00000000 nop 0017be20: 30420044 andi r2,r2,0x0044 0017be24: 1440000a bne r2,r0,0x0017be50 Branch if Unit is a Crystal/Jumping 0017be28: 34020001 ori r2,r0,0x0001 r2 = 1 0017be2c: 92220059 lbu r2,0x0059(r17) Load Unit's Current Statuses 2 0017be30: 00000000 nop 0017be34: 30420001 andi r2,r2,0x0001 0017be38: 14400005 bne r2,r0,0x0017be50 Branch if Unit is Treasure 0017be3c: 34020001 ori r2,r0,0x0001 r2 = 1 0017be40: 92220182 lbu r2,0x0182(r17) Load Unit's Mount Info 0017be44: 00000000 nop 0017be48: 30420040 andi r2,r2,0x0040 0017be4c: 0002102b sltu r2,r0,r2 r2 = 1 if Unit is being Ridden 0017be50: 8fbf0018 lw r31,0x0018(r29) 0017be54: 8fb10014 lw r17,0x0014(r29) 0017be58: 8fb00010 lw r16,0x0010(r29) 0017be5c: 27bd0020 addiu r29,r29,0x0020 0017be60: 03e00008 jr r31 0017be64: 00000000 nop