Difference between revisions of "Calculate Accuracy for Magical"

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search
m (0A Return)
m
 
Line 1: Line 1:
  Calculate Accuracy for Magical Spells
+
  No Parameters
  00188a24: 27bdffe8 addiu r29,r29,0xffe8
+
  00188a28: afbf0010 sw r31,0x0010(r29)
+
Returns r2 = 0x00 If Attack hits / Else 0x00
  00188a2c: 0c061760 jal 0x00185d80 [[Store_MA_and_X|Load MA and X]]
+
  00188a30: 00000000 nop
+
Set Ability XA (MA) and YA (Ability X)
  00188a34: 0c0617ff jal 0x00185ffc [[Elemental_Strengthen]]
+
Modify XA (Status / Support / Compat / Element strengthened)
  00188a38: 00000000 nop
+
Modify YA (Compatibility)
  00188a3c: 0c0621d1 jal 0x00188744 [[Magical_Support/Status/Compat]]
+
Add XA and YA to becomes Hit% (it is stored in Target Current Action HP damage (0x04))
  00188a40: 00000000 nop
+
Modify Hit% with Faith (while sotred in HP damage)
  00188a44: 0c061967 jal 0x0018659c [[Set_XA_%2B_YA_for_Status_Formulas_(Stupid_section)|XA + YA for Accuracy]]
+
Roll Hit% Vs Random (from 0 to 100)
  00188a48: 00000000 nop
+
  - Returns r2 = 0x01 if Attack misses
  00188a4c: 0c061c54 jal 0x00187150 [[Faith Calculation]]
+
  - Returns r2 = 0x00 if Attack hits
  00188a50: 00000000 nop
+
---------------------------------------------------------------------------------------------
  00188a54: 0c061d44 jal 0x00187510 [[Set XA*YA as hit%]]
+
  00188a24: 27bdffe8 addiu r29,r29,-0x0018   
  00188a58: 00000000 nop
+
  00188a28: afbf0010 sw r31,0x0010(r29)      
  00188a5c: 3c028019 lui r2,0x8019
+
  00188a2c: 0c061760 jal 0x00185d80           |{{f/jal|Store_MA_and_X|Load MA and X}} Set Ability XA = Attacker's MA and YA = used Ability X
  00188a60: 8c422d90 lw r2,0x2d90(r2) Current Action Data Pointer
+
  00188a30: 00000000 nop                     |
  00188a64: 00000000 nop
+
  00188a34: 0c0617ff jal 0x00185ffc           |{{f/jal|Elemental_Strengthen|Elemental_Strengthen}} XA +25% if used Ability elements is strengthened
  00188a68: 90420000 lbu r2,0x0000(r2)
+
  00188a38: 00000000 nop                     |
  00188a6c: 00000000 nop
+
  00188a3c: 0c0621d1 jal 0x00188744           |{{f/jal|Magical_Support/Status/Compat|Magical_Support/Status/Compat}} Modifiy XA (Status / Support / Compatibility)
  00188a70: 2c420001 sltiu r2,r2,0x0001
+
  00188a40: 00000000 nop                     |
  00188a74: 8fbf0010 lw r31,0x0010(r29)
+
  00188a44: 0c061967 jal 0x0018659c           |{{f/jal|Set_XA_%2B_YA_for_Status_Formulas_(Stupid_section)|XA + YA for Accuracy }} XA+YA becomes TCA HP damage (YA is processed via compatibility)
  00188a78: 27bd0018 addiu r29,r29,0x0018
+
  00188a48: 00000000 nop                     |
  00188a7c: 03e00008 jr r31
+
  00188a4c: 0c061c54 jal 0x00187150           |{{f/jal|Faith Calculation|Faith Calculation}} HP damage becomes Base HP damage * Target faith/100 * Attacker faith/100
  00188a80: 00000000 nop
+
  00188a50: 00000000 nop                     |
 
+
  00188a54: 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
Returns locations (in progress)
+
  00188a58: 00000000 nop                     |
 +
  00188a5c: 3c028019 lui r2,0x8019           |
 +
  00188a60: 8c422d90 lw r2,0x2d90(r2)         |{{f/adr|<nowiki>r2 = TCA data pointer</nowiki>}}
 +
  00188a64: 00000000 nop                     |
 +
  00188a68: 90420000 lbu r2,0x0000(r2)       |{{f/load|<nowiki>r2 = TCA hit flag</nowiki>}}
 +
  00188a6c: 00000000 nop                     |
 +
  00188a70: 2c420001 sltiu r2,r2,0x0001       r2 = 0x01 if Action misses / Else r2 = 0x00
 +
  00188a74: 8fbf0010 lw r31,0x0010(r29)      
 +
  00188a78: 27bd0018 addiu r29,r29,0x0018    
 +
  00188a7c: 03e00008 jr r31                  
 +
  00188a80: 00000000 nop  
 +
=== Returns locations ===
 +
'''Battle.bin'''
 
  00188e14: [[09_Dmg_(Y/100)%25_Hit_F(MA%2BX)%25|Formula 09 - Dmg (Y/100)% Hit F(MA+X)%]]
 
  00188e14: [[09_Dmg_(Y/100)%25_Hit_F(MA%2BX)%25|Formula 09 - Dmg (Y/100)% Hit F(MA+X)%]]
 
  00188e98: [[0A_Hit_F(MA%2BX)%25|Formula 0A - Hit F(MA+X)%]]
 
  00188e98: [[0A_Hit_F(MA%2BX)%25|Formula 0A - Hit F(MA+X)%]]
 
  0018935c: [[1B_DmgMP_(MA%2BY)%25_Hit_F(X)%25|Formula 1B - DmgMP (MA+Y)% Hit F(X)%]]
 
  0018935c: [[1B_DmgMP_(MA%2BY)%25_Hit_F(X)%25|Formula 1B - DmgMP (MA+Y)% Hit F(X)%]]
 
  0018ab38: [[61_–Brave_(Y)_Hit_F(MA%2BX)%25|Formula 61 - –Brave (Y) Hit F(MA+X)%]]
 
  0018ab38: [[61_–Brave_(Y)_Hit_F(MA%2BX)%25|Formula 61 - –Brave (Y) Hit F(MA+X)%]]

Latest revision as of 19:19, 14 April 2022

No Parameters 

Returns r2 = 0x00 If Attack hits / Else 0x00

Set Ability XA (MA) and YA (Ability X)
Modify XA (Status / Support / Compat / Element strengthened)
Modify YA (Compatibility)
Add XA and YA to becomes Hit% (it is stored in Target Current Action HP damage (0x04))
Modify Hit% with Faith (while sotred in HP damage)
Roll Hit% Vs Random (from 0 to 100)
 - Returns r2 = 0x01 if Attack misses
 - Returns r2 = 0x00 if Attack hits
---------------------------------------------------------------------------------------------
00188a24: 27bdffe8 addiu r29,r29,-0x0018    
00188a28: afbf0010 sw r31,0x0010(r29)       
00188a2c: 0c061760 jal 0x00185d80           |-->Load MA and X Set Ability XA = Attacker's MA and YA = used Ability X
00188a30: 00000000 nop                      |
00188a34: 0c0617ff jal 0x00185ffc           |-->Elemental_Strengthen XA +25% if used Ability elements is strengthened
00188a38: 00000000 nop                      |
00188a3c: 0c0621d1 jal 0x00188744           |-->Magical_Support/Status/Compat Modifiy XA (Status / Support / Compatibility)
00188a40: 00000000 nop                      |
00188a44: 0c061967 jal 0x0018659c           |-->XA + YA for Accuracy  XA+YA becomes TCA HP damage (YA is processed via compatibility)
00188a48: 00000000 nop                      |
00188a4c: 0c061c54 jal 0x00187150           |-->Faith Calculation HP damage becomes Base HP damage * Target faith/100 * Attacker faith/100
00188a50: 00000000 nop                      |
00188a54: 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
00188a58: 00000000 nop                      |
00188a5c: 3c028019 lui r2,0x8019            |
00188a60: 8c422d90 lw r2,0x2d90(r2)         |r2 = TCA data pointer
00188a64: 00000000 nop                      |
00188a68: 90420000 lbu r2,0x0000(r2)        |r2 = TCA hit flag
00188a6c: 00000000 nop                      |
00188a70: 2c420001 sltiu r2,r2,0x0001       r2 = 0x01 if Action misses / Else r2 = 0x00
00188a74: 8fbf0010 lw r31,0x0010(r29)       
00188a78: 27bd0018 addiu r29,r29,0x0018     
00188a7c: 03e00008 jr r31                   
00188a80: 00000000 nop   

Returns locations

Battle.bin
00188e14: Formula 09 - Dmg (Y/100)% Hit F(MA+X)%
00188e98: Formula 0A - Hit F(MA+X)%
0018935c: Formula 1B - DmgMP (MA+Y)% Hit F(X)%
0018ab38: Formula 61 - –Brave (Y) Hit F(MA+X)%