Difference between revisions of "Physical Evade Calculation"

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search
(Created page with " Physical Evade Calculation (Charge): 00188568: 27bdffe8 addiu r29,r29,0xffe8 0018856c: afbf0010 sw r31,0x0010(r29) 00188570: 0c0613e7 jal 0x00184f9c 00188574: 00000000 no...")
 
m
 
(14 intermediate revisions by 5 users not shown)
Line 1: Line 1:
  Physical Evade Calculation (Charge):
+
  No Parameters
  00188568: 27bdffe8 addiu r29,r29,0xffe8
+
  0018856c: afbf0010 sw r31,0x0010(r29)
+
Returns r2 = 0x00 if Attack Hits and if Ability is not Evadeable
  00188570: 0c0613e7 jal 0x00184f9c
+
  00188574: 00000000 nop
+
Set the 4 Ability Evade bytes
  00188578: 0c0614b9 jal 0x001852e4
+
  - 0x801938de - Accessory Evade
  0018857c: 00000000 nop
+
  - 0x801938df - RH Evade (weapon or shield)
  00188580: 0c0614ca jal 0x00185328
+
  - 0x801938e0 - LH Evade (weapon or shield)
  00188584: 00000000 nop
+
  - 0x801938e1 - Class Evade
  00188588: 0c0614df jal 0x0018537c
+
Set Ability Base Hit to 100 (0x801938dc)
  0018858c: 00000000 nop
+
  00188590: 0c0614fd jal 0x001853f4
+
Modify Evade bytes and base Hit according to Statuses/Ability/Facing/Weather etc..
  00188594: 00000000 nop
+
  00188598: 0c06153f jal 0x001854fc
+
Roll Each Ability Evade byte against Ability Base Hit
  0018859c: 00000000 nop
+
(So something halvering Ability Base hit, will in fact doubles all Evade bytes)
  001885a0: 0c062122 jal 0x00188488
+
  ----------------------------------------------------------------------------------------------
  001885a4: 00000000 nop
+
00188510: 27bdffe8 addiu r29,r29,-0x0018   
  001885a8: 8fbf0010 lw r31,0x0010(r29)
+
  00188514: afbf0010 sw r31,0x0010(r29)      
  001885ac: 27bd0018 addiu r29,r29,0x0018
+
  00188518: 0c0613e7 jal 0x00184f9c           |{{f/jal|Equipment Evasion Setting (Physical) |Equipment Evasion Setting (Physical) }} Set the 4 Ability Evade byte , set Ability base hit to 100
  001885b0: 03e00008 jr r31
+
  0018851c: 00000000 nop                     |
  001885b4: 00000000 nop
+
  00188520: 0c0614b9 jal 0x001852e4           |{{f/jal|Concentrate Calculation|Concentrate Calculation}}  Nullify the 4 Ability Evade byte if Attacker uses Concentration
 +
  00188524: 00000000 nop                     |
 +
  00188528: 0c0614ca jal 0x00185328           |{{f/jal|Dark/Confuse Caclulation |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           |{{f/jal|Abandon Calculation |Abandon Calculation }}  If target as abandon (and it is usable) --> Ability Base Hit/2
 +
  00188534: 00000000 nop                     |
 +
  00188538: 0c0614fd jal 0x001853f4           |{{f/jal|Evasion Changes due to Statuses|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          |{{f/jal|Weather effects on Bows|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           |{{f/jal|Facing Evade Calculation|Facing Evade Calculation}}  Side Attack cancels Class evasion, Back Attack additionnaly cancels Right/Left hand evasion
 +
  0018854c: 00000000 nop                     |
 +
  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                    
 +
  00188558: 8fbf0010 lw r31,0x0010(r29)      
 +
  0018855c: 27bd0018 addiu r29,r29,0x0018    
 +
  00188560: 03e00008 jr r31                  
 +
  00188564: 00000000 nop                    
 +
 
 +
=== Return Locations ===
 +
'''Battle.bin'''
 +
00188b74: [[01_Dmg_(Weapon)|Formula 01 : Dmg (Weapon)]]
 +
00188bb4: [[02_Dmg_(Weapon)|Formula 02 : Dmg (Weapon)]]
 +
00188d04: [[06_AbsHP_(Weapon)|Formula 06 : AbsHP (Weapon)]]
 +
0018972c: [[25_Equipped:_Break_Hit_(PA%2BWP%2BX)%25|Formula 25 : Equipped: Break Hit (PA+WP+X)%]]
 +
001897d0: [[26_Equipped:_Steal_Hit_(SP%2BX)%25|Formula 26 : Equipped: Steal Hit (SP+X)%]]
 +
00189838: [[27_StealGil_(CasLVL*SP)_Hit_(SP%2BX)%25|Formula 27 : StealGil (CasLVL*SP) Hit (SP+X)%]]
 +
00189880: [[28_StealExp_(Lowest_of_TarCurExp_%26_SP%2BY)_Hit_(SP%2BX)%25|Formula 28 : StealExp (Lowest of TarCurExp & SP+Y) Hit (SP+X)%]]
 +
00189aa0: [[2B_Hit_(PA%2BX)%25_//_-PA/MA/SP_(X)|Formula 2b : Hit (PA+X)% // -PA/MA/SP (X)]]
 +
00189ae8: [[2C_DmgMP_(X)%25_Hit_(PA%2BY)%25|Formula 2c : DmgMP (X)% Hit (PA+Y)%]]
 +
00189b30: [[2D_Dmg_(PA*(WP%2BY))_100%25_Status|Formula 2d : Dmg (PA*(WP+Y)) 100% Status]]
 +
00189ba4: [[2E_Equipped:Break_Dmg_(PA*WP)|Formula 2e : Equipped:Break Dmg (PA*WP)]]
 +
00189c60: [[2F_AbsMP_(PA*WP)|Formula 2f : AbsMP (PA*WP)]]
 +
00189ca0: [[30_AbsHP_(PA*WP)|Formula 30 : AbsHP (PA*WP)]]
 +
00189ce0: [[31_Dmg_((PA%2BY)/2*PA)|Formula 31 : Dmg ((PA+Y)/2*PA)]]
 +
00189d84: [[32_Dmg_(Rdm(1…X)*(PA*3%2BY))|Formula 32 : Dmg (Rdm(1…X)*(PA*3+Y))]]
 +
00189f94: [[37_Dmg_(Rdm(1…Y)*PA)|Formula 37 : Dmg (Rdm(1…Y)*PA)]]
 +
0018a3e0: [[4D_AbsHP_(Y)%25_Hit_(MA%2BX)%25|Formula 4d : AbsHP (Y)% Hit (MA+X)%]]
 +
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)