Difference between revisions of "Elemental Absorption"

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search
m
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
  Elemental Absorption
+
  No Parameters - Returns Nothing
  001870fc: 3c048019 lui r4,0x8019
+
  00187100: 8c842d90 lw r4,0x2d90(r4) Load Current Attack Data Pointer
+
If Target Current Action is Nullified (TCA Evade type = 0x05) : skip everything
  00187104: 00000000 nop
+
Check For TCA special flag 2 0x04 (Absorption)
  00187108: 90830002 lbu r3,0x0002(r4) Load ? (Current action data type - r3 = 0x05 if nullified)
+
  - '''If Absorption is ON : - Set TCA attack Type = HP recovery (0x40)'''
  0018710c: 34020005 ori r2,r0,0x0005
+
                          - Nullify TCA HP Damage
  00187110: 1062000d beq r3,r2,0x00187148 Branch if Element was nullified
+
                          - Set HP recovery amount to previous HP damage
  00187114: 00000000 nop
+
  - '''If Abosorption is OFF : Set TCA Attack Type = HP damage (0x80)'''
  00187118: 94820010 lhu r2,0x0010(r4) Load ? (to be confirmed : Load halfword in special flag location 1, so the second byte is special flag location 2)
+
  0018711c: 00000000 nop
+
Rq : Evade Type 0x05 and Absorption flag are set in [[Elemental_Damage_Modification]]
  00187120: 30420400 andi r2,r2,0x0400           (to be confirmed : 0x04 (= absorption in second special flag location two more 0 because r2 is a halfword)
+
--------------------------------------------------------------------------------------------------
  00187124: 10400006 beq r2,r0,0x00187140 Branch if element was not absorbed
+
  001870fc: 3c048019 lui r4,0x8019          
  00187128: 34020040 ori r2,r0,0x0040
+
  00187100: 8c842d90 lw r4,0x2d90(r4)         |{{f/adr|<nowiki>r4 = Target Current Action Data Pointer</nowiki>}}
  0018712c: 94830004 lhu r3,0x0004(r4) Load HP Damage
+
  00187104: 00000000 nop                     |
  00187130: a4800004 sh r0,0x0004(r4) Store HP Damage = 0
+
  00187108: 90830002 lbu r3,0x0002(r4)       |{{f/load|<nowiki>r3 = TCA Evade Type</nowiki>}}
  00187134: a0820025 sb r2,0x0025(r4) Store Attack Type = HP Recovery
+
  0018710c: 34020005 ori r2,r0,0x0005         |{{f/std|<nowiki>r2 = 0x05 (Ability Element is Nullified)</nowiki>}}
  00187138: 08061c52 j 0x00187148
+
  00187110: 1062000d beq r3,r2,0x00187148     {{f/Cond|If Current Ability is not nullified}} /Else branch to {{f/loc|END}}
  0018713c: a4830006 sh r3,0x0006(r4) Store HP Recovery = HP Damage
+
  00187114: 00000000 nop                         |
  00187140: 34020080 ori r2,r0,0x0080
+
  00187118: 94820010 lhu r2,0x0010(r4)           |{{f/load|<nowiki>r2 = TCA Special flags 1 and 2 (halfword)</nowiki>}}
  00187144: a0820025 sb r2,0x0025(r4) Store Attack Type = HP Damage
+
  0018711c: 00000000 nop                         |
  00187148: 03e00008 jr r31
+
  00187120: 30420400 andi r2,r2,0x0400           |{{f/std|r2 <> 0x00 if Absorption flag is enabled}}
  0018714c: 00000000 nop
+
  00187124: 10400006 beq r2,r0,0x00187140         {{f/Cond|If Current Ability Element is absorbed}}
 +
  00187128: 34020040 ori r2,r0,0x0040                 |{{f/std|<nowiki>r2 = 0x40</nowiki>}}
 +
  0018712c: 94830004 lhu r3,0x0004(r4)               |{{f/load|<nowiki>r3 = TCA HP damage</nowiki>}}
 +
  00187130: a4800004 sh r0,0x0004(r4)                 |{{f/store|Nullify HP damage}}
 +
  00187134: a0820025 sb r2,0x0025(r4)                 |{{f/store|Store 0x40 in TCA Attack Type (HP recovery)}}
 +
  00187138: 08061c52 j 0x00187148                     {{f/jump|Jump to END}}
 +
  0018713c: a4830006 sh r3,0x0006(r4)                 |{{f/store|Store Previous HP damage amount in HP recovery Amount}}
 +
                                                {{f/Cond|Else (Element is not Absorbed)}}
 +
  00187140: 34020080 ori r2,r0,0x0080                 |{{f/std|<nowiki>r2 = 0x80</nowiki>}}
 +
  00187144: a0820025 sb r2,0x0025(r4)                 |{{f/store|<nowiki>Store 0x80 in Attack Type = HP Damage</nowiki>}}
 +
  00187148: 03e00008 jr r31                   END
 +
  0018714c: 00000000 nop                    
  
  
== Return Locations ==
 
  
*Battle.bin
+
=== Return Locations ===
  00188684: [[Weapon Damage Calculation]]
+
'''Battle.bin'''
  00188724: [[Routine used in formula 2B]]
+
  0018868c: [[Weapon Damage Calculation]]
  001887cc: [[Elemental Absorb/Status]]
+
  0018872c: [[Elemental_Absorb_and_status_roll]]
  00188c84: [[04 Magic Gun]]
+
  001887d4: [[Elemental Absorb/Status]]
  00189b74: [[2D Dmg_(PA*(WP+Y)) 100% Status ]]
+
  00188c8c: [[04 Magic Gun]]
  00189c38: [[2E Equipped:Break Dmg_(PA*WP)]]
+
  00189b7c: [[2D Dmg_(PA*(WP+Y)) 100% Status ]]
  00189d44: [[31 Dmg_((PA+Y)/2*PA)]]
+
  00189c40: [[2E Equipped:Break Dmg_(PA*WP)]]
  0018ac2c: [[63 Dmg_(SP*WP)]]
+
  00189d4c: [[31 Dmg_((PA+Y)/2*PA)]]
 +
  0018ac34: [[63 Dmg_(SP*WP)]]

Latest revision as of 19:36, 4 April 2022

No Parameters - Returns Nothing

If Target Current Action is Nullified (TCA Evade type = 0x05) : skip everything
Check For TCA special flag 2 0x04 (Absorption)
  - If Absorption is ON : - Set TCA attack Type = HP recovery (0x40)
                          - Nullify TCA HP Damage
                          - Set HP recovery amount to previous HP damage
  - If Abosorption is OFF : Set TCA Attack Type = HP damage (0x80)

Rq : Evade Type 0x05 and Absorption flag are set in Elemental_Damage_Modification
--------------------------------------------------------------------------------------------------
001870fc: 3c048019 lui r4,0x8019           
00187100: 8c842d90 lw r4,0x2d90(r4)         |r4 = Target Current Action Data Pointer
00187104: 00000000 nop                      |
00187108: 90830002 lbu r3,0x0002(r4)        |r3 = TCA Evade Type
0018710c: 34020005 ori r2,r0,0x0005         |r2 = 0x05 (Ability Element is Nullified)
00187110: 1062000d beq r3,r2,0x00187148     #If Current Ability is not nullified /Else branch to END
00187114: 00000000 nop                          |
00187118: 94820010 lhu r2,0x0010(r4)            |r2 = TCA Special flags 1 and 2 (halfword)
0018711c: 00000000 nop                          |
00187120: 30420400 andi r2,r2,0x0400            |r2 <> 0x00 if Absorption flag is enabled
00187124: 10400006 beq r2,r0,0x00187140         #If Current Ability Element is absorbed
00187128: 34020040 ori r2,r0,0x0040                 |r2 = 0x40
0018712c: 94830004 lhu r3,0x0004(r4)                |r3 = TCA HP damage
00187130: a4800004 sh r0,0x0004(r4)                 |Nullify HP damage
00187134: a0820025 sb r2,0x0025(r4)                 |Store 0x40 in TCA Attack Type (HP recovery)
00187138: 08061c52 j 0x00187148                     >>Jump to END
0018713c: a4830006 sh r3,0x0006(r4)                 |Store Previous HP damage amount in HP recovery Amount
                                                #Else (Element is not Absorbed)
00187140: 34020080 ori r2,r0,0x0080                 |r2 = 0x80
00187144: a0820025 sb r2,0x0025(r4)                 |Store 0x80 in Attack Type = HP Damage
00187148: 03e00008 jr r31                   END
0018714c: 00000000 nop                      


Return Locations

Battle.bin
0018868c: Weapon Damage Calculation
0018872c: Elemental_Absorb_and_status_roll
001887d4: Elemental Absorb/Status
00188c8c: 04 Magic Gun
00189b7c: 2D Dmg_(PA*(WP+Y)) 100% Status 
00189c40: 2E Equipped:Break Dmg_(PA*WP)
00189d4c: 31 Dmg_((PA+Y)/2*PA)
0018ac34: 63 Dmg_(SP*WP)