Difference between revisions of "Calculate Accuracy for Magical Spells"

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search
(Created page with " Calculate Accuracy for Magical Spells (No elemental boost) 001889cc: 27bdffe8 addiu r29,r29,0xffe8 001889d0: afbf0010 sw r31,0x0010(r29) 001889d4: 0c061760 jal 0x00185...")
 
m
 
(5 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 
  Calculate Accuracy for Magical Spells (No elemental boost)
 
  Calculate Accuracy for Magical Spells (No elemental boost)
  001889cc: 27bdffe8 addiu r29,r29,0xffe8
+
  001889d0: afbf0010 sw r31,0x0010(r29)
+
No Parameters
  001889d4: 0c061760 jal 0x00185d80 Load MA + X
+
 
  001889d8: 00000000 nop
+
Returns r2 = 0x00 if Attack hits / Else 0x01
  001889dc: 0c0621d1 jal 0x00188744 Magical Support/Status/Compat
+
  001889e0: 00000000 nop
+
Set Ability XA and YA, modify XA with Support/Status/Compatibility
  001889e4: 0c061967 jal 0x0018659c XA + YA for Accuracy
+
Set HP damage as XA+YA, modify HP damage with Faith and use it as Hit%
  001889e8: 00000000 nop
+
----------------------------------------------------------------------------------
  001889ec: 0c061c54 jal 0x00187150 Faith Calculation
+
  001889cc: 27bdffe8 addiu r29,r29,-0x0018   
  001889f0: 00000000 nop
+
  001889d0: afbf0010 sw r31,0x0010(r29)       |
  001889f4: 0c061d44 jal 0x00187510 ???
+
  001889d4: 0c061760 jal 0x00185d80           |{{f/jal|Store MA and X|Store MA and X}} Set Ability XA = Attacker's MA and YA = used Ability X
  001889f8: 00000000 nop
+
  001889d8: 00000000 nop                     |
  001889fc: 3c028019 lui r2,0x8019
+
  001889dc: 0c0621d1 jal 0x00188744           |{{f/jal|Magical Support/Status/Compat|Magical Support/Status/Compat}} Modify Ability XA (Support Abilities, Status, Compatibility)
  00188a00: 8c422d90 lw r2,0x2d90(r2) Current Action Data Pointer
+
  001889e0: 00000000 nop                     |
  00188a04: 00000000 nop
+
  001889e4: 0c061967 jal 0x0018659c           |{{f/jal|Set XA + YA for Status Formulas (Stupid section)|Set XA + YA for Status Formulas (Stupid section)}} XA+YA becomes TCA HP damage (YA is processed via compatibility)
  00188a08: 90420000 lbu r2,0x0000(r2)
+
  001889e8: 00000000 nop                     |
  00188a0c: 00000000 nop
+
  001889ec: 0c061c54 jal 0x00187150           |{{f/jal|Faith Calculation|Faith Calculation}} HP damage becomes Base HP damage * Target faith/100 * Attacker faith/100
  00188a10: 2c420001 sltiu r2,r2,0x0001
+
  001889f0: 00000000 nop                     |
  00188a14: 8fbf0010 lw r31,0x0010(r29)
+
  001889f4: 0c061d44 jal 0x00187510           |{{f/jal|Uses_HP_damage_as_Action_hit%25|Uses_HP_damage_as_Action_hit%}} HP damage becomes Hit% - Roll Hit% vs random (0 to 100), Set Action hit flag to miss if it fails
  00188a18: 27bd0018 addiu r29,r29,0x0018
+
  001889f8: 00000000 nop                     |
  00188a1c: 03e00008 jr r31
+
  001889fc: 3c028019 lui r2,0x8019           |
 +
  00188a00: 8c422d90 lw r2,0x2d90(r2)         |{{f/adr|<nowiki>r2 = Target Current action (TCA) data pointer</nowiki>}}
 +
  00188a04: 00000000 nop                     |
 +
  00188a08: 90420000 lbu r2,0x0000(r2)       |{{f/load|<nowiki>r2 = TCA hit flag</nowiki>}}
 +
  00188a0c: 00000000 nop                     |
 +
  00188a10: 2c420001 sltiu r2,r2,0x0001       |{{f/std|<nowiki>r2 = 0x01 if Attack miss / Else 0x00</nowiki>}}
 +
  00188a14: 8fbf0010 lw r31,0x0010(r29)       |
 +
  00188a18: 27bd0018 addiu r29,r29,0x0018    
 +
  00188a1c: 03e00008 jr r31                  
 
  00188a20: 00000000 nop
 
  00188a20: 00000000 nop
 +
=== Return locations ===
 +
'''Battle.bin'''
 +
001890a4: [[0F_AbsMP_(Y)%25_Hit_F(MA%2BX)%25|Formula 0F - AbsMP (Y)% Hit F(MA+X)%]]
 +
001890fc: [[10_AbsHP_(Y)%25_Hit_F(MA%2BX)%25|Formula 10 - AbsHP (Y)% Hit F(MA+X)%]]
 +
001891cc: [[15_Set_CT00_Hit_F(MA%2BX)%25|Formula 15 - Set CT00 Hit F(MA+X)%]]
 +
00189224: [[16_DmgMP_(TarCurMP)_Hit_F(MA%2BX)%25|Formula 16 - DmgMP (TarCurMP) Hit F(MA+X)%]]
 +
0018927c: [[17_Dmg_(TarCurHP-1)_Hit_F(MA%2BX)%25|Formula 17 - Dmg (TarCurHP-1) Hit F(MA+X)% ]]

Latest revision as of 19:05, 16 April 2022

Calculate Accuracy for Magical Spells (No elemental boost)

No Parameters
 
Returns r2 = 0x00 if Attack hits / Else 0x01

Set Ability XA and YA, modify XA with Support/Status/Compatibility
Set HP damage as XA+YA, modify HP damage with Faith and use it as Hit%
----------------------------------------------------------------------------------
001889cc: 27bdffe8 addiu r29,r29,-0x0018    
001889d0: afbf0010 sw r31,0x0010(r29)       |
001889d4: 0c061760 jal 0x00185d80           |-->Store MA and X Set Ability XA = Attacker's MA and YA = used Ability X
001889d8: 00000000 nop                      |
001889dc: 0c0621d1 jal 0x00188744           |-->Magical Support/Status/Compat Modify Ability XA (Support Abilities, Status, Compatibility)
001889e0: 00000000 nop                      |
001889e4: 0c061967 jal 0x0018659c           |-->Set XA + YA for Status Formulas (Stupid section) XA+YA becomes TCA HP damage (YA is processed via compatibility)
001889e8: 00000000 nop                      |
001889ec: 0c061c54 jal 0x00187150           |-->Faith Calculation HP damage becomes Base HP damage * Target faith/100 * Attacker faith/100
001889f0: 00000000 nop                      |
001889f4: 0c061d44 jal 0x00187510           |-->Uses_HP_damage_as_Action_hit% HP damage becomes Hit% - Roll Hit% vs random (0 to 100), Set Action hit flag to miss if it fails
001889f8: 00000000 nop                      |
001889fc: 3c028019 lui r2,0x8019            |
00188a00: 8c422d90 lw r2,0x2d90(r2)         |r2 = Target Current action (TCA) data pointer
00188a04: 00000000 nop                      |
00188a08: 90420000 lbu r2,0x0000(r2)        |r2 = TCA hit flag
00188a0c: 00000000 nop                      |
00188a10: 2c420001 sltiu r2,r2,0x0001       |r2 = 0x01 if Attack miss / Else 0x00
00188a14: 8fbf0010 lw r31,0x0010(r29)       |
00188a18: 27bd0018 addiu r29,r29,0x0018     
00188a1c: 03e00008 jr r31                   
00188a20: 00000000 nop

Return locations

Battle.bin
001890a4: Formula 0F - AbsMP (Y)% Hit F(MA+X)%
001890fc: Formula 10 - AbsHP (Y)% Hit F(MA+X)%
001891cc: Formula 15 - Set CT00 Hit F(MA+X)%
00189224: Formula 16 - DmgMP (TarCurMP) Hit F(MA+X)%
0018927c: Formula 17 - Dmg (TarCurHP-1) Hit F(MA+X)%