Difference between revisions of "Calculate HP% damage"

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search
m
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
  Calculate % of damage
+
  No Parameters - Returns Nothing
  00186624: 3c028019 lui r2,0x8019
+
  00186628: 8c422d98 lw r2,0x2d98(r2) Load Defender's Stats
+
Set Target Current Action (TCA) HP damage to [Ability Y]% of [Target Max HP]  (Y is loaded from 0x801938fa)                                         
  0018662c: 00000000 nop
+
Enable HP damage in TCA Attack Type (preserves previous flags)
  00186630: 9443002a lhu r3,0x002a(r2) Load Defender's Max HP
+
---------------------------------------------------------------------------------------------
  00186634: 3c028019 lui r2,0x8019
+
  00186624: 3c028019 lui r2,0x8019          
  00186638: 904238fa lbu r2,0x38fa(r2) Load Abilities Y
+
  00186628: 8c422d98 lw r2,0x2d98(r2)         |{{f/adr|<nowiki>r2 = Target data pointer</nowiki>}}
  0018663c: 00000000 nop
+
  0018662c: 00000000 nop                     |
  00186640: 00620018 mult r3,r2 Max HP * Y
+
  00186630: 9443002a lhu r3,0x002a(r2)       |{{f/load|<nowiki>r3 = Target's max HP</nowiki>}}
  00186644: 3c0351eb lui r3,0x51eb
+
  00186634: 3c028019 lui r2,0x8019           |
  00186648: 00001012 mflo r2 Move to R2
+
  00186638: 904238fa lbu r2,0x38fa(r2)       |{{f/load|<nowiki>r2 = Current Ability used Ability Y</nowiki>}}
  0018664c: 3463851f ori r3,r3,0x851f
+
  0018663c: 00000000 nop                     |
  00186650: 24420063 addiu r2,r2,0x0063
+
  00186640: 00620018 mult r3,r2               |{{f/std|Target Max HP * Ability Y}}
  00186654: 00430018 mult r2,r3
+
  00186644: 3c0351eb lui r3,0x51eb           |
  00186658: 3c038019 lui r3,0x8019
+
  00186648: 00001012 mflo r2                 |{{f/std|<nowiki>r2 = Max HP * Ability Y</nowiki>}}
  0018665c: 8c632d90 lw r3,0x2d90(r3) Load Current Action Data Pointer
+
  0018664c: 3463851f ori r3,r3,0x851f         |{{f/std|<nowiki>r3 = 0x51eb851f (= 0,32 * 2^32)</nowiki>}}
  00186660: 00000000 nop
+
  00186650: 24420063 addiu r2,r2,0x0063       |{{f/std|<nowiki>r2 = Max HP * Ability Y + 99 (rouding process)</nowiki>}}
  00186664: 90620025 lbu r2,0x0025(r3) Load Attack Flag
+
  00186654: 00430018 mult r2,r3               |{{f/std|(Max HP * Ability Y + 99)* 0,32*2^32}}
  00186668: 27bdfff8 addiu r29,r29,0xfff8
+
  00186658: 3c038019 lui r3,0x8019           |
  0018666c: 34420080 ori r2,r2,0x0080
+
  0018665c: 8c632d90 lw r3,0x2d90(r3)         |{{f/adr|<nowiki>r3 = Target Current Action (TCA) data pointer</nowiki>}}
  00186670: a0620025 sb r2,0x0025(r3) Store Attack Flag as HP Damage
+
  00186660: 00000000 nop                     |
  00186674: 00001010 mfhi r2 Move Hi to r2
+
  00186664: 90620025 lbu r2,0x0025(r3)       |{{f/load|<nowiki>r2 = TCA Attack type</nowiki>}}
  00186678: 00021143 sra r2,r2,0x05
+
  00186668: 27bdfff8 addiu r29,r29,-0x0008    |
  0018667c: a4620004 sh r2,0x0004(r3) Store HP Damage
+
  0018666c: 34420080 ori r2,r2,0x0080         |{{f/std|<nowiki>r2 = Attack type enhanced with HP damage</nowiki>}}
  00186680: 27bd0008 addiu r29,r29,0x0008
+
  00186670: a0620025 sb r2,0x0025(r3)         |{{f/store|Store Updated Attack Type (HP damage flag is ON)}}
  00186684: 03e00008 jr r31
+
  00186674: 00001010 mfhi r2                 |{{f/std|<nowiki>r2 = (Max HP * Ability Y + 99)* 32/100</nowiki>}}
  00186688: 00000000 nop
+
  00186678: 00021143 sra r2,r2,0x05           |{{f/std|<nowiki>r2 = Max HP * Ability Y/100 (rounded up)</nowiki>}}
 +
  0018667c: a4620004 sh r2,0x0004(r3)         |{{f/store|Store HP Damage (Y% of Max HP)}}
 +
  00186680: 27bd0008 addiu r29,r29,0x0008    
 +
  00186684: 03e00008 jr r31                  
 +
  00186688: 00000000 nop                    
  
 
+
=== Return Locations ===
== Return Locations ==
+
'''Battle.bin'''
 
+
  00188e24: [[09 Dmg_(Y/100)% Hit_F(MA+X)%]]
*Battle.bin
+
  00188f78: [[0D Heal_(Y)% Hit_F(MA+X)%]]
  00188e1c: [[09 Dmg_(Y/100)% Hit_F(MA+X)%]]
+
  0018906c: [[0E Dmg_(Y)% Hit_F(MA+X)% 100% Status Hide Status]]
  00188f70: [[0D Heal_(Y)% Hit_F(MA+X)%]]
+
  0018910c: [[10 AbsHP_(Y)% Hit_F(MA+X)%]]
  00189064: [[0E Dmg_(Y)% Hit_F(MA+X)% 100% Status Hide Status]]
+
  00189f6c: [[35 Heal_(Y)% Hit_(PA+X)%]]
  00189104: [[10 AbsHP_(Y)% Hit_F(MA+X)%]]
+
  0018a230: [[47 AbsHP_(Y)% 100% Status]]
  00189f64: [[35 Heal_(Y)% Hit_(PA+X)%]]
+
  0018a408: [[4D AbsHP_(Y)% Hit_(MA+X)% ]]
  0018a228: [[47 AbsHP_(Y)% 100% Status]]
+
  0018a614: [[53 Dmg_(X)% Hit_(MA+X)%]]
  0018a400: [[4D AbsHP_(Y)% Hit_(MA+X)% ]]
 
  0018a60c: [[53 Dmg_(X)% Hit_(MA+X)%]]
 

Latest revision as of 19:12, 6 June 2022

No Parameters - Returns Nothing

Set Target Current Action (TCA) HP damage to [Ability Y]% of [Target Max HP]  (Y is loaded from 0x801938fa)                                           
Enable HP damage in TCA Attack Type (preserves previous flags)
---------------------------------------------------------------------------------------------
00186624: 3c028019 lui r2,0x8019           
00186628: 8c422d98 lw r2,0x2d98(r2)         |r2 = Target data pointer
0018662c: 00000000 nop                      |
00186630: 9443002a lhu r3,0x002a(r2)        |r3 = Target's max HP
00186634: 3c028019 lui r2,0x8019            |
00186638: 904238fa lbu r2,0x38fa(r2)        |r2 = Current Ability used Ability Y
0018663c: 00000000 nop                      |
00186640: 00620018 mult r3,r2               |Target Max HP * Ability Y
00186644: 3c0351eb lui r3,0x51eb            |
00186648: 00001012 mflo r2                  |r2 = Max HP * Ability Y
0018664c: 3463851f ori r3,r3,0x851f         |r3 = 0x51eb851f (= 0,32 * 2^32)
00186650: 24420063 addiu r2,r2,0x0063       |r2 = Max HP * Ability Y + 99 (rouding process)
00186654: 00430018 mult r2,r3               |(Max HP * Ability Y + 99)* 0,32*2^32
00186658: 3c038019 lui r3,0x8019            |
0018665c: 8c632d90 lw r3,0x2d90(r3)         |r3 = Target Current Action (TCA) data pointer
00186660: 00000000 nop                      |
00186664: 90620025 lbu r2,0x0025(r3)        |r2 = TCA Attack type
00186668: 27bdfff8 addiu r29,r29,-0x0008    |
0018666c: 34420080 ori r2,r2,0x0080         |r2 = Attack type enhanced with HP damage
00186670: a0620025 sb r2,0x0025(r3)         |Store Updated Attack Type (HP damage flag is ON)
00186674: 00001010 mfhi r2                  |r2 = (Max HP * Ability Y + 99)* 32/100
00186678: 00021143 sra r2,r2,0x05           |r2 = Max HP * Ability Y/100 (rounded up)
0018667c: a4620004 sh r2,0x0004(r3)         |Store HP Damage (Y% of Max HP)
00186680: 27bd0008 addiu r29,r29,0x0008     
00186684: 03e00008 jr r31                   
00186688: 00000000 nop                      

Return Locations

Battle.bin
00188e24: 09 Dmg_(Y/100)% Hit_F(MA+X)%
00188f78: 0D Heal_(Y)% Hit_F(MA+X)%
0018906c: 0E Dmg_(Y)% Hit_F(MA+X)% 100% Status Hide Status
0018910c: 10 AbsHP_(Y)% Hit_F(MA+X)%
00189f6c: 35 Heal_(Y)% Hit_(PA+X)%
0018a230: 47 AbsHP_(Y)% 100% Status
0018a408: 4D AbsHP_(Y)% Hit_(MA+X)% 
0018a614: 53 Dmg_(X)% Hit_(MA+X)%