Difference between revisions of "Physical Evade Calculation"

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search
m
m
 
Line 1: Line 1:
 
  No Parameters  
 
  No Parameters  
 
   
 
   
  Returns r2 = 0x00 if Attack Hits
+
  Returns r2 = 0x00 if Attack Hits and if Ability is not Evadeable
 
   
 
   
 
  Set the 4 Ability Evade bytes
 
  Set the 4 Ability Evade bytes
Line 31: Line 31:
 
  00188548: 0c06153f jal 0x001854fc          |{{f/jal|Facing Evade Calculation|Facing Evade Calculation}}  Side Attack cancels Class evasion, Back Attack additionnaly cancels Right/Left hand evasion
 
  00188548: 0c06153f jal 0x001854fc          |{{f/jal|Facing Evade Calculation|Facing Evade Calculation}}  Side Attack cancels Class evasion, Back Attack additionnaly cancels Right/Left hand evasion
 
  0018854c: 00000000 nop                      |
 
  0018854c: 00000000 nop                      |
  00188550: 0c062122 jal 0x00188488          |{{f/jal|Calculate Hit %|Calculate Hit %}}  Roll the 4 Ability Evade byte (one after another) against Ability base Hit
+
  00188550: 0c062122 jal 0x00188488          |{{f/jal|Calculate Hit %|Calculate Hit %}}  If Ability is evadeable : Roll the 4 Ability Evade byte (one after another) against Ability base Hit
 
  00188554: 00000000 nop                       
 
  00188554: 00000000 nop                       
 
  00188558: 8fbf0010 lw r31,0x0010(r29)       
 
  00188558: 8fbf0010 lw r31,0x0010(r29)       
Line 38: Line 38:
 
  00188564: 00000000 nop                       
 
  00188564: 00000000 nop                       
  
'''Return Locations'''
+
=== Return Locations ===
  00188b64: Formula 01 ([[01 Dmg (Weapon)|link]])
+
'''Battle.bin'''
  00188ba4: Formula 02 ([[02 Dmg_(Weapon)|link]])
+
  00188b74: [[01_Dmg_(Weapon)|Formula 01 : Dmg (Weapon)]]
  00188cf4: Formula 06 ([[06 AbsHP (Weapon)|link]])
+
  00188bb4: [[02_Dmg_(Weapon)|Formula 02 : Dmg (Weapon)]]
  001896ec: Formula 25 ([[25 Equipped: Break Hit (PA+WP+X)%|link]])
+
  00188d04: [[06_AbsHP_(Weapon)|Formula 06 : AbsHP (Weapon)]]
  00189794: Formula 26 ([[26 Equipped: Steal Hit (SP+X)%|link]])
+
  0018972c: [[25_Equipped:_Break_Hit_(PA%2BWP%2BX)%25|Formula 25 : Equipped: Break Hit (PA+WP+X)%]]
  00189828: Formula 27 ([[27 StealGil (CasLVL*SP) Hit (SP+X)%|link]])
+
  001897d0: [[26_Equipped:_Steal_Hit_(SP%2BX)%25|Formula 26 : Equipped: Steal Hit (SP+X)%]]
  00189870: Formula 28 ([[28 StealExp (Lowest of TarCurExp & SP+Y) Hit (SP+X)%|link]])
+
  00189838: [[27_StealGil_(CasLVL*SP)_Hit_(SP%2BX)%25|Formula 27 : StealGil (CasLVL*SP) Hit (SP+X)%]]
  00189a90: Formula 2B ([[2B Hit (PA+X)% // -PA/MA/SP (X)|link]] return at 00189a9c)
+
  00189880: [[28_StealExp_(Lowest_of_TarCurExp_%26_SP%2BY)_Hit_(SP%2BX)%25|Formula 28 : StealExp (Lowest of TarCurExp & SP+Y) Hit (SP+X)%]]
  00189ad8: Formula 2C ([[2C DmgMP (X)% Hit (PA+Y)%|link]])
+
  00189aa0: [[2B_Hit_(PA%2BX)%25_//_-PA/MA/SP_(X)|Formula 2b : Hit (PA+X)% // -PA/MA/SP (X)]]
  00189b20: Formula 2D ([[2D Dmg (PA*(WP+Y)) 100% Status|link]])
+
  00189ae8: [[2C_DmgMP_(X)%25_Hit_(PA%2BY)%25|Formula 2c : DmgMP (X)% Hit (PA+Y)%]]
  00189b94: Formula 2E ([[2E Equipped:Break Dmg (PA*WP)|link]])
+
  00189b30: [[2D_Dmg_(PA*(WP%2BY))_100%25_Status|Formula 2d : Dmg (PA*(WP+Y)) 100% Status]]
  00189c50: Formula 2F ([[2F AbsMP (PA*WP)|link]])
+
  00189ba4: [[2E_Equipped:Break_Dmg_(PA*WP)|Formula 2e : Equipped:Break Dmg (PA*WP)]]
  00189c90: Formula 30 ([[30 AbsHP (PA*WP)|link]])
+
  00189c60: [[2F_AbsMP_(PA*WP)|Formula 2f : AbsMP (PA*WP)]]
  00189cd0: Formula 31 ([[31 Dmg ((PA+Y)/2*PA)|link]])
+
  00189ca0: [[30_AbsHP_(PA*WP)|Formula 30 : AbsHP (PA*WP)]]
  00189f84: Formula 37 ([[37 Dmg (Rdm(1…Y)*PA)|link]])
+
  00189ce0: [[31_Dmg_((PA%2BY)/2*PA)|Formula 31 : Dmg ((PA+Y)/2*PA)]]
  0018a3d0: Formula 4D ([[4D AbsHP (Y)% Hit (MA+X)%|link]])
+
  00189d84: [[32_Dmg_(Rdm(1…X)*(PA*3%2BY))|Formula 32 : Dmg (Rdm(1…X)*(PA*3+Y))]]
  0018a458: Formula 4F ([[4F Dmg (CasMaxHP-CasCurHP) Hit (PA+X)%|link]])
+
00189f94: [[37_Dmg_(Rdm(1…Y)*PA)|Formula 37 : Dmg (Rdm(1…Y)*PA)]]
  0018a4a0: Formula 50 ([[50 Hit (MA+X)%|link]])
+
  0018a3e0: [[4D_AbsHP_(Y)%25_Hit_(MA%2BX)%25|Formula 4d : AbsHP (Y)% Hit (MA+X)%]]
  0018ab98: Formula 63 ([[63 Dmg (SP*WP)|link]])
+
  0018a468: [[4F_Dmg_(CasMaxHP-CasCurHP)_Hit_(PA%2BX)%25|Formula 4f : Dmg (CasMaxHP-CasCurHP) Hit (PA+X)%]]
 +
  0018a4b0: [[50_Hit_(MA%2BX)%25|Formula 50 : Hit (MA+X)%]]
 +
  0018abcc: [[63_Dmg_(SP*WP)|Formula 63 : Dmg (SP*WP)]]

Latest revision as of 19:08, 7 April 2022

No Parameters 

Returns r2 = 0x00 if Attack Hits and if Ability is not Evadeable

Set the 4 Ability Evade bytes
 - 0x801938de - Accessory Evade
 - 0x801938df - RH Evade (weapon or shield)
 - 0x801938e0 - LH Evade (weapon or shield)
 - 0x801938e1 - Class Evade
Set Ability Base Hit to 100 (0x801938dc)

Modify Evade bytes and base Hit according to Statuses/Ability/Facing/Weather etc..

Roll Each Ability Evade byte against Ability Base Hit
(So something halvering Ability Base hit, will in fact doubles all Evade bytes)
----------------------------------------------------------------------------------------------
00188510: 27bdffe8 addiu r29,r29,-0x0018    
00188514: afbf0010 sw r31,0x0010(r29)       
00188518: 0c0613e7 jal 0x00184f9c           |-->Equipment Evasion Setting (Physical)  Set the 4 Ability Evade byte , set Ability base hit to 100 
0018851c: 00000000 nop                      |
00188520: 0c0614b9 jal 0x001852e4           |-->Concentrate Calculation  Nullify the 4 Ability Evade byte if Attacker uses Concentration
00188524: 00000000 nop                      |
00188528: 0c0614ca jal 0x00185328           |-->Dark/Confuse Caclulation    Ability Base Hit/2 if attacker blinded  or confused / Nullify the 4 Ability Evade byte if attacker is transparent
0018852c: 00000000 nop                      |
00188530: 0c0614df jal 0x0018537c           |-->Abandon Calculation   If target as abandon (and it is usable) --> Ability Base Hit/2
00188534: 00000000 nop                      |
00188538: 0c0614fd jal 0x001853f4           |-->Evasion Changes due to Statuses  Nullify the 4 Ability evade byte based on Target status - Ability Base Hit/2 if target defending
0018853c: 00000000 nop                      |
00188540: 0c0615ce jal 0x00185738           |-->Weather effects on Bows With Bows/Crossbows : Night = Ability base Hit * 0,75 and/or If Stormy weather Ability base hit *0,75
00188544: 00000000 nop                      |
00188548: 0c06153f jal 0x001854fc           |-->Facing Evade Calculation  Side Attack cancels Class evasion, Back Attack additionnaly cancels Right/Left hand evasion
0018854c: 00000000 nop                      |
00188550: 0c062122 jal 0x00188488           |-->Calculate Hit %  If Ability is evadeable : Roll the 4 Ability Evade byte (one after another) against Ability base Hit
00188554: 00000000 nop                      
00188558: 8fbf0010 lw r31,0x0010(r29)       
0018855c: 27bd0018 addiu r29,r29,0x0018     
00188560: 03e00008 jr r31                   
00188564: 00000000 nop                      

Return Locations

Battle.bin
00188b74: Formula 01 : Dmg (Weapon)
00188bb4: Formula 02 : Dmg (Weapon)
00188d04: Formula 06 : AbsHP (Weapon)
0018972c: Formula 25 : Equipped: Break Hit (PA+WP+X)%
001897d0: Formula 26 : Equipped: Steal Hit (SP+X)%
00189838: Formula 27 : StealGil (CasLVL*SP) Hit (SP+X)%
00189880: Formula 28 : StealExp (Lowest of TarCurExp & SP+Y) Hit (SP+X)%
00189aa0: Formula 2b : Hit (PA+X)% // -PA/MA/SP (X)
00189ae8: Formula 2c : DmgMP (X)% Hit (PA+Y)%
00189b30: Formula 2d : Dmg (PA*(WP+Y)) 100% Status
00189ba4: Formula 2e : Equipped:Break Dmg (PA*WP)
00189c60: Formula 2f : AbsMP (PA*WP)
00189ca0: Formula 30 : AbsHP (PA*WP)
00189ce0: Formula 31 : Dmg ((PA+Y)/2*PA)
00189d84: Formula 32 : Dmg (Rdm(1…X)*(PA*3+Y))
00189f94: Formula 37 : Dmg (Rdm(1…Y)*PA)
0018a3e0: Formula 4d : AbsHP (Y)% Hit (MA+X)%
0018a468: Formula 4f : Dmg (CasMaxHP-CasCurHP) Hit (PA+X)%
0018a4b0: Formula 50 : Hit (MA+X)%
0018abcc: Formula 63 : Dmg (SP*WP)