Elemental Absorption

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search
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)