Difference between revisions of "Arrow Guard Usability"

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search
m (Notes Formatting, return location)
Line 1: Line 1:
 
  Arrow Guard Usability:
 
  Arrow Guard Usability:
  0018d0e8: 3c028019 lui r2,0x8019
+
  0018d0ec: 904238f3 lbu r2,0x38f3(r2) Load Ability Flags 1
+
  0018d0e8: 3c028019 lui r2,0x8019          
  0018d0f0: 27bdffe8 addiu r29,r29,0xffe8
+
  0018d0ec: 904238f3 lbu r2,0x38f3(r2)       |{{f/load|<nowiki>r2 = Current Ability Flags 1</nowiki>}}
  0018d0f4: 30420020 andi r2,r2,0x0020
+
  0018d0f0: 27bdffe8 addiu r29,r29,0xffe8     |
  0018d0f8: 1040002b beq r2,r0,0x0018d1a8 Branch if 'Range Weapon' is not  flagged
+
  0018d0f4: 30420020 andi r2,r2,0x0020       |{{f/std|<nowiki>r2 = 0x20 if ranged weapon is checked</nowiki>}}
  0018d0fc: afbf0010 sw r31,0x0010(r29)
+
  0018d0f8: 1040002b beq r2,r0,0x0018d1a8     {{f/Cond|<nowiki>If ranged weapon is checked</nowiki>}} /Else branch to {{f/loc|<nowiki>End</nowiki>}}
  0018d100: 3c028019 lui r2,0x8019
+
  0018d0fc: afbf0010 sw r31,0x0010(r29)           |{{f/store|<nowiki> </nowiki>}}
  0018d104: 904238d8 lbu r2,0x38d8(r2) Load Used Weapon ID
+
  0018d100: 3c028019 lui r2,0x8019                 |{{f/std|<nowiki> </nowiki>}}
  0018d108: 00000000 nop
+
  0018d104: 904238d8 lbu r2,0x38d8(r2)             |{{f/load|<nowiki>r2 = Current ability used weapon ID</nowiki>}}
  0018d10c: 00021840 sll r3,r2,0x01 ID * 2
+
  0018d108: 00000000 nop                           |
  0018d110: 00621821 addu r3,r3,r2 ID * 3
+
  0018d10c: 00021840 sll r3,r2,0x01               |{{f/std|<nowiki>ID * 2</nowiki>}}
  0018d114: 00031880 sll r3,r3,0x02 ID * 12
+
  0018d110: 00621821 addu r3,r3,r2                 |{{f/std|<nowiki>ID * 3</nowiki>}}
  0018d118: 3c018006 lui r1,0x8006
+
  0018d114: 00031880 sll r3,r3,0x02               |{{f/std|<nowiki>ID * 12 (12 is the size of each weapon section)</nowiki>}}
  0018d11c: 00230821 addu r1,r1,r3 80060000 + ID * 12
+
  0018d118: 3c018006 lui r1,0x8006                 |
  0018d120: 90222ebd lbu r2,0x2ebd(r1) Load Used Weapon Item Type
+
  0018d11c: 00230821 addu r1,r1,r3                 |{{f/std|<nowiki>r1 = 80060000 + ID * 12</nowiki>}}
  0018d124: 00000000 nop
+
  0018d120: 90222ebd lbu r2,0x2ebd(r1)             |{{f/load|<nowiki>r2 = Used weapon type</nowiki>}} {{f/std|<nowiki>0x80062edb is the weapon type of weapon ID 0x00</nowiki>}}
  0018d128: 2442fff5 addiu r2,r2,0xfff5 Weapon Item Type - 11 (0xfff6 for Guns)  
+
  0018d124: 00000000 nop                           |
  0018d12c: 2c420002 sltiu r2,r2,0x0002 Check for Crossbows/Bows (0x0003 for Guns )
+
  0018d128: 2442fff5 addiu r2,r2,-0x000b          |{{f/std|<nowiki>Weapon Item Type - 11 (everything before crossbow is < 0) </nowiki>}} /[[Data/Table_Locations#Item Data 0x05|Weapon type table]]
  0018d130: 1040001d beq r2,r0,0x0018d1a8 Branch if weapon is not a  Crossbow/Bow
+
  0018d12c: 2c420002 sltiu r2,r2,0x0002           |{{f/std|<nowiki>r2 = 0x01 if weapon type is crossbow or bow (use unsigned value so values < 0x00 become something > 0x7F)</nowiki>}}
  0018d134: 34020064 ori r2,r0,0x0064 R2 = 0x64 (or 100)
+
  0018d130: 1040001d beq r2,r0,0x0018d1a8         {{f/Cond|<nowiki>If weapon is bow or crossbow type</nowiki>}} /Else branch to {{f/loc|<nowiki>End</nowiki>}}
  0018d138: 3c048019 lui r4,0x8019
+
  0018d134: 34020064 ori r2,r0,0x0064                 |{{f/std|<nowiki>r2 = 0x64 (= 100)</nowiki>}}
  0018d13c: 8c842d98 lw r4,0x2d98(r4) Load Defender's Stats
+
  0018d138: 3c048019 lui r4,0x8019                     |
  0018d140: 00000000 nop
+
  0018d13c: 8c842d98 lw r4,0x2d98(r4)                 |{{f/adr|<nowiki>r4 = Target data pointer</nowiki>}}
  0018d144: 90830024 lbu r3,0x0024(r4) Load Brave
+
  0018d140: 00000000 nop                               |
  0018d148: 3c058019 lui r5,0x8019
+
  0018d144: 90830024 lbu r3,0x0024(r4)                 |{{f/load|<nowiki>r3 = Target brave</nowiki>}}
  0018d14c: 8ca52d90 lw r5,0x2d90(r5) Load Defender's Current Action Data
+
  0018d148: 3c058019 lui r5,0x8019                     |
  0018d150: 00431023 subu r2,r2,r3 100 - Brave
+
  0018d14c: 8ca52d90 lw r5,0x2d90(r5)                 |{{f/adr|<nowiki>r5 = Target current action data pointer</nowiki>}}
  0018d154: 0c0634e1 jal 0x0018d384 [[Chance to React]]
+
  0018d150: 00431023 subu r2,r2,r3                     |{{f/std|<nowiki>r2 = 100 - Brave</nowiki>}}
  0018d158: a4a2002a sh r2,0x002a(r5) Store Hit % ?
+
  0018d154: 0c0634e1 jal 0x0018d384                   |{{f/jal|Chance to React|<nowiki>Chance to React</nowiki>}}  0 to 100 Random number against Target brave - returns r2 = 0x00 if reaction occurs
  0018d15c: 14400012 bne r2,r0,0x0018d1a8
+
  0018d158: a4a2002a sh r2,0x002a(r5)                 |{{f/store|<nowiki>Store (100-Brave) as target current action Hit % ?</nowiki>}}
  0018d160: 00000000 nop
+
  0018d15c: 14400012 bne r2,r0,0x0018d1a8             {{f/Cond|<nowiki>If target will react</nowiki>}} /Else branch to {{f/loc|<nowiki>End</nowiki>}}
  0018d164: 3c028019 lui r2,0x8019
+
  0018d160: 00000000 nop                                   |{{f/std|<nowiki> </nowiki>}}
  0018d168: 8c42f5fc lw r2,-0x0a04(r2)
+
  0018d164: 3c028019 lui r2,0x8019                         |{{f/std|<nowiki> </nowiki>}}
  0018d16c: 00000000 nop
+
  0018d168: 8c42f5fc lw r2,-0x0a04(r2)                     |{{f/load|<nowiki>r2 = Action state</nowiki>}} {{f/adr|<nowiki> </nowiki>}}
  0018d170: 1440000d bne r2,r0,0x0018d1a8
+
  0018d16c: 00000000 nop                                   |
  0018d174: 00000000 nop
+
  0018d170: 1440000d bne r2,r0,0x0018d1a8                 {{f/Cond|<nowiki>If action is being executed</nowiki>}} /Else branch to {{f/loc|<nowiki>end</nowiki>}}
  0018d178: 3c028019 lui r2,0x8019
+
  0018d174: 00000000 nop                                       |{{f/std|<nowiki> </nowiki>}}
  0018d17c: 8c422d90 lw r2,0x2d90(r2) Load Defender's Currect Action Data
+
  0018d178: 3c028019 lui r2,0x8019                             |{{f/std|<nowiki> </nowiki>}}
  0018d180: 00000000 nop
+
  0018d17c: 8c422d90 lw r2,0x2d90(r2)                         |{{f/adr|<nowiki>r2 = Target current action data pointer</nowiki>}}
  0018d184: a0400000 sb r0,0x0000(r2) Store Evade as 0
+
  0018d180: 00000000 nop                                       |
  0018d188: 3c038019 lui r3,0x8019
+
  0018d184: a0400000 sb r0,0x0000(r2)                         |{{f/store|<nowiki>Store Target current action hit flag as miss</nowiki>}}
  0018d18c: 8c632d90 lw r3,0x2d90(r3) Load Defender's Currect Action Data
+
  0018d188: 3c038019 lui r3,0x8019                             |
  0018d190: 34020004 ori r2,r0,0x0004
+
  0018d18c: 8c632d90 lw r3,0x2d90(r3)                         |{{f/adr|<nowiki>r3 = Target current action data pointer</nowiki>}}
  0018d194: a0620002 sb r2,0x0002(r3) Store Evade type
+
  0018d190: 34020004 ori r2,r0,0x0004                         |{{f/std|<nowiki>r2 = 0x04</nowiki>}}
  0018d198: 3c038019 lui r3,0x8019
+
  0018d194: a0620002 sb r2,0x0002(r3)                         |{{f/store|<nowiki>Store Evade type as 0x04 (Arrow guard)</nowiki>}}
  0018d19c: 8c632d90 lw r3,0x2d90(r3) Load Current Action Data Pointer
+
  0018d198: 3c038019 lui r3,0x8019                             |
  0018d1a0: 340201c4 ori r2,r0,0x01c4
+
  0018d19c: 8c632d90 lw r3,0x2d90(r3)                         |{{f/adr|<nowiki>r3 = Target current action data pointer</nowiki>}}
  0018d1a4: a462000e sh r2,0x000e(r3) Store Reaction ID
+
  0018d1a0: 340201c4 ori r2,r0,0x01c4                         |{{f/std|<nowiki>r2 = 0x1c4 (Arrow guard Ability ID)</nowiki>}}
  0018d1a8: 8fbf0010 lw r31,0x0010(r29)
+
  0018d1a4: a462000e sh r2,0x000e(r3)                         |{{f/store|<nowiki>Store Target Reaction ID as arrow guard</nowiki>}}
  0018d1ac: 27bd0018 addiu r29,r29,0x0018
+
  0018d1a8: 8fbf0010 lw r31,0x0010(r29)                      
  0018d1b0: 03e00008 jr r31
+
  0018d1ac: 27bd0018 addiu r29,r29,0x0018                    
  0018d1b4: 00000000 nop
+
  0018d1b0: 03e00008 jr r31                                  
 +
  0018d1b4: 00000000 nop      
 +
 
 +
==Return location==
 +
0018caf0: [[%27Reflect%27,_Blade_Grasp,_and_Arrow_Guard]]

Revision as of 12:30, 28 November 2021

Arrow Guard Usability:

0018d0e8: 3c028019 lui r2,0x8019            
0018d0ec: 904238f3 lbu r2,0x38f3(r2)        |r2 = Current Ability Flags 1
0018d0f0: 27bdffe8 addiu r29,r29,0xffe8     |
0018d0f4: 30420020 andi r2,r2,0x0020        |r2 = 0x20 if ranged weapon is checked
0018d0f8: 1040002b beq r2,r0,0x0018d1a8     #If ranged weapon is checked /Else branch to End
0018d0fc: afbf0010 sw r31,0x0010(r29)            | 
0018d100: 3c028019 lui r2,0x8019                 | 
0018d104: 904238d8 lbu r2,0x38d8(r2)             |r2 = Current ability used weapon ID
0018d108: 00000000 nop                           |
0018d10c: 00021840 sll r3,r2,0x01                |ID * 2
0018d110: 00621821 addu r3,r3,r2                 |ID * 3
0018d114: 00031880 sll r3,r3,0x02                |ID * 12 (12 is the size of each weapon section)
0018d118: 3c018006 lui r1,0x8006                 |
0018d11c: 00230821 addu r1,r1,r3                 |r1 = 80060000 + ID * 12
0018d120: 90222ebd lbu r2,0x2ebd(r1)             |r2 = Used weapon type 0x80062edb is the weapon type of weapon ID 0x00
0018d124: 00000000 nop                           |
0018d128: 2442fff5 addiu r2,r2,-0x000b           |Weapon Item Type - 11 (everything before crossbow is < 0)  /Weapon type table
0018d12c: 2c420002 sltiu r2,r2,0x0002            |r2 = 0x01 if weapon type is crossbow or bow (use unsigned value so values < 0x00 become something > 0x7F)
0018d130: 1040001d beq r2,r0,0x0018d1a8          #If weapon is bow or crossbow type /Else branch to End
0018d134: 34020064 ori r2,r0,0x0064                  |r2 = 0x64 (= 100)
0018d138: 3c048019 lui r4,0x8019                     |
0018d13c: 8c842d98 lw r4,0x2d98(r4)                  |r4 = Target data pointer
0018d140: 00000000 nop                               |
0018d144: 90830024 lbu r3,0x0024(r4)                 |r3 = Target brave
0018d148: 3c058019 lui r5,0x8019                     |
0018d14c: 8ca52d90 lw r5,0x2d90(r5)                  |r5 = Target current action data pointer
0018d150: 00431023 subu r2,r2,r3                     |r2 = 100 - Brave
0018d154: 0c0634e1 jal 0x0018d384                    |-->Chance to React  0 to 100 Random number against Target brave - returns r2 = 0x00 if reaction occurs
0018d158: a4a2002a sh r2,0x002a(r5)                  |Store (100-Brave) as target current action Hit % ?
0018d15c: 14400012 bne r2,r0,0x0018d1a8              #If target will react /Else branch to End
0018d160: 00000000 nop                                   | 
0018d164: 3c028019 lui r2,0x8019                         | 
0018d168: 8c42f5fc lw r2,-0x0a04(r2)                     |r2 = Action state  
0018d16c: 00000000 nop                                   |
0018d170: 1440000d bne r2,r0,0x0018d1a8                  #If action is being executed /Else branch to end
0018d174: 00000000 nop                                       | 
0018d178: 3c028019 lui r2,0x8019                             | 
0018d17c: 8c422d90 lw r2,0x2d90(r2)                          |r2 = Target current action data pointer
0018d180: 00000000 nop                                       |
0018d184: a0400000 sb r0,0x0000(r2)                          |Store Target current action hit flag as miss
0018d188: 3c038019 lui r3,0x8019                             |
0018d18c: 8c632d90 lw r3,0x2d90(r3)                          |r3 = Target current action data pointer
0018d190: 34020004 ori r2,r0,0x0004                          |r2 = 0x04
0018d194: a0620002 sb r2,0x0002(r3)                          |Store Evade type as 0x04 (Arrow guard)
0018d198: 3c038019 lui r3,0x8019                             |
0018d19c: 8c632d90 lw r3,0x2d90(r3)                          |r3 = Target current action data pointer
0018d1a0: 340201c4 ori r2,r0,0x01c4                          |r2 = 0x1c4 (Arrow guard Ability ID)
0018d1a4: a462000e sh r2,0x000e(r3)                          |Store Target Reaction ID as arrow guard
0018d1a8: 8fbf0010 lw r31,0x0010(r29)                        
0018d1ac: 27bd0018 addiu r29,r29,0x0018                      
0018d1b0: 03e00008 jr r31                                    
0018d1b4: 00000000 nop        

Return location

0018caf0: 'Reflect',_Blade_Grasp,_and_Arrow_Guard