Set or Remove Charging (00195f8c)

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search
set current ability CT/status change
00195f8c: 3c04801a lui r4,0x801a
00195f90: 8c840bbc lw r4,0x0bbc(r4)				r4 = Attacker Unit Data?
00195f94: 3c02801a lui r2,0x801a
00195f98: 90420d7b lbu r2,0x0d7b(r2)
00195f9c: 27bdffe0 addiu r29,r29,0xffe0
00195fa0: afb00010 sw r16,0x0010(r29)
00195fa4: 3c10801a lui r16,0x801a
00195fa8: 2610f3c4 addiu r16,r16,0xf3c4
00195fac: afbf0018 sw r31,0x0018(r29)
00195fb0: afb10014 sw r17,0x0014(r29)
00195fb4: 1040000a beq r2,r0,0x00195fe0
00195fb8: 2491016e addiu r17,r4,0x016e			r17 = Target Unit Data
00195fbc: 3c03801a lui r3,0x801a
00195fc0: 9063029a lbu r3,0x029a(r3)
00195fc4: 00000000 nop
00195fc8: 10600028 beq r3,r0,0x0019606c
00195fcc: 34020001 ori r2,r0,0x0001
00195fd0: 10620031 beq r3,r2,0x00196098
00195fd4: 00000000 nop
00195fd8: 08065849 j 0x00196124
00195fdc: 00000000 nop
00195fe0: 9083015d lbu r3,0x015d(r4)			Load Current Ability CT
00195fe4: 340200ff ori r2,r0,0x00ff
00195fe8: 10620066 beq r3,r2,0x00196184			Exit if Ability has no CT
00195fec: 00001021 addu r2,r0,r0
00195ff0: 9082016f lbu r2,0x016f(r4)			Load Skillset of Last Attack Used (of Target?)
00195ff4: 3c018006 lui r1,0x8006
00195ff8: 00220821 addu r1,r1,r2
00195ffc: 90235cb4 lbu r3,0x5cb4(r1)			Get Action Menu
00196000: 3402000a ori r2,r0,0x000a
00196004: 14620007 bne r3,r2,0x00196024			Branch if Charge
00196008: 00000000 nop
0019600c: 3c02801a lui r2,0x801a
00196010: 8c4201f4 lw r2,0x01f4(r2)				Load XY Coordinates
00196014: 3c01801a lui r1,0x801a
00196018: ac22f3dc sw r2,-0x0c24(r1)			Save to AI Acting Unit XY Coordinates
0019601c: 08065814 j 0x00196050
00196020: a2000014 sb r0,0x0014(r16)			IsTargetFlagsSet = False
00196024: 3c02801a lui r2,0x801a
00196028: 904201f1 lbu r2,0x01f1(r2)			
0019602c: 00000000 nop
00196030: 00021080 sll r2,r2,0x02
00196034: 00501021 addu r2,r2,r16
00196038: 8c420cc4 lw r2,0x0cc4(r2)
0019603c: 3c01801a lui r1,0x801a
00196040: ac22f3dc sw r2,-0x0c24(r1)			Save to AI Acting Unit XY Coordinates
00196044: 0c066ec8 jal 0x0019bb20
00196048: 00000000 nop
0019604c: a2000014 sb r0,0x0014(r16)			IsTargetFlagsSet = False
00196050: a200001d sb r0,0x001d(r16)			Empty Last Skillset Used
<Song/Dance>
00196054: 96220002 lhu r2,0x0002(r17)			Load Last Attack Used
00196058: 00000000 nop
0019605c: 2442ffaa addiu r2,r2,0xffaa			Attack ID - 56 (Song and Dance)
00196060: 2c42000e sltiu r2,r2,0x000e
00196064: 1040000c beq r2,r0,0x00196098			Branch if Ability is not a Song/Dance
00196068: 00000000 nop
0019606c: 0c0674c2 jal 0x0019d308				Check against and Set Highest Priority
00196070: 00000000 nop
00196074: 2403ffff addiu r3,r0,0xffff
00196078: 14430003 bne r2,r3,0x00196088			Branch because RNG said so
0019607c: 2402ffff addiu r2,r0,0xffff
00196080: 08065861 j 0x00196184					Exit and return -1
00196084: a2000ed6 sb r0,0x0ed6(r16)
00196088: 0c065bf1 jal 0x00196fc4				Check if ability is AI usable, AI coordinates match and Check/Set Priority
0019608c: 00000000 nop
00196090: 08065861 j 0x00196184					Exit and return 0
00196094: 00001021 addu r2,r0,r0
<Default Abilities>
00196098: 0c0674df jal 0x0019d37c				Set Unit Target Priority + other stuff
0019609c: 00000000 nop
001960a0: 2403ffff addiu r3,r0,0xffff
001960a4: 14430003 bne r2,r3,0x001960b4			Branch if RNG said no
001960a8: 260417fc addiu r4,r16,0x17fc
001960ac: 0806584f j 0x0019613c					Jump to jump to exit
001960b0: 34020001 ori r2,r0,0x0001
<Cancel Charge>
001960b4: 26050014 addiu r5,r16,0x0014
001960b8: 0c066ac2 jal 0x0019ab08				Transfer Halfword Values
001960bc: 34060020 ori r6,r0,0x0020
001960c0: 8e0217f8 lw r2,0x17f8(r16)
001960c4: 8e0317f8 lw r3,0x17f8(r16)
001960c8: 9042015d lbu r2,0x015d(r2)			Load Current Ability CT
001960cc: 00000000 nop
001960d0: a2020ed0 sb r2,0x0ed0(r16)			Save Current Ability CT to ?
001960d4: 90620058 lbu r2,0x0058(r3)			Load Current Status 1
001960d8: 8e0317f8 lw r3,0x17f8(r16)
001960dc: a2020ed1 sb r2,0x0ed1(r16)			Save Current Status to ?
001960e0: 906201bb lbu r2,0x01bb(r3)			Load Inflict Status 1
001960e4: 8e0317f8 lw r3,0x17f8(r16)
001960e8: a2020ed2 sb r2,0x0ed2(r16)			Save Inflict Status 1 to ?
001960ec: 340200ff ori r2,r0,0x00ff
001960f0: a062015d sb r2,0x015d(r3)				Charging abiilty = false
001960f4: 8e0317f8 lw r3,0x17f8(r16)
001960f8: 00000000 nop
001960fc: 90620058 lbu r2,0x0058(r3)			Load Current Status 1
00196100: 00000000 nop
00196104: 304200f6 andi r2,r2,0x00f6
00196108: a0620058 sb r2,0x0058(r3)				Remove Charging
0019610c: 8e0317f8 lw r3,0x17f8(r16)
00196110: 00000000 nop
00196114: 906201bb lbu r2,0x01bb(r3)			Load Inflict Status
00196118: 00000000 nop
0019611c: 304200f6 andi r2,r2,0x00f6
00196120: a06201bb sb r2,0x01bb(r3)				Remove Charging from Inflicted Status
00196124: 0c0674df jal 0x0019d37c				Set Unit Target Priority/Accuracy/etc
00196128: 00000000 nop
0019612c: 2403ffff addiu r3,r0,0xffff
00196130: 14430005 bne r2,r3,0x00196148			Branch if RNG said so
00196134: 26041818 addiu r4,r16,0x1818
00196138: 34020002 ori r2,r0,0x0002
0019613c: a2020ed6 sb r2,0x0ed6(r16)			Save AI Progress as 2?
00196140: 08065861 j 0x00196184					Exit and return -1
00196144: 2402ffff addiu r2,r0,0xffff
<Set Charging>
00196148: 8e0317f8 lw r3,0x17f8(r16)			Load Acting Unit's Data Pointer
0019614c: 92020ed0 lbu r2,0x0ed0(r16)			Current abiliity CT
00196150: 00000000 nop
00196154: a062015d sb r2,0x015d(r3)				Save Current Ability CT
00196158: 8e0317f8 lw r3,0x17f8(r16)			Load Acting Unit's Data Pointer
0019615c: 92020ed1 lbu r2,0x0ed1(r16)			Load Current Status
00196160: 00000000 nop
00196164: a0620058 sb r2,0x0058(r3)				Save Current Status
00196168: 8e0317f8 lw r3,0x17f8(r16)			Load Acting Unit's Data Pointer
0019616c: 92020ed2 lbu r2,0x0ed2(r16)			Load inflicted status 1
00196170: 26050030 addiu r5,r16,0x0030
00196174: 0c065b6c jal 0x00196db0				Compare Current Target Priority/Accuracy to the Highest
00196178: a06201bb sb r2,0x01bb(r3)				Save Inflicted Status 1
0019617c: 38420002 xori r2,r2,0x0002			Remove or add "Lower priority" flag
00196180: 2c420001 sltiu r2,r2,0x0001			1 if lower priority, 0 for all other cases
00196184: 8fbf0018 lw r31,0x0018(r29)
00196188: 8fb10014 lw r17,0x0014(r29)
0019618c: 8fb00010 lw r16,0x0010(r29)
00196190: 27bd0020 addiu r29,r29,0x0020
00196194: 03e00008 jr r31
00196198: 00000000 nop