Difference between revisions of "Evaluate Cancel Status Ability (0019881c)"

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search
m (Dokurider moved page 0019881c - 00198b00 to Evaluate Cancel Status Ability (0019881c): Renaming and adding new documentation)
 
Line 1: Line 1:
<font face='Courier New'>
+
Evaluate Cancel Status Ability
   
+
 
 +
Returns:
 +
-1 = Chose an Cure Ability
 +
  0 = No ability usable
 +
1 = Requires more evaluation
 +
2 = 0x0071 = True
 +
 
 
  0019881c: 27bdffe0 addiu r29,r29,0xffe0
 
  0019881c: 27bdffe0 addiu r29,r29,0xffe0
  00198820: 00803021 addu r6,r4,r0
+
  00198820: 00803021 addu r6,r4,r0 r6 = Unit ID
 
  00198824: afb10014 sw r17,0x0014(r29)
 
  00198824: afb10014 sw r17,0x0014(r29)
  00198828: 00a08821 addu r17,r5,r0
+
  00198828: 00a08821 addu r17,r5,r0 r17 = Status ID
 
  0019882c: afb00010 sw r16,0x0010(r29)
 
  0019882c: afb00010 sw r16,0x0010(r29)
 
  00198830: 3c10801a lui r16,0x801a
 
  00198830: 3c10801a lui r16,0x801a
  00198834: 2610f3c4 addiu r16,r16,0xf3c4
+
  00198834: 2610f3c4 addiu r16,r16,0xf3c4 r16 = Unit AI Data
 
  00198838: 000610c0 sll r2,r6,0x03
 
  00198838: 000610c0 sll r2,r6,0x03
 
  0019883c: 00461023 subu r2,r2,r6
 
  0019883c: 00461023 subu r2,r2,r6
 
  00198840: 00021180 sll r2,r2,0x06
 
  00198840: 00021180 sll r2,r2,0x06
 
  00198844: 3c04801a lui r4,0x801a
 
  00198844: 3c04801a lui r4,0x801a
  00198848: 90840d7b lbu r4,0x0d7b(r4)
+
  00198848: 90840d7b lbu r4,0x0d7b(r4) Load Target Flags Set
 
  0019884c: 3c038019 lui r3,0x8019
 
  0019884c: 3c038019 lui r3,0x8019
  00198850: 246308cc addiu r3,r3,0x08cc
+
  00198850: 246308cc addiu r3,r3,0x08cc r3 = Unit Data Pointer
 
  00198854: afb20018 sw r18,0x0018(r29)
 
  00198854: afb20018 sw r18,0x0018(r29)
  00198858: 00439021 addu r18,r2,r3
+
  00198858: 00439021 addu r18,r2,r3 Load Unit Data Pointer
  0019885c: 14800077 bne r4,r0,0x00198a3c
+
  0019885c: 14800077 bne r4,r0,0x00198a3c <Choose Ability> if Target Flags Set
 
  00198860: afbf001c sw r31,0x001c(r29)
 
  00198860: afbf001c sw r31,0x001c(r29)
 +
 
  00198864: 00061100 sll r2,r6,0x04
 
  00198864: 00061100 sll r2,r6,0x04
 
  00198868: 2442182c addiu r2,r2,0x182c
 
  00198868: 2442182c addiu r2,r2,0x182c
  0019886c: 00501821 addu r3,r2,r16
+
  0019886c: 00501821 addu r3,r2,r16 r3 = AI Targeting
 
  00198870: 34020008 ori r2,r0,0x0008
 
  00198870: 34020008 ori r2,r0,0x0008
 
  00198874: 3c01801a lui r1,0x801a
 
  00198874: 3c01801a lui r1,0x801a
Line 29: Line 36:
 
  00198884: 3c01801a lui r1,0x801a
 
  00198884: 3c01801a lui r1,0x801a
 
  00198888: ac20f38c sw r0,-0x0c74(r1)
 
  00198888: ac20f38c sw r0,-0x0c74(r1)
  0019888c: 12220010 beq r17,r2,0x001988d0
+
  0019888c: 12220010 beq r17,r2,0x001988d0 <Petrify> if Petrified
 
  00198890: 00000000 nop
 
  00198890: 00000000 nop
 +
 +
<Petrify and lower>
 
  00198894: 2a220009 slti r2,r17,0x0009
 
  00198894: 2a220009 slti r2,r17,0x0009
  00198898: 10400005 beq r2,r0,0x001988b0
+
  00198898: 10400005 beq r2,r0,0x001988b0 <Invite+> if Status = Invite or greater
 
  0019889c: 34020002 ori r2,r0,0x0002
 
  0019889c: 34020002 ori r2,r0,0x0002
  001988a0: 12220008 beq r17,r2,0x001988c4
+
  001988a0: 12220008 beq r17,r2,0x001988c4 Branch if Dead
  001988a4: 34040003 ori r4,r0,0x0003
+
  001988a4: 34040003 ori r4,r0,0x0003 Find Specific Target
  001988a8: 0806623e j 0x001988f8
+
  001988a8: 0806623e j 0x001988f8 <Find Target Unit>
 
  001988ac: 00000000 nop
 
  001988ac: 00000000 nop
 +
 +
<Invite and higher>
 
  001988b0: 3402000d ori r2,r0,0x000d
 
  001988b0: 3402000d ori r2,r0,0x000d
  001988b4: 12220009 beq r17,r2,0x001988dc
+
  001988b4: 12220009 beq r17,r2,0x001988dc Branch if Blood Suck
  001988b8: 34040003 ori r4,r0,0x0003
+
 
  001988bc: 0806623e j 0x001988f8
+
  001988b8: 34040003 ori r4,r0,0x0003 Find Specific Target
 +
  001988bc: 0806623e j 0x001988f8 <Find Target Unit>
 
  001988c0: 00000000 nop
 
  001988c0: 00000000 nop
  001988c4: 90620004 lbu r2,0x0004(r3)
+
 
  001988c8: 0806623a j 0x001988e8
+
<Dead>
 +
  001988c4: 90620004 lbu r2,0x0004(r3) Load AI Targeting Flags
 +
  001988c8: 0806623a j 0x001988e8 Branch if Unit needs to be revived
 
  001988cc: 30420001 andi r2,r2,0x0001
 
  001988cc: 30420001 andi r2,r2,0x0001
  001988d0: 90620004 lbu r2,0x0004(r3)
+
 
  001988d4: 0806623a j 0x001988e8
+
<Petrify>
 +
  001988d0: 90620004 lbu r2,0x0004(r3) Load AI Targeting Flags
 +
  001988d4: 0806623a j 0x001988e8 Branch if Unit needs to be Unpetrified
 
  001988d8: 30420002 andi r2,r2,0x0002
 
  001988d8: 30420002 andi r2,r2,0x0002
  001988dc: 90620004 lbu r2,0x0004(r3)
+
 
 +
<Blood Suck>
 +
  001988dc: 90620004 lbu r2,0x0004(r3) Load AI Targeting Flags
 
  001988e0: 00000000 nop
 
  001988e0: 00000000 nop
 
  001988e4: 30420004 andi r2,r2,0x0004
 
  001988e4: 30420004 andi r2,r2,0x0004
  001988e8: 14400003 bne r2,r0,0x001988f8
+
  001988e8: 14400003 bne r2,r0,0x001988f8 <Find Target Unit> if Unit is Jumping???
  001988ec: 34040003 ori r4,r0,0x0003
+
  001988ec: 34040003 ori r4,r0,0x0003 Find Specific Target
  001988f0: 080662ba j 0x00198ae8
+
  001988f0: 080662ba j 0x00198ae8 Exit and return 1
  001988f4: 34020001 ori r2,r0,0x0001
+
  001988f4: 34020001 ori r2,r0,0x0001
  001988f8: 0c065f43 jal 0x00197d0c
+
 
  001988fc: 00c02821 addu r5,r6,r0
+
<Find Target Unit>
  00198900: 1040005c beq r2,r0,0x00198a74
+
  001988f8: 0c065f43 jal 0x00197d0c Find Active Unit
 +
  001988fc: 00c02821 addu r5,r6,r0 Look for Unit ID
 +
  00198900: 1040005c beq r2,r0,0x00198a74 Branch if Unit not Active
 
  00198904: 00000000 nop
 
  00198904: 00000000 nop
  00198908: a2000cbd sb r0,0x0cbd(r16)
+
  00198908: a2000cbd sb r0,0x0cbd(r16) Initialize Ability Counter
  0019890c: 92030e2f lbu r3,0x0e2f(r16)
+
 
 +
<Choose Ability>
 +
  0019890c: 92030e2f lbu r3,0x0e2f(r16) Load Acting Unit ID?
 
  00198910: 00000000 nop
 
  00198910: 00000000 nop
  00198914: 00031100 sll r2,r3,0x04
+
  00198914: 00031100 sll r2,r3,0x04 ID * 10
  00198918: 00431021 addu r2,r2,r3
+
  00198918: 00431021 addu r2,r2,r3 ID * 11
  0019891c: 000210c0 sll r2,r2,0x03
+
  0019891c: 000210c0 sll r2,r2,0x03 ID * 88
  00198920: 24420ef0 addiu r2,r2,0x0ef0
+
  00198920: 24420ef0 addiu r2,r2,0x0ef0
  00198924: 92030cbd lbu r3,0x0cbd(r16)
+
  00198924: 92030cbd lbu r3,0x0cbd(r16) Load Ability Counter
  00198928: 02021021 addu r2,r16,r2
+
  00198928: 02021021 addu r2,r16,r2 Point to Unit Abiilty List
  0019892c: 00031880 sll r3,r3,0x02
+
  0019892c: 00031880 sll r3,r3,0x02 ? * 4
 
  00198930: 00432021 addu r4,r2,r3
 
  00198930: 00432021 addu r4,r2,r3
  00198934: 90830002 lbu r3,0x0002(r4)
+
  00198934: 90830002 lbu r3,0x0002(r4) Load Ability List ID
 
  00198938: 340200ff ori r2,r0,0x00ff
 
  00198938: 340200ff ori r2,r0,0x00ff
  0019893c: 1062004d beq r3,r2,0x00198a74
+
  0019893c: 1062004d beq r3,r2,0x00198a74 Break out of loop if End of List
 
  00198940: 00000000 nop
 
  00198940: 00000000 nop
  00198944: 0c06561e jal 0x00195878
+
  00198944: 0c06561e jal 0x00195878 AI Ability Data Setting
 
  00198948: 00000000 nop
 
  00198948: 00000000 nop
  0019894c: 8e05000c lw r5,0x000c(r16)
+
  0019894c: 8e05000c lw r5,0x000c(r16) Load AI Behavior Flags
 
  00198950: 00000000 nop
 
  00198950: 00000000 nop
 
  00198954: 30a20020 andi r2,r5,0x0020
 
  00198954: 30a20020 andi r2,r5,0x0020
  00198958: 1040003d beq r2,r0,0x00198a50
+
  00198958: 1040003d beq r2,r0,0x00198a50 <Ability++> if Ability doesn't cancel status
 
  0019895c: 00000000 nop
 
  0019895c: 00000000 nop
  00198960: 06210002 bgez r17,0x0019896c
+
  00198960: 06210002 bgez r17,0x0019896c Branch if Status ID is not 0
 
  00198964: 02201821 addu r3,r17,r0
 
  00198964: 02201821 addu r3,r17,r0
  00198968: 26230007 addiu r3,r17,0x0007
+
  00198968: 26230007 addiu r3,r17,0x0007 Default Status 00 to Performing???
 
  0019896c: 000318c3 sra r3,r3,0x03
 
  0019896c: 000318c3 sra r3,r3,0x03
 
  00198970: 02031021 addu r2,r16,r3
 
  00198970: 02031021 addu r2,r16,r3
Line 93: Line 115:
 
  00198984: 00621007 srav r2,r2,r3
 
  00198984: 00621007 srav r2,r2,r3
 
  00198988: 00822024 and r4,r4,r2
 
  00198988: 00822024 and r4,r4,r2
  0019898c: 10800030 beq r4,r0,0x00198a50
+
  0019898c: 10800030 beq r4,r0,0x00198a50 <Ability++> if Status is not present
 +
 
 +
<Faith>
 
  00198990: 30a20400 andi r2,r5,0x0400
 
  00198990: 30a20400 andi r2,r5,0x0400
  00198994: 10400006 beq r2,r0,0x001989b0
+
  00198994: 10400006 beq r2,r0,0x001989b0 Branch if Ability uses Faith
 
  00198998: 30a24000 andi r2,r5,0x4000
 
  00198998: 30a24000 andi r2,r5,0x4000
  0019899c: 92420052 lbu r2,0x0052(r18)
+
  0019899c: 92420052 lbu r2,0x0052(r18) Load Innate Status 5
 
  001989a0: 00000000 nop
 
  001989a0: 00000000 nop
 
  001989a4: 30420040 andi r2,r2,0x0040
 
  001989a4: 30420040 andi r2,r2,0x0040
  001989a8: 14400029 bne r2,r0,0x00198a50
+
  001989a8: 14400029 bne r2,r0,0x00198a50 <Ability++> if Unit is Innate Innocent
 +
 
 +
<Reflect>
 
  001989ac: 30a24000 andi r2,r5,0x4000
 
  001989ac: 30a24000 andi r2,r5,0x4000
  001989b0: 10400006 beq r2,r0,0x001989cc
+
  001989b0: 10400006 beq r2,r0,0x001989cc Branch if Ability is Reflectable
 
  001989b4: 30a20100 andi r2,r5,0x0100
 
  001989b4: 30a20100 andi r2,r5,0x0100
  001989b8: 92420052 lbu r2,0x0052(r18)
+
  001989b8: 92420052 lbu r2,0x0052(r18) Load Innate Status 5
 
  001989bc: 00000000 nop
 
  001989bc: 00000000 nop
 
  001989c0: 30420002 andi r2,r2,0x0002
 
  001989c0: 30420002 andi r2,r2,0x0002
  001989c4: 14400022 bne r2,r0,0x00198a50
+
  001989c4: 14400022 bne r2,r0,0x00198a50 <Ability++> if Unit is Innate Reflect
 +
 
 +
<Silence>
 
  001989c8: 30a20100 andi r2,r5,0x0100
 
  001989c8: 30a20100 andi r2,r5,0x0100
  001989cc: 10400008 beq r2,r0,0x001989f0
+
  001989cc: 10400008 beq r2,r0,0x001989f0 Branch if Ability is Not Silenceable
 
  001989d0: 00000000 nop
 
  001989d0: 00000000 nop
  001989d4: 8e0217f8 lw r2,0x17f8(r16)
+
  001989d4: 8e0217f8 lw r2,0x17f8(r16) Acting Unit's Data Pointer
 
  001989d8: 00000000 nop
 
  001989d8: 00000000 nop
  001989dc: 90420059 lbu r2,0x0059(r2)
+
  001989dc: 90420059 lbu r2,0x0059(r2) Load Current Status 2
 
  001989e0: 00000000 nop
 
  001989e0: 00000000 nop
 
  001989e4: 30420008 andi r2,r2,0x0008
 
  001989e4: 30420008 andi r2,r2,0x0008
  001989e8: 14400019 bne r2,r0,0x00198a50
+
  001989e8: 14400019 bne r2,r0,0x00198a50 <Ability++> if Unit is Silenced
 
  001989ec: 00000000 nop
 
  001989ec: 00000000 nop
  001989f0: 8e0217f8 lw r2,0x17f8(r16)
+
 
  001989f4: 92030011 lbu r3,0x0011(r16)
+
<MP Cost>
  001989f8: 9442002c lhu r2,0x002c(r2)
+
  001989f0: 8e0217f8 lw r2,0x17f8(r16) Acting Unit's Data Pointer
 +
  001989f4: 92030011 lbu r3,0x0011(r16) r3 = MP Cost
 +
  001989f8: 9442002c lhu r2,0x002c(r2) Load CurMP
 
  001989fc: 00000000 nop
 
  001989fc: 00000000 nop
 
  00198a00: 0043102b sltu r2,r2,r3
 
  00198a00: 0043102b sltu r2,r2,r3
  00198a04: 10400005 beq r2,r0,0x00198a1c
+
  00198a04: 10400005 beq r2,r0,0x00198a1c <Choose Ability> if Unit has enough MP to cast Ability
 
  00198a08: 34020001 ori r2,r0,0x0001
 
  00198a08: 34020001 ori r2,r0,0x0001
 
  00198a0c: 3c01801a lui r1,0x801a
 
  00198a0c: 3c01801a lui r1,0x801a
  00198a10: ac22f388 sw r2,-0x0c78(r1)
+
  00198a10: ac22f388 sw r2,-0x0c78(r1) Not enough MP = True?
 
  00198a14: 08066289 j 0x00198a24
 
  00198a14: 08066289 j 0x00198a24
 
  00198a18: 00000000 nop
 
  00198a18: 00000000 nop
 +
 +
<Choose Ability>
 
  00198a1c: 3c01801a lui r1,0x801a
 
  00198a1c: 3c01801a lui r1,0x801a
  00198a20: ac22f38c sw r2,-0x0c74(r1)
+
  00198a20: ac22f38c sw r2,-0x0c74(r1) Ability can be cast?
 
  00198a24: 3c02801a lui r2,0x801a
 
  00198a24: 3c02801a lui r2,0x801a
  00198a28: 8c42f384 lw r2,-0x0c7c(r2)
+
  00198a28: 8c42f384 lw r2,-0x0c7c(r2) Usable Ability Counter
 
  00198a2c: 00000000 nop
 
  00198a2c: 00000000 nop
 
  00198a30: 24420001 addiu r2,r2,0x0001
 
  00198a30: 24420001 addiu r2,r2,0x0001
 
  00198a34: 3c01801a lui r1,0x801a
 
  00198a34: 3c01801a lui r1,0x801a
  00198a38: ac22f384 sw r2,-0x0c7c(r1)
+
  00198a38: ac22f384 sw r2,-0x0c7c(r1) Usable Ability Counter++
  00198a3c: 0c066bc6 jal 0x0019af18
+
  00198a3c: 0c066bc6 jal 0x0019af18 Decide to Use Ability
 
  00198a40: 00000000 nop
 
  00198a40: 00000000 nop
 
  00198a44: 2403ffff addiu r3,r0,0xffff
 
  00198a44: 2403ffff addiu r3,r0,0xffff
  00198a48: 10430027 beq r2,r3,0x00198ae8
+
  00198a48: 10430027 beq r2,r3,0x00198ae8 Exit and Return -1 if Ability was chosen
 
  00198a4c: 2402ffff addiu r2,r0,0xffff
 
  00198a4c: 2402ffff addiu r2,r0,0xffff
  00198a50: 92020cbd lbu r2,0x0cbd(r16)
+
 
 +
<Ability++>
 +
  00198a50: 92020cbd lbu r2,0x0cbd(r16) Load Ability Counter
 
  00198a54: 00000000 nop
 
  00198a54: 00000000 nop
 
  00198a58: 24420001 addiu r2,r2,0x0001
 
  00198a58: 24420001 addiu r2,r2,0x0001
  00198a5c: a2020cbd sb r2,0x0cbd(r16)
+
  00198a5c: a2020cbd sb r2,0x0cbd(r16) Ability Counter++
 
  00198a60: 92020cbd lbu r2,0x0cbd(r16)
 
  00198a60: 92020cbd lbu r2,0x0cbd(r16)
 
  00198a64: 00000000 nop
 
  00198a64: 00000000 nop
 
  00198a68: 2c420022 sltiu r2,r2,0x0022
 
  00198a68: 2c420022 sltiu r2,r2,0x0022
  00198a6c: 1440ffa7 bne r2,r0,0x0019890c
+
  00198a6c: 1440ffa7 bne r2,r0,0x0019890c Do for all abilities
 
  00198a70: 00000000 nop
 
  00198a70: 00000000 nop
  00198a74: 92020071 lbu r2,0x0071(r16)
+
 
 +
<No Ability was choosen>
 +
  00198a74: 92020071 lbu r2,0x0071(r16) Load ?
 
  00198a78: 00000000 nop
 
  00198a78: 00000000 nop
  00198a7c: 10400006 beq r2,r0,0x00198a98
+
  00198a7c: 10400006 beq r2,r0,0x00198a98 Branch if ? = False
 
  00198a80: 260417fc addiu r4,r16,0x17fc
 
  00198a80: 260417fc addiu r4,r16,0x17fc
 
  00198a84: 26050054 addiu r5,r16,0x0054
 
  00198a84: 26050054 addiu r5,r16,0x0054
  00198a88: 0c066ac2 jal 0x0019ab08
+
  00198a88: 0c066ac2 jal 0x0019ab08 Transfer Half Word Values
 
  00198a8c: 34060020 ori r6,r0,0x0020
 
  00198a8c: 34060020 ori r6,r0,0x0020
  00198a90: 080662ba j 0x00198ae8
+
  00198a90: 080662ba j 0x00198ae8 Exit and return 2
 
  00198a94: 34020002 ori r2,r0,0x0002
 
  00198a94: 34020002 ori r2,r0,0x0002
 +
 +
<Any Ability Usable?>
 
  00198a98: 3c02801a lui r2,0x801a
 
  00198a98: 3c02801a lui r2,0x801a
  00198a9c: 8c42f384 lw r2,-0x0c7c(r2)
+
  00198a9c: 8c42f384 lw r2,-0x0c7c(r2) Load Usable Ability Counter
 
  00198aa0: 00000000 nop
 
  00198aa0: 00000000 nop
  00198aa4: 14400003 bne r2,r0,0x00198ab4
+
  00198aa4: 14400003 bne r2,r0,0x00198ab4 Branch if any ability was usable
 
  00198aa8: 00000000 nop
 
  00198aa8: 00000000 nop
  00198aac: 080662ba j 0x00198ae8
+
  00198aac: 080662ba j 0x00198ae8 Exit and return 0
 
  00198ab0: 00001021 addu r2,r0,r0
 
  00198ab0: 00001021 addu r2,r0,r0
 +
 
  00198ab4: 3c03801a lui r3,0x801a
 
  00198ab4: 3c03801a lui r3,0x801a
  00198ab8: 8c63f388 lw r3,-0x0c78(r3)
+
  00198ab8: 8c63f388 lw r3,-0x0c78(r3)
 
  00198abc: 00000000 nop
 
  00198abc: 00000000 nop
  00198ac0: 10600009 beq r3,r0,0x00198ae8
+
  00198ac0: 10600009 beq r3,r0,0x00198ae8 Exit and return 1 if Unit has enough MP to cast spell?
 
  00198ac4: 34020001 ori r2,r0,0x0001
 
  00198ac4: 34020001 ori r2,r0,0x0001
  00198ac8: 92030cbe lbu r3,0x0cbe(r16)
+
  00198ac8: 92030cbe lbu r3,0x0cbe(r16) Load ?
 
  00198acc: 00000000 nop
 
  00198acc: 00000000 nop
  00198ad0: 14600005 bne r3,r0,0x00198ae8
+
  00198ad0: 14600005 bne r3,r0,0x00198ae8 Exit and Return 1 if true
 
  00198ad4: 00000000 nop
 
  00198ad4: 00000000 nop
 
  00198ad8: 3c02801a lui r2,0x801a
 
  00198ad8: 3c02801a lui r2,0x801a
  00198adc: 8c42f38c lw r2,-0x0c74(r2)
+
  00198adc: 8c42f38c lw r2,-0x0c74(r2) Ability can be cast?
 
  00198ae0: 00000000 nop
 
  00198ae0: 00000000 nop
  00198ae4: 0002102b sltu r2,r0,r2
+
  00198ae4: 0002102b sltu r2,r0,r2 Return 0 if any Ability can be cast
 +
 
 
  00198ae8: 8fbf001c lw r31,0x001c(r29)
 
  00198ae8: 8fbf001c lw r31,0x001c(r29)
 
  00198aec: 8fb20018 lw r18,0x0018(r29)
 
  00198aec: 8fb20018 lw r18,0x0018(r29)
Line 187: Line 227:
 
  00198afc: 03e00008 jr r31
 
  00198afc: 03e00008 jr r31
 
  00198b00: 00000000 nop
 
  00198b00: 00000000 nop
</font>
 

Latest revision as of 00:36, 9 March 2017

Evaluate Cancel Status Ability
Returns:
-1 = Chose an Cure Ability
0 = No ability usable
1 = Requires more evaluation
2 = 0x0071 = True
0019881c: 27bdffe0 addiu r29,r29,0xffe0
00198820: 00803021 addu r6,r4,r0					r6 = Unit ID
00198824: afb10014 sw r17,0x0014(r29)
00198828: 00a08821 addu r17,r5,r0					r17 = Status ID
0019882c: afb00010 sw r16,0x0010(r29)
00198830: 3c10801a lui r16,0x801a
00198834: 2610f3c4 addiu r16,r16,0xf3c4				r16 = Unit AI Data
00198838: 000610c0 sll r2,r6,0x03
0019883c: 00461023 subu r2,r2,r6
00198840: 00021180 sll r2,r2,0x06
00198844: 3c04801a lui r4,0x801a
00198848: 90840d7b lbu r4,0x0d7b(r4)				Load Target Flags Set
0019884c: 3c038019 lui r3,0x8019
00198850: 246308cc addiu r3,r3,0x08cc				r3 = Unit Data Pointer
00198854: afb20018 sw r18,0x0018(r29)
00198858: 00439021 addu r18,r2,r3					Load Unit Data Pointer
0019885c: 14800077 bne r4,r0,0x00198a3c				<Choose Ability> if Target Flags Set
00198860: afbf001c sw r31,0x001c(r29)
00198864: 00061100 sll r2,r6,0x04
00198868: 2442182c addiu r2,r2,0x182c
0019886c: 00501821 addu r3,r2,r16					r3 = AI Targeting
00198870: 34020008 ori r2,r0,0x0008
00198874: 3c01801a lui r1,0x801a
00198878: ac20f384 sw r0,-0x0c7c(r1)
0019887c: 3c01801a lui r1,0x801a
00198880: ac20f388 sw r0,-0x0c78(r1)
00198884: 3c01801a lui r1,0x801a
00198888: ac20f38c sw r0,-0x0c74(r1)
0019888c: 12220010 beq r17,r2,0x001988d0			<Petrify> if Petrified
00198890: 00000000 nop
<Petrify and lower>
00198894: 2a220009 slti r2,r17,0x0009
00198898: 10400005 beq r2,r0,0x001988b0				<Invite+> if Status = Invite or greater
0019889c: 34020002 ori r2,r0,0x0002
001988a0: 12220008 beq r17,r2,0x001988c4			Branch if Dead
001988a4: 34040003 ori r4,r0,0x0003					Find Specific Target
001988a8: 0806623e j 0x001988f8						<Find Target Unit>
001988ac: 00000000 nop
<Invite and higher>
001988b0: 3402000d ori r2,r0,0x000d
001988b4: 12220009 beq r17,r2,0x001988dc			Branch if Blood Suck
001988b8: 34040003 ori r4,r0,0x0003					Find Specific Target
001988bc: 0806623e j 0x001988f8						<Find Target Unit>
001988c0: 00000000 nop
<Dead>
001988c4: 90620004 lbu r2,0x0004(r3)				Load AI Targeting Flags
001988c8: 0806623a j 0x001988e8						Branch if Unit needs to be revived
001988cc: 30420001 andi r2,r2,0x0001
<Petrify>
001988d0: 90620004 lbu r2,0x0004(r3)				Load AI Targeting Flags
001988d4: 0806623a j 0x001988e8						Branch if Unit needs to be Unpetrified
001988d8: 30420002 andi r2,r2,0x0002
<Blood Suck>
001988dc: 90620004 lbu r2,0x0004(r3)				Load AI Targeting Flags
001988e0: 00000000 nop
001988e4: 30420004 andi r2,r2,0x0004
001988e8: 14400003 bne r2,r0,0x001988f8				<Find Target Unit> if Unit is Jumping???
001988ec: 34040003 ori r4,r0,0x0003					Find Specific Target
001988f0: 080662ba j 0x00198ae8						Exit and return 1				
001988f4: 34020001 ori r2,r0,0x0001					
<Find Target Unit>
001988f8: 0c065f43 jal 0x00197d0c					Find Active Unit
001988fc: 00c02821 addu r5,r6,r0					Look for Unit ID
00198900: 1040005c beq r2,r0,0x00198a74				Branch if Unit not Active
00198904: 00000000 nop
00198908: a2000cbd sb r0,0x0cbd(r16)				Initialize Ability Counter
<Choose Ability>
0019890c: 92030e2f lbu r3,0x0e2f(r16)				Load Acting Unit ID?
00198910: 00000000 nop
00198914: 00031100 sll r2,r3,0x04					ID * 10
00198918: 00431021 addu r2,r2,r3					ID * 11
0019891c: 000210c0 sll r2,r2,0x03					ID * 88
00198920: 24420ef0 addiu r2,r2,0x0ef0				
00198924: 92030cbd lbu r3,0x0cbd(r16)				Load Ability Counter
00198928: 02021021 addu r2,r16,r2					Point to Unit Abiilty List
0019892c: 00031880 sll r3,r3,0x02					? * 4
00198930: 00432021 addu r4,r2,r3
00198934: 90830002 lbu r3,0x0002(r4)				Load Ability List ID
00198938: 340200ff ori r2,r0,0x00ff
0019893c: 1062004d beq r3,r2,0x00198a74				Break out of loop if End of List
00198940: 00000000 nop
00198944: 0c06561e jal 0x00195878					AI Ability Data Setting
00198948: 00000000 nop
0019894c: 8e05000c lw r5,0x000c(r16)				Load AI Behavior Flags
00198950: 00000000 nop
00198954: 30a20020 andi r2,r5,0x0020
00198958: 1040003d beq r2,r0,0x00198a50				<Ability++> if Ability doesn't cancel status
0019895c: 00000000 nop
00198960: 06210002 bgez r17,0x0019896c				Branch if Status ID is not 0
00198964: 02201821 addu r3,r17,r0
00198968: 26230007 addiu r3,r17,0x0007				Default Status 00 to Performing???
0019896c: 000318c3 sra r3,r3,0x03
00198970: 02031021 addu r2,r16,r3
00198974: 90440007 lbu r4,0x0007(r2)
00198978: 000318c0 sll r3,r3,0x03
0019897c: 02231823 subu r3,r17,r3
00198980: 34020080 ori r2,r0,0x0080
00198984: 00621007 srav r2,r2,r3
00198988: 00822024 and r4,r4,r2
0019898c: 10800030 beq r4,r0,0x00198a50				<Ability++> if Status is not present
<Faith>
00198990: 30a20400 andi r2,r5,0x0400
00198994: 10400006 beq r2,r0,0x001989b0				Branch if Ability uses Faith
00198998: 30a24000 andi r2,r5,0x4000
0019899c: 92420052 lbu r2,0x0052(r18)				Load Innate Status 5
001989a0: 00000000 nop
001989a4: 30420040 andi r2,r2,0x0040
001989a8: 14400029 bne r2,r0,0x00198a50				<Ability++> if Unit is Innate Innocent	
<Reflect>
001989ac: 30a24000 andi r2,r5,0x4000
001989b0: 10400006 beq r2,r0,0x001989cc				Branch if Ability is Reflectable
001989b4: 30a20100 andi r2,r5,0x0100
001989b8: 92420052 lbu r2,0x0052(r18)				Load Innate Status 5
001989bc: 00000000 nop
001989c0: 30420002 andi r2,r2,0x0002
001989c4: 14400022 bne r2,r0,0x00198a50				<Ability++> if Unit is Innate Reflect
<Silence>
001989c8: 30a20100 andi r2,r5,0x0100
001989cc: 10400008 beq r2,r0,0x001989f0				Branch if Ability is Not Silenceable
001989d0: 00000000 nop
001989d4: 8e0217f8 lw r2,0x17f8(r16)				Acting Unit's Data Pointer
001989d8: 00000000 nop
001989dc: 90420059 lbu r2,0x0059(r2)				Load Current Status 2
001989e0: 00000000 nop
001989e4: 30420008 andi r2,r2,0x0008
001989e8: 14400019 bne r2,r0,0x00198a50				<Ability++> if Unit is Silenced
001989ec: 00000000 nop
<MP Cost>
001989f0: 8e0217f8 lw r2,0x17f8(r16)				Acting Unit's Data Pointer
001989f4: 92030011 lbu r3,0x0011(r16)				r3 = MP Cost
001989f8: 9442002c lhu r2,0x002c(r2)				Load CurMP
001989fc: 00000000 nop
00198a00: 0043102b sltu r2,r2,r3
00198a04: 10400005 beq r2,r0,0x00198a1c				<Choose Ability> if Unit has enough MP to cast Ability
00198a08: 34020001 ori r2,r0,0x0001
00198a0c: 3c01801a lui r1,0x801a
00198a10: ac22f388 sw r2,-0x0c78(r1)				Not enough MP = True?
00198a14: 08066289 j 0x00198a24
00198a18: 00000000 nop
<Choose Ability>
00198a1c: 3c01801a lui r1,0x801a
00198a20: ac22f38c sw r2,-0x0c74(r1)				Ability can be cast?
00198a24: 3c02801a lui r2,0x801a
00198a28: 8c42f384 lw r2,-0x0c7c(r2)				Usable Ability Counter
00198a2c: 00000000 nop
00198a30: 24420001 addiu r2,r2,0x0001
00198a34: 3c01801a lui r1,0x801a
00198a38: ac22f384 sw r2,-0x0c7c(r1)				Usable Ability Counter++
00198a3c: 0c066bc6 jal 0x0019af18					Decide to Use Ability
00198a40: 00000000 nop
00198a44: 2403ffff addiu r3,r0,0xffff
00198a48: 10430027 beq r2,r3,0x00198ae8				Exit and Return -1 if Ability was chosen
00198a4c: 2402ffff addiu r2,r0,0xffff
<Ability++>
00198a50: 92020cbd lbu r2,0x0cbd(r16)				Load Ability Counter
00198a54: 00000000 nop
00198a58: 24420001 addiu r2,r2,0x0001
00198a5c: a2020cbd sb r2,0x0cbd(r16)				Ability Counter++
00198a60: 92020cbd lbu r2,0x0cbd(r16)
00198a64: 00000000 nop
00198a68: 2c420022 sltiu r2,r2,0x0022
00198a6c: 1440ffa7 bne r2,r0,0x0019890c				Do for all abilities
00198a70: 00000000 nop
<No Ability was choosen>
00198a74: 92020071 lbu r2,0x0071(r16)				Load ?
00198a78: 00000000 nop
00198a7c: 10400006 beq r2,r0,0x00198a98				Branch if ? = False
00198a80: 260417fc addiu r4,r16,0x17fc
00198a84: 26050054 addiu r5,r16,0x0054
00198a88: 0c066ac2 jal 0x0019ab08					Transfer Half Word Values
00198a8c: 34060020 ori r6,r0,0x0020
00198a90: 080662ba j 0x00198ae8						Exit and return 2
00198a94: 34020002 ori r2,r0,0x0002
<Any Ability Usable?>
00198a98: 3c02801a lui r2,0x801a
00198a9c: 8c42f384 lw r2,-0x0c7c(r2)				Load Usable Ability Counter
00198aa0: 00000000 nop
00198aa4: 14400003 bne r2,r0,0x00198ab4				Branch if any ability was usable
00198aa8: 00000000 nop
00198aac: 080662ba j 0x00198ae8						Exit and return 0
00198ab0: 00001021 addu r2,r0,r0
00198ab4: 3c03801a lui r3,0x801a
00198ab8: 8c63f388 lw r3,-0x0c78(r3)				
00198abc: 00000000 nop
00198ac0: 10600009 beq r3,r0,0x00198ae8				Exit and return 1 if Unit has enough MP to cast spell?
00198ac4: 34020001 ori r2,r0,0x0001
00198ac8: 92030cbe lbu r3,0x0cbe(r16)				Load ?
00198acc: 00000000 nop
00198ad0: 14600005 bne r3,r0,0x00198ae8				Exit and Return 1 if true
00198ad4: 00000000 nop
00198ad8: 3c02801a lui r2,0x801a
00198adc: 8c42f38c lw r2,-0x0c74(r2)				Ability can be cast?
00198ae0: 00000000 nop
00198ae4: 0002102b sltu r2,r0,r2					Return 0 if any Ability can be cast
00198ae8: 8fbf001c lw r31,0x001c(r29)
00198aec: 8fb20018 lw r18,0x0018(r29)
00198af0: 8fb10014 lw r17,0x0014(r29)
00198af4: 8fb00010 lw r16,0x0010(r29)
00198af8: 27bd0020 addiu r29,r29,0x0020
00198afc: 03e00008 jr r31
00198b00: 00000000 nop