Difference between revisions of "Weapon Damage Calculation"

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search
m
 
(4 intermediate revisions by 4 users not shown)
Line 1: Line 1:
  00188638: 27bdffe8 addiu r29,r29,0xffe8
+
No Parameters
  0018863c: afbf0010 sw r31,0x0010(r29)
+
  00188640: 0c0616a7 jal 0x00185a9c Base XA Calculation for each Weapon
+
Returns r2 = 0x00 if Proc is Triggered (else 0x00)
  00188644: 00000000 nop
+
  00188648: 0c0617e0 jal 0x00185f80 Charge Calculation
+
Set Ability XA and YA, turns XA and YA in HP damage
  0018864c: 00000000 nop
+
Deals with Elements : - If Absorbed : HP damage becomes HP recovery
  00188650: 0c0617e9 jal 0x00185fa4 Weapon Element Strengthen Calculation
+
                      - If Nullified : Nullify Action
  00188654: 00000000 nop
+
                      - If Halved/Weakness : Modify HP damage
  00188658: 0c0621a9 jal 0x001886a4 [[Damage Calculation]]
+
Roll Proc Effects (19% of chances) : returns r2 = 0x00 if Proc is Triggered
  0018865c: 00000000 nop
+
---------------------------------------------------------------------------------------
  00188660: 0c061bf4 jal 0x00186fd0 Elemental Damage Modification
+
  00188638: 27bdffe8 addiu r29,r29,-0x0018    |
  00188664: 00000000 nop
+
  0018863c: afbf0010 sw r31,0x0010(r29)       |
  00188668: 3c028019 lui r2,0x8019
+
  00188640: 0c0616a7 jal 0x00185a9c           |{{f/jal|Base XA Calculation|Base XA Calculation}}  Set XA and YA (Based on Weapon Type)
  0018866c: 8c422d90 lw r2,0x2d90(r2) Load Target Current Action Data Pointer
+
  00188644: 00000000 nop                     |
  00188670: 00000000 nop
+
  00188648: 0c0617e0 jal 0x00185f80           |{{f/jal|Charge Calculation|Charge Calculation}}  Add Power Charge to XA
  00188674: 90420000 lbu r2,0x0000(r2) Load Able to hit Flag
+
  0018864c: 00000000 nop                     |
  00188678: 00000000 nop
+
  00188650: 0c0617e9 jal 0x00185fa4           |{{f/jal|Weapon Element Strengthen |Weapon Element Strengthen }} XA + 25% if Weapon Element is strengthened
  0018867c: 10400005 beq r2,r0,0x00188694 Branch if Attack was Evaded/Nulled
+
  00188654: 00000000 nop                     |
  00188680: 34020001 ori r2,r0,0x0001 r2 = 1
+
  00188658: 0c0621a9 jal 0x001886a4           |{{f/jal|Damage Calculation|Damage Calculation}}  Modify XA (Support-Statuses-Compat-Critical Hit), Might add Knockback, Set TCA HP damage to XA*YA
  00188684: 0c061c3f jal 0x001870fc Elemental Absorption
+
  0018865c: 00000000 nop                     |
  00188688: 00000000 nop
+
  00188660: 0c061bf4 jal 0x00186fd0           |{{f/jal|Elemental Damage Modification (Prep) |Elemental Damage Modification (Prep) }} Cancel Action // Enable Absorption flags and/or Modify HP damage
  0018868c: 0c062130 jal 0x001884c0 Proc Rate Trigger
+
  00188664: 00000000 nop                     |
  00188690: 00000000 nop
+
  00188668: 3c028019 lui r2,0x8019           |
  00188694: 8fbf0010 lw r31,0x0010(r29)
+
  0018866c: 8c422d90 lw r2,0x2d90(r2)         |{{f/adr|<nowiki>r2 =Target Current Action (TCA)  Data Pointer</nowiki>}}
  00188698: 27bd0018 addiu r29,r29,0x0018
+
  00188670: 00000000 nop                     |
  0018869c: 03e00008 jr r31
+
  00188674: 90420000 lbu r2,0x0000(r2)       |{{f/load|<nowiki>r2 = TCA Hit flag</nowiki>}}  {{f/std| Set to Miss (0x00) if Nullified by Elemental routines}}
  001886a0: 00000000 nop
+
  00188678: 00000000 nop                     |
 +
  0018867c: 10400005 beq r2,r0,0x00188694     {{f/Cond|If Target Current Action is Not Nullified by elements}}
 +
  00188680: 34020001 ori r2,r0,0x0001         |{{f/std|<nowiki>r2 = 0x01</nowiki>}}
 +
  00188684: 0c061c3f jal 0x001870fc               |{{f/jal|Elemental Absorption|Elemental Absorption}} HP damage becomes HP recovery - Changes Attack Type from 0x80 to 0x40 (HP recovery)
 +
  00188688: 00000000 nop                         |
 +
  0018868c: 0c062130 jal 0x001884c0               |{{f/jal|Conditional Status Proc Roll (19%)|Conditional Status Proc Roll (19%)}} Returns r2 = 0x00 if Proc is triggered (and enables TCA special flag 2 0x02)
 +
  00188690: 00000000 nop                         |
 +
  00188694: 8fbf0010 lw r31,0x0010(r29)       END
 +
  00188698: 27bd0018 addiu r29,r29,0x0018    
 +
  0018869c: 03e00008 jr r31                  
 +
  001886a0: 00000000 nop                    
 +
 
 +
'''Return Locations'''
 +
00188b84: [[01 Dmg (Weapon)|Formula 01 - Dmg (Weapon)]]
 +
00188bc4: [[02_Dmg_(Weapon)|Formula 02 - Dmg (Weapon)]]

Latest revision as of 20:24, 5 April 2022

No Parameters

Returns r2 = 0x00 if Proc is Triggered (else 0x00)

Set Ability XA and YA, turns XA and YA in HP damage
Deals with Elements : - If Absorbed : HP damage becomes HP recovery
                      - If Nullified : Nullify Action 
                      - If Halved/Weakness : Modify HP damage
Roll Proc Effects (19% of chances) : returns r2 = 0x00 if Proc is Triggered
---------------------------------------------------------------------------------------
00188638: 27bdffe8 addiu r29,r29,-0x0018    |
0018863c: afbf0010 sw r31,0x0010(r29)       |
00188640: 0c0616a7 jal 0x00185a9c           |-->Base XA Calculation  Set XA and YA (Based on Weapon Type)
00188644: 00000000 nop                      |
00188648: 0c0617e0 jal 0x00185f80           |-->Charge Calculation  Add Power Charge to XA
0018864c: 00000000 nop                      |
00188650: 0c0617e9 jal 0x00185fa4           |-->Weapon Element Strengthen  XA + 25% if Weapon Element is strengthened
00188654: 00000000 nop                      |
00188658: 0c0621a9 jal 0x001886a4           |-->Damage Calculation  Modify XA (Support-Statuses-Compat-Critical Hit), Might add Knockback, Set TCA HP damage to XA*YA
0018865c: 00000000 nop                      |
00188660: 0c061bf4 jal 0x00186fd0           |-->Elemental Damage Modification (Prep)  Cancel Action // Enable Absorption flags and/or Modify HP damage
00188664: 00000000 nop                      |
00188668: 3c028019 lui r2,0x8019            |
0018866c: 8c422d90 lw r2,0x2d90(r2)         |r2 =Target Current Action (TCA)  Data Pointer
00188670: 00000000 nop                      |
00188674: 90420000 lbu r2,0x0000(r2)        |r2 = TCA Hit flag    Set to Miss (0x00) if Nullified by Elemental routines
00188678: 00000000 nop                      |
0018867c: 10400005 beq r2,r0,0x00188694     #If Target Current Action is Not Nullified by elements
00188680: 34020001 ori r2,r0,0x0001         |r2 = 0x01
00188684: 0c061c3f jal 0x001870fc               |-->Elemental Absorption HP damage becomes HP recovery - Changes Attack Type from 0x80 to 0x40 (HP recovery)
00188688: 00000000 nop                          |
0018868c: 0c062130 jal 0x001884c0               |-->Conditional Status Proc Roll (19%) Returns r2 = 0x00 if Proc is triggered (and enables TCA special flag 2 0x02)
00188690: 00000000 nop                          |
00188694: 8fbf0010 lw r31,0x0010(r29)       END
00188698: 27bd0018 addiu r29,r29,0x0018     
0018869c: 03e00008 jr r31                   
001886a0: 00000000 nop                      

Return Locations

00188b84: Formula 01 - Dmg (Weapon)
00188bc4: Formula 02 - Dmg (Weapon)