Difference between revisions of "Gravi2 Damage Routine"

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search
m (Return links)
m
Line 1: Line 1:
<font face='Courier New'>
+
No Parameters - Returns nothing
 
   
 
   
  001866ec: 3c038019 lui r3,0x8019
+
Set Target Current Action (TCA) HP damage = Target current HP - 1 (Target is left with 1 HP)
  001866f0: 8c632d98 lw r3,0x2d98(r3)
+
Set TCA Attack type = HP damage
  001866f4: 00000000 nop
+
-----------------------------------------------------------------------------------------
  001866f8: 94620028 lhu r2,0x0028(r3)
+
  001866ec: 3c038019 lui r3,0x8019           |
  001866fc: 00000000 nop
+
  001866f0: 8c632d98 lw r3,0x2d98(r3)         |{{f/adr|<nowiki>r3 = Target data pointer</nowiki>}}
  00186700: 10400007 beq r2,r0,0x00186720
+
  001866f4: 00000000 nop                     |
  00186704: 00000000 nop
+
  001866f8: 94620028 lhu r2,0x0028(r3)       |{{f/load|<nowiki>r2 = Target current HP</nowiki>}}
  00186708: 94620028 lhu r2,0x0028(r3)
+
  001866fc: 00000000 nop                     |
  0018670c: 3c038019 lui r3,0x8019
+
  00186700: 10400007 beq r2,r0,0x00186720     {{f/Cond|If Target HP <> 0x00}}
  00186710: 8c632d90 lw r3,0x2d90(r3)
+
  00186704: 00000000 nop                         |
  00186714: 2442ffff addiu r2,r2,0xffff
+
  00186708: 94620028 lhu r2,0x0028(r3)           |{{f/load|<nowiki>r2 = Target Current HP</nowiki>}}
  00186718: 080619cc j 0x00186730
+
  0018670c: 3c038019 lui r3,0x8019               |
  0018671c: a4620004 sh r2,0x0004(r3)
+
  00186710: 8c632d90 lw r3,0x2d90(r3)             |{{f/adr|<nowiki>r3 = Target Current Action (TCA) data pointer</nowiki>}}
  00186720: 3c028019 lui r2,0x8019
+
  00186714: 2442ffff addiu r2,r2,-0x0001          |{{f/std|<nowiki>r2 = Target Current HP - 1</nowiki>}}
  00186724: 8c422d90 lw r2,0x2d90(r2)
+
  00186718: 080619cc j 0x00186730                 {{f/jump|<nowiki>Jump After HP = 0 section</nowiki>}}
  00186728: 00000000 nop
+
  0018671c: a4620004 sh r2,0x0004(r3)             |{{f/store|<nowiki>Set TCA HP damage = Current HP - 1</nowiki>}}
  0018672c: a4400004 sh r0,0x0004(r2)
+
                                            {{f/Cond|Else : Target HP is 0x00}}
  00186730: 3c038019 lui r3,0x8019
+
  00186720: 3c028019 lui r2,0x8019               |
  00186734: 8c632d90 lw r3,0x2d90(r3)
+
  00186724: 8c422d90 lw r2,0x2d90(r2)             |{{f/adr|<nowiki>r2 = TCA data pointer</nowiki>}}
  00186738: 34020080 ori r2,r0,0x0080
+
  00186728: 00000000 nop                         |
  0018673c: 03e00008 jr r31
+
  0018672c: a4400004 sh r0,0x0004(r2)             |{{f/store|<nowiki>Set TCA HP damage = 0x00</nowiki>}}
  00186740: a0620025 sb r2,0x0025(r3)
+
  00186730: 3c038019 lui r3,0x8019           |
</font>
+
  00186734: 8c632d90 lw r3,0x2d90(r3)         |{{f/adr|<nowiki>r3 = TCA data pointer</nowiki>}}
 
+
  00186738: 34020080 ori r2,r0,0x0080         |{{f/std|<nowiki>r2 = 0x80 (HP damage Attack type</nowiki>}}
Return location
+
  0018673c: 03e00008 jr r31                   |
 +
  00186740: a0620025 sb r2,0x0025(r3)         |{{f/store|<nowiki>Set TCA Attack type = HP damage</nowiki>}}
 +
=== Return locations ===
 +
'''Battle.bin'''
 
  0018928c: [[17_Dmg_(TarCurHP-1)_Hit_F(MA%2BX)%25|Formula 17 - Dmg (TarCurHP-1) Hit F(MA+X)%]]
 
  0018928c: [[17_Dmg_(TarCurHP-1)_Hit_F(MA%2BX)%25|Formula 17 - Dmg (TarCurHP-1) Hit F(MA+X)%]]
 
  0018a01c: [[3E_Dmg_(TarMaxHP-1)|Formula 3E - Dmg (TarMaxHP-1)]]
 
  0018a01c: [[3E_Dmg_(TarMaxHP-1)|Formula 3E - Dmg (TarMaxHP-1)]]

Revision as of 19:00, 17 April 2022

No Parameters - Returns nothing

Set Target Current Action (TCA) HP damage = Target current HP - 1 (Target is left with 1 HP)
Set TCA Attack type = HP damage
----------------------------------------------------------------------------------------- 
001866ec: 3c038019 lui r3,0x8019            |
001866f0: 8c632d98 lw r3,0x2d98(r3)         |r3 = Target data pointer
001866f4: 00000000 nop                      |
001866f8: 94620028 lhu r2,0x0028(r3)        |r2 = Target current HP
001866fc: 00000000 nop                      |
00186700: 10400007 beq r2,r0,0x00186720     #If Target HP <> 0x00
00186704: 00000000 nop                          |
00186708: 94620028 lhu r2,0x0028(r3)            |r2 = Target Current HP
0018670c: 3c038019 lui r3,0x8019                |
00186710: 8c632d90 lw r3,0x2d90(r3)             |r3 = Target Current Action (TCA) data pointer
00186714: 2442ffff addiu r2,r2,-0x0001          |r2 = Target Current HP - 1
00186718: 080619cc j 0x00186730                 >>Jump After HP = 0 section
0018671c: a4620004 sh r2,0x0004(r3)             |Set TCA HP damage = Current HP - 1
                                            #Else : Target HP is 0x00
00186720: 3c028019 lui r2,0x8019                |
00186724: 8c422d90 lw r2,0x2d90(r2)             |r2 = TCA data pointer
00186728: 00000000 nop                          |
0018672c: a4400004 sh r0,0x0004(r2)             |Set TCA HP damage = 0x00
00186730: 3c038019 lui r3,0x8019            |
00186734: 8c632d90 lw r3,0x2d90(r3)         |r3 = TCA data pointer
00186738: 34020080 ori r2,r0,0x0080         |r2 = 0x80 (HP damage Attack type
0018673c: 03e00008 jr r31                   |
00186740: a0620025 sb r2,0x0025(r3)         |Set TCA Attack type = HP damage

Return locations

Battle.bin
0018928c: Formula 17 - Dmg (TarCurHP-1) Hit F(MA+X)%
0018a01c: Formula 3E - Dmg (TarMaxHP-1)