Equipment Evasion Setting (Magical)

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search
No Parameters - Returns Nothing

First Nullify Current Ability Evasion bytes and set Ability base hit to 100
Then if Target is not a monster set the Evasion value
 - 0x801938de : Target's Accessory M-Ev
 - 0x801938df : Target's Right Hand shield M-Ev
 - 0x801938e0 : Target's Left Hand shield M-Ev
 
Note : unlike Equipment_Evasion_Setting_(Physical) routine
 - Class Evade is not checked
 - Since weapon do not have M-Ev they are not checked either 
----------------------------------------------------------------------------------
001851c4: 3c048019 lui r4,0x8019            |
001851c8: 8c842d98 lw r4,0x2d98(r4)         |r4 = Target Data Pointer
001851cc: 34020064 ori r2,r0,0x0064         |r2 = 100
001851d0: 3c018019 lui r1,0x8019            |
001851d4: a02238dc sb r2,0x38dc(r1)         |Set Current Ability base hit to 100           0x801938dc / 801938dc
001851d8: 3c018019 lui r1,0x8019            |
001851dc: a02038de sb r0,0x38de(r1)         |Clear Ability Accessory Evade byte           0x801938de / 801938de
001851e0: 3c018019 lui r1,0x8019            |
001851e4: a02038df sb r0,0x38df(r1)         |Clear Ability Right Hand Evade byte           0x801938df / 801938df
001851e8: 3c018019 lui r1,0x8019            |
001851ec: a02038e0 sb r0,0x38e0(r1)         |Clear Ability Left Hand Evade byte           0x801938e0 / 801938e0
001851f0: 3c018019 lui r1,0x8019            |
001851f4: a02038e1 sb r0,0x38e1(r1)         |Clear Ability Class Evade byte           0x801938e1 / 801938e1
001851f8: 90820006 lbu r2,0x0006(r4)        |r2 = Target's Gender
001851fc: 00000000 nop                      |
00185200: 30420020 andi r2,r2,0x0020        |r2 = 0x20 if Target is a monster
00185204: 14400035 bne r2,r0,0x001852dc     #If Target is not a monster' / If target is a monster, branch to #END'
00185208: 00000000 nop                          |
0018520c: 9082001c lbu r2,0x001c(r4)            |r2 = Target Accessory's
00185210: 3c058006 lui r5,0x8006                |
00185214: 24a52eb8 addiu r5,r5,0x2eb8           |r5 = 0x80062eb8 (start of item's data)
00185218: 00021840 sll r3,r2,0x01               |Accessory ID * 2
0018521c: 00621821 addu r3,r3,r2                |Accessory ID * 3
00185220: 00031880 sll r3,r3,0x02               |Accessory ID * 12 (Accessory offset in Item data)
00185224: 00651821 addu r3,r3,r5                |r3 = Target's Accessory data pointer
00185228: 90620003 lbu r2,0x0003(r3)            |r2 = Target's Accessory Type
0018522c: 00000000 nop                          |
00185230: 30420008 andi r2,r2,0x0008            |r2 = 0x08 if Accessory type is [Accessory]
00185234: 10400009 beq r2,r0,0x0018525c         #If Target's Accessory is Valid /Else branch to Right Hand section
00185238: 00000000 nop                              |
0018523c: 90620004 lbu r2,0x0004(r3)                |r2 = Target's Accessory 2nd Table ID
00185240: 00000000 nop                              |
00185244: 00021040 sll r2,r2,0x01                   |r2 =  Target Accessory 2nd table offset
00185248: 3c018006 lui r1,0x8006                    |
0018524c: 00220821 addu r1,r1,r2                    |r1 = 0x800600XX (XX = Target Accessory offset)
00185250: 90223f59 lbu r2,0x3f59(r1)                |r2 = Target's Accessory Magic Evade       0x80063f58 + 0x01 + Accessory offset
00185254: 3c018019 lui r1,0x8019                    |
00185258: a02238de sb r2,0x38de(r1)                 |Store Target's Accessory Magic Evasion in Ability Accessory Evasion (0x801938de)
0018525c: 9082001e lbu r2,0x001e(r4)            |r2 = Target's Right Hand (RH) shield ID
00185260: 00000000 nop                          |
00185264: 00021840 sll r3,r2,0x01               |RH shield ID *2
00185268: 00621821 addu r3,r3,r2                |RH shield ID *3
0018526c: 00031880 sll r3,r3,0x02               |RH shield ID *12
00185270: 00651821 addu r3,r3,r5                |r3 = RH shield data pointer
00185274: 90620003 lbu r2,0x0003(r3)            |r2 = RH shield Item Type
00185278: 90630004 lbu r3,0x0004(r3)            |r3 = RH shield 2nd Table ID
0018527c: 30420040 andi r2,r2,0x0040            |r2 = 0x40 if RH shield Type is [Shield]
00185280: 10400006 beq r2,r0,0x0018529c         #If Target's RH shield is valid /Else branch to left hand section
00185284: 00031040 sll r2,r3,0x01                   |r2 = RH shield 2nd Table offset
00185288: 3c018006 lui r1,0x8006                    |
0018528c: 00220821 addu r1,r1,r2                    |r1 = 0x800600xx (xx = RH shield offset)
00185290: 90223eb9 lbu r2,0x3eb9(r1)                |r2 = RH shield Magic evasion       0x80063eb8 + 0x01 + Shield offset
00185294: 3c018019 lui r1,0x8019                    |
00185298: a02238df sb r2,0x38df(r1)                 |Store RH shield Magic Evasion in Current Ability Right Hand evasion (0x801938df)
0018529c: 90820020 lbu r2,0x0020(r4)            |r2 = Target's Left Hand (LH) shield ID
001852a0: 00000000 nop                          |
001852a4: 00021840 sll r3,r2,0x01               |LH shield ID *2
001852a8: 00621821 addu r3,r3,r2                |LH shield ID *3
001852ac: 00031880 sll r3,r3,0x02               |LH shield ID *12
001852b0: 00651821 addu r3,r3,r5                |r3 = LH shield data pointer
001852b4: 90620003 lbu r2,0x0003(r3)            |r2 = LH shield Item Type
001852b8: 90630004 lbu r3,0x0004(r3)            |r3 = LH shield 2nd Table ID
001852bc: 30420040 andi r2,r2,0x0040            |r2 = 0x40 if LH shield Type is [Shield]
001852c0: 10400006 beq r2,r0,0x001852dc         #If Target's LH shield is valid
001852c4: 00031040 sll r2,r3,0x01                   |r2 = LH shield 2nd Table offset
001852c8: 3c018006 lui r1,0x8006                    |
001852cc: 00220821 addu r1,r1,r2                    |r1 = 0x800600xx (xx = LH shield offset)
001852d0: 90223eb9 lbu r2,0x3eb9(r1)                |r2 = LH shield Magic evasion       0x80063eb8 + 0x01 + Shield offset
001852d4: 3c018019 lui r1,0x8019                    |
001852d8: a02238e0 sb r2,0x38e0(r1)                 |Store LH shield Magic Evasion in Current Ability Left Hand evasion (0x801938e0)
001852dc: 03e00008 jr r31                       END
001852e0: 00000000 nop                          

Return Locations

Battle.bin
001885c8: Magical Evade Calculation