Difference between revisions of "Check Allies/Enemies that can be Targeted"

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search
(Created page with " Check Allies/Enemies that can be Targeted 0017bc78: 27bdffc0 addiu r29,r29,0xffc0 0017bc7c: afb5002c sw r21,0x002c(r29) 0017bc80: 00a0a821 addu r21,r5,r0 r21 = Can Hit E...")
 
m (link to 0x0017bdd0)
Line 26: Line 26:
 
  0017bcd4: 903408d1 lbu r20,0x08d1(r1) Load Unit's ENTD Flags
 
  0017bcd4: 903408d1 lbu r20,0x08d1(r1) Load Unit's ENTD Flags
 
  0017bcd8: 02002021 addu r4,r16,r0 r4 = Unit Counter
 
  0017bcd8: 02002021 addu r4,r16,r0 r4 = Unit Counter
  0017bcdc: 0c05ef74 jal 0x 0017bdd0 Check if Unit can be Targeted
+
  0017bcdc: 0c05ef74 jal 0x 0017bdd0 {{F/jal|Check_if_Unit_can_be_Targeted|Check_if_Unit_can_be_Targeted}}
 
  0017bce0: 27a50010 addiu r5,r29,0x0010 r5 = Stack Pointer
 
  0017bce0: 27a50010 addiu r5,r29,0x0010 r5 = Stack Pointer
 
  0017bce4: 1440001c bne r2,r0,0x 0017bd58 Branch if Unit Can't be targeted
 
  0017bce4: 1440001c bne r2,r0,0x 0017bd58 Branch if Unit Can't be targeted

Revision as of 21:00, 4 December 2021

Check Allies/Enemies that can be Targeted
0017bc78: 27bdffc0 addiu r29,r29,0xffc0
0017bc7c: afb5002c sw r21,0x002c(r29)
0017bc80: 00a0a821 addu r21,r5,r0		r21 = Can Hit Enemies Flag
0017bc84: afb60030 sw r22,0x0030(r29)
0017bc88: 00c0b021 addu r22,r6,r0		r22 = Can Hit Allies Flag
0017bc8c: afb70034 sw r23,0x0034(r29)
0017bc90: 00e0b821 addu r23,r7,r0		r23 = 255 AoE check
0017bc94: 308400ff andi r4,r4,0x00ff		r4 = Attacker/Self? ID
0017bc98: 000410c0 sll r2,r4,0x03		ID * 8
0017bc9c: 00441023 subu r2,r2,r4		ID * 7
0017bca0: 00021180 sll r2,r2,0x06		ID * 448
0017bca4: afb30024 sw r19,0x0024(r29)
0017bca8: 00809821 addu r19,r4,r0		r19 = Attacker/Self ID
0017bcac: afb00018 sw r16,0x0018(r29)
0017bcb0: 00008021 addu r16,r0,r0		Unit Counter = 0
0017bcb4: afb20020 sw r18,0x0020(r29)
0017bcb8: 34120001 ori r18,r0,0x0001		r18 = 1
0017bcbc: afb1001c sw r17,0x001c(r29)
0017bcc0: 00008821 addu r17,r0,r0		Pointer Mod = 0
0017bcc4: afbf0038 sw r31,0x0038(r29)
0017bcc8: afb40028 sw r20,0x0028(r29)
0017bccc: 3c018019 lui r1,0x8019
0017bcd0: 00220821 addu r1,r1,r2
0017bcd4: 903408d1 lbu r20,0x08d1(r1)		Load Unit's ENTD Flags
0017bcd8: 02002021 addu r4,r16,r0		r4 = Unit Counter
0017bcdc: 0c05ef74 jal 0x 0017bdd0		-->Check_if_Unit_can_be_Targeted
0017bce0: 27a50010 addiu r5,r29,0x0010		r5 = Stack Pointer
0017bce4: 1440001c bne r2,r0,0x 0017bd58		Branch if Unit Can't be targeted
0017bce8: 00000000 nop
0017bcec: 3c018019 lui r1,0x8019
0017bcf0: 00310821 addu r1,r1,r17
0017bcf4: 90220a86 lbu r2,0x0a86(r1)		Load Unit's Modified ENTD Flags
0017bcf8: 00000000 nop
0017bcfc: 02821026 xor r2,r20,r2
0017bd00: 16700002 bne r19,r16,0x 0017bd0c	Branch if Attacker/Self ID != Unit Counter 
0017bd04: 00402021 addu r4,r2,r0		Teams Different? = Differing ENTD Flags
0017bd08: 00002021 addu r4,r0,r0		Teams Different? = False
0017bd0c: 8fa30010 lw r3,0x0010(r29)		Load Tile ID
0017bd10: 00000000 nop
0017bd14: 00031080 sll r2,r3,0x02		ID * 4
0017bd18: 00431021 addu r2,r2,r3		ID * 5
0017bd1c: 3c038019 lui r3,0x8019
0017bd20: 24632dd8 addiu r3,r3,0x2dd8
0017bd24: 00431821 addu r3,r2,r3
0017bd28: 90620000 lbu r2,0x0000(r3)		Load Tile's AoE
0017bd2c: 00000000 nop
0017bd30: 10400009 beq r2,r0,0x 0017bd58		Branch if AoE = 0
0017bd34: 30820030 andi r2,r4,0x0030
0017bd38: 14400002 bne r2,r0,0x 0017bd44		Branch if Teams are different
0017bd3c: 32c200ff andi r2,r22,0x00ff		r2 = Can Hit Allies Flag
0017bd40: 32a200ff andi r2,r21,0x00ff		r2 = Can Hit Enemies Flag
0017bd44: 10400003 beq r2,r0,0x 0017bd54		Branch if Ability can't target this unit
0017bd48: 00000000 nop
0017bd4c: 0805ef56 j 0x 0017bd58
0017bd50: a0720001 sb r18,0x0001(r3)		Store Tile Targeted? = True
0017bd54: a0600000 sb r0,0x0000(r3)		Store Tile Targeted? = False
0017bd58: 26100001 addiu r16,r16,0x0001		Unit Counter ++
0017bd5c: 2a020015 slti r2,r16,0x0015
0017bd60: 1440ffdd bne r2,r0,0x 0017bcd8		Branch if Unit Counter < 0x15
0017bd64: 263101c0 addiu r17,r17,0x01c0		Pointer Mod += 0x1c0
0017bd68: 32e200ff andi r2,r23,0x00ff
0017bd6c: 1440000c bne r2,r0,0x 0017bda0		Branch if AoE = 255
0017bd70: 00008021 addu r16,r0,r0		Tile Counter = 0
0017bd74: 34040001 ori r4,r0,0x0001		Tile Targeted? = True
0017bd78: 3c038019 lui r3,0x8019
0017bd7c: 24632dd8 addiu r3,r3,0x2dd8
0017bd80: 90620000 lbu r2,0x0000(r3)		Load Tile's AoE
0017bd84: 00000000 nop
0017bd88: 10400002 beq r2,r0,0x 0017bd94		Branch if AoE = 0
0017bd8c: 26100001 addiu r16,r16,0x0001		Tile Counter ++
0017bd90: a0640001 sb r4,0x0001(r3)		Store Tile Targeted? = True
0017bd94: 2a020200 slti r2,r16,0x0200
0017bd98: 1440fff9 bne r2,r0,0x 0017bd80		Branch if Tile Counter < 0x200
0017bd9c: 24630005 addiu r3,r3,0x0005		Pointer += 5
0017bda0: 8fbf0038 lw r31,0x0038(r29)
0017bda4: 8fb70034 lw r23,0x0034(r29)
0017bda8: 8fb60030 lw r22,0x0030(r29)
0017bdac: 8fb5002c lw r21,0x002c(r29)
0017bdb0: 8fb40028 lw r20,0x0028(r29)
0017bdb4: 8fb30024 lw r19,0x0024(r29)
0017bdb8: 8fb20020 lw r18,0x0020(r29)
0017bdbc: 8fb1001c lw r17,0x001c(r29)
0017bdc0: 8fb00018 lw r16,0x0018(r29)
0017bdc4: 27bd0040 addiu r29,r29,0x0040
0017bdc8: 03e00008 jr r31
0017bdcc: 00000000 nop