Difference between revisions of "0E Dmg (Y)% Hit F(MA+X)% 100% Status Hide Status"

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search
m (routines links)
 
Line 1: Line 1:
  0e]
+
If Target is undead, the ability will be considered as friendly (no evasion, no Magic defense up etc..)
  00188f90: 3c028019 lui r2,0x8019
+
Uses 0x801938e6 as Undead reverse flag (never seen this before)
  00188f94: 8c422d98 lw r2,0x2d98(r2) Load Defender's Stats
+
Status infliction is mandatory : if not inflicted, Action will miss
  00188f98: 27bdffe8 addiu r29,r29,0xffe8
+
  00188f9c: afbf0010 sw r31,0x0010(r29)
+
Note : could be glitchy if inflicted status is not in 1st set
  00188fa0: 90420058 lbu r2,0x0058(r2) Load Status Table
+
----------------------------------------------------------------------------------------------
  00188fa4: 00000000 nop
+
  00188f90: 3c028019 lui r2,0x8019           |
  00188fa8: 30420010 andi r2,r2,0x0010
+
  00188f94: 8c422d98 lw r2,0x2d98(r2)         |{{f/adr|<nowiki>r2 = Target Data pointer</nowiki>}}
  00188fac: 10400005 beq r2,r0,0x 00188fc4      Undead Check
+
  00188f98: 27bdffe8 addiu r29,r29,-0x0018    |
  00188fb0: 34020001 ori r2,r0,0x0001
+
  00188f9c: afbf0010 sw r31,0x0010(r29)       |
  00188fb4: 3c018019 lui r1,0x8019
+
  00188fa0: 90420058 lbu r2,0x0058(r2)       |{{f/load|<nowiki>r2 = Target Current Status (1st set)</nowiki>}}
  00188fb8: a02238e6 sb r2,0x38e6(r1)            Undead Reverse Flag; target is undead.
+
  00188fa4: 00000000 nop                     |
  00188fbc: 080623f7 j 0x 00188fdc
+
  00188fa8: 30420010 andi r2,r2,0x0010       |{{f/std|<nowiki>r2 = 0x10 if Target is undead</nowiki>}}
  00188fc0: 00000000 nop
+
  00188fac: 10400005 beq r2,r0,0x00188fc4    {{f/Cond|If Target is Undead}}
  00188fc4: 3c018019 lui r1,0x8019
+
  00188fb0: 34020001 ori r2,r0,0x0001             |{{f/std|<nowiki>r2 = 0x01</nowiki>}}
  00188fc8: a02038e6 sb r0,0x38e6(r1)            Undead Reverse Flag; target is not undead
+
  00188fb4: 3c018019 lui r1,0x8019               |
  00188fcc: 0c06216e jal 0x 001885b8               [[Magical_Evade_Calculation]]
+
  00188fb8: a02238e6 sb r2,0x38e6(r1)            |{{f/store|Set 0x801938e6 to 0x01}} Undead reversal flag ? {{f/std| 801938e6}}
  00188fd0: 00000000 nop
+
  00188fbc: 080623f7 j 0x00188fdc                {{f/jump|jump skipping Evasion}}
  00188fd4: 14400027 bne r2,r0,0x 00189074
+
  00188fc0: 00000000 nop                         |
  00188fd8: 00000000 nop
+
                                            {{f/Cond|Else : Target is not Undead}}
  00188fdc: 0c061760 jal 0x 00185d80              [[Store_MA_and_X]]
+
  00188fc4: 3c018019 lui r1,0x8019               |
  00188fe0: 00000000 nop
+
  00188fc8: a02038e6 sb r0,0x38e6(r1)            |{{f/store|Clear 0x801938e6 : Target is not Undead}}
  00188fe4: 0c0617ff jal 0x 00185ffc              [[Elemental_Strengthen]]
+
  00188fcc: 0c06216e jal 0x001885b8               |{{f/jal|Magical_Evade_Calculation|Magical_Evade_Calculation}} If Abillity is evadeable roll Ability Evade byte against Ability base Hit
  00188fe8: 00000000 nop
+
  00188fd0: 00000000 nop                         |
  00188fec: 0c061881 jal 0x 00186204              [[Magic_Attack_Up_routine]]
+
  00188fd4: 14400027 bne r2,r0,0x00189074        {{f/Cond|If Attack Miss : Branch to}} {{f/loc|END}}
  00188ff0: 00000000 nop
+
  00188fd8: 00000000 nop                            
  00188ff4: 3c028019 lui r2,0x8019
+
  00188fdc: 0c061760 jal 0x00185d80          |{{f/jal|Store_MA_and_X|Store_MA_and_X}} Set Ability XA = Attacker's MA and YA = used Ability X
  00188ff8: 904238e6 lbu r2,0x38e6(r2)
+
  00188fe0: 00000000 nop                     |
  00188ffc: 00000000 nop
+
  00188fe4: 0c0617ff jal 0x00185ffc          |{{f/jal|Elemental_Strengthen|Elemental_Strengthen}} XA +25% if used Ability elements is strengthened
  00189000: 14400005 bne r2,r0,0x 00189018      Branch only if not against undead
+
  00188fe8: 00000000 nop                     |
  00189004: 00000000 nop
+
  00188fec: 0c061881 jal 0x00186204          |{{f/jal|Magic_Attack_Up_routine|Magic_Attack_Up_routine}} Ability XA +33% If Attacker uses Magic Attack Up
  00189008: 0c0618c7 jal 0x 0018631c               [[Magic_Defense_Up_routine]]
+
  00188ff0: 00000000 nop                     |
  0018900c: 00000000 nop
+
  00188ff4: 3c028019 lui r2,0x8019           |
  00189010: 0c061918 jal 0x 00186460               [[Target%27s_Status_Affecting_XA_(Magical)]]
+
  00188ff8: 904238e6 lbu r2,0x38e6(r2)       |{{f/load|<nowiki>r2 = Current Ability Undead Flag</nowiki>}}
  00189014: 00000000 nop
+
  00188ffc: 00000000 nop                     |
  00189018: 0c061259 jal 0x 00184964              [[Compatibility]]
+
  00189000: 14400005 bne r2,r0,0x00189018    {{f/Cond|If Target is not Undead}}
  0018901c: 00000000 nop
+
  00189004: 00000000 nop                         |
  00189020: 0c061967 jal 0x 0018659c              [[Set_XA_%2B_YA_for_Status_Formulas_(Stupid_section)|Set XA + YA for Status Formulas (Stupid section)]]
+
  00189008: 0c0618c7 jal 0x0018631c               |{{f/jal|Magic_Defense_Up_routine|Magic_Defense_Up_routine}} Ability XA -33% If Target uses Magic Defense Up
  00189024: 00000000 nop
+
  0018900c: 00000000 nop                         |
  00189028: 0c061c54 jal 0x 00187150        [[Faith_Calculation]]
+
  00189010: 0c061918 jal 0x00186460               |{{f/jal|Target%27s_Status_Affecting_XA_(Magical)|Target%27s_Status_Affecting_XA_(Magical)}} XA - 33% if Target has Shell / XA + 50% if Target has Chicken or Frog
  0018902c: 00000000 nop
+
  00189014: 00000000 nop                         |
  00189030: 0c061d44 jal 0x 00187510              [[Use_Specific_Action_Hit_Percentage]]
+
  00189018: 0c061259 jal 0x00184964          |{{f/jal|Compatibility|Compatibility}} Alters XA (-50% to +50%) based on compatibility
  00189034: 00000000 nop
+
  0018901c: 00000000 nop                     |
  00189038: 3c028019 lui r2,0x8019
+
  00189020: 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) - Will be used as accuracy
  0018903c: 8c422d90 lw r2,0x2d90(r2)
+
  00189024: 00000000 nop                     |
  00189040: 00000000 nop
+
  00189028: 0c061c54 jal 0x00187150          |{{f/jal|Faith_Calculation|Faith_Calculation}} HP damage becomes Base HP damage * Target faith/100 * Attacker faith/100
  00189044: 90420000 lbu r2,0x0000(r2)
+
  0018902c: 00000000 nop                     |
  00189048: 00000000 nop
+
  00189030: 0c061d44 jal 0x00187510          |{{f/jal|Uses_HP_damage_as_Action_hit%25|Uses_HP_damage_as_Action_hit%25}} HP damage becomes Hit% - Roll Hit% vs random (0 to 100), Set Action hit flag to miss if it fails
  0018904c: 10400009 beq r2,r0,0x 00189074
+
  00189034: 00000000 nop                     |
  00189050: 00000000 nop
+
  00189038: 3c028019 lui r2,0x8019           |
  00189054: 0c062b37 jal 0x 0018acdc        [[Apply_Status_and_Check_Undead]]
+
  0018903c: 8c422d90 lw r2,0x2d90(r2)         |{{f/adr|<nowiki>r2 = TCA data pointer</nowiki>}}
  00189058: 00000000 nop
+
  00189040: 00000000 nop                     |
  0018905c: 10400005 beq r2,r0,0x 00189074
+
  00189044: 90420000 lbu r2,0x0000(r2)       |{{f/load|<nowiki>r2 = TCA hit flag</nowiki>}}
  00189060: 00000000 nop
+
  00189048: 00000000 nop                     |
  00189064: 0c061989 jal 0x 00186624          [[Calculate_HP%25_damage|Calculate HP% damage]]
+
  0018904c: 10400009 beq r2,r0,0x00189074    {{f/Cond|If Attack hits}}
  00189068: 00000000 nop
+
  00189050: 00000000 nop                         |
  0018906c: 0c061cf6 jal 0x 001873d8          [[Undead_Absorb_Attack]]
+
  00189054: 0c062b37 jal 0x0018acdc              |{{f/jal|Apply_Status_and_Check_Undead|Apply_Status_and_Check_Undead}} Nullify Action if Status infliction fails and Target is not undead / Returns r2 = 0x00 if nullified
  00189070: 00000000 nop
+
  00189058: 00000000 nop                         |
  00189074: 8fbf0010 lw r31,0x0010(r29)
+
  0018905c: 10400005 beq r2,r0,0x00189074        {{f/Cond|If Action is not nullified}}
  00189078: 27bd 0018 addiu r29,r29,0x 0018
+
  00189060: 00000000 nop                             |
  0018907c: 03e00008 jr r31
+
  00189064: 0c061989 jal 0x00186624                  |{{f/jal|Calculate_HP%25_damage|Calculate HP% damage}} Set Target Current Action HP damage to [Used Ability Y]% of Target max HP
  00189080: 00000000 nop
+
  00189068: 00000000 nop                             |
 +
  0018906c: 0c061cf6 jal 0x001873d8                  |{{f/jal|Undead_Absorb_Attack|Undead_Absorb_Attack}}  If Target is undead : HP damage becomes HP recovery, no status infliction
 +
  00189070: 00000000 nop                             |
 +
  00189074: 8fbf0010 lw r31,0x0010(r29)       END
 +
  00189078: 27bd0018 addiu r29,r29,0x0018   
 +
  0018907c: 03e00008 jr r31                  
 +
  00189080: 00000000 nop                    
 +
=== Return locations ===
 +
'''Battle.bin'''
 +
0018b97c - [[Pre Formula Setup (FDC)|Pre Formula Setup]]

Latest revision as of 13:06, 16 April 2022

If Target is undead, the ability will be considered as friendly (no evasion, no Magic defense up etc..)
Uses 0x801938e6 as Undead reverse flag (never seen this before) 
Status infliction is mandatory : if not inflicted, Action will miss

Note : could be glitchy if inflicted status is not in 1st set
----------------------------------------------------------------------------------------------
00188f90: 3c028019 lui r2,0x8019            |
00188f94: 8c422d98 lw r2,0x2d98(r2)         |r2 = Target Data pointer
00188f98: 27bdffe8 addiu r29,r29,-0x0018    |
00188f9c: afbf0010 sw r31,0x0010(r29)       |
00188fa0: 90420058 lbu r2,0x0058(r2)        |r2 = Target Current Status (1st set)
00188fa4: 00000000 nop                      |
00188fa8: 30420010 andi r2,r2,0x0010        |r2 = 0x10 if Target is undead
00188fac: 10400005 beq r2,r0,0x00188fc4     #If Target is Undead
00188fb0: 34020001 ori r2,r0,0x0001             |r2 = 0x01
00188fb4: 3c018019 lui r1,0x8019                |
00188fb8: a02238e6 sb r2,0x38e6(r1)             |Set 0x801938e6 to 0x01 Undead reversal flag ?  801938e6
00188fbc: 080623f7 j 0x00188fdc                 >>jump skipping Evasion
00188fc0: 00000000 nop                          |
                                            #Else : Target is not Undead
00188fc4: 3c018019 lui r1,0x8019                |
00188fc8: a02038e6 sb r0,0x38e6(r1)             |Clear 0x801938e6 : Target is not Undead
00188fcc: 0c06216e jal 0x001885b8               |-->Magical_Evade_Calculation If Abillity is evadeable roll Ability Evade byte against Ability base Hit
00188fd0: 00000000 nop                          |
00188fd4: 14400027 bne r2,r0,0x00189074         #If Attack Miss : Branch to END
00188fd8: 00000000 nop                              
00188fdc: 0c061760 jal 0x00185d80           |-->Store_MA_and_X Set Ability XA = Attacker's MA and YA = used Ability X
00188fe0: 00000000 nop                      |
00188fe4: 0c0617ff jal 0x00185ffc           |-->Elemental_Strengthen XA +25% if used Ability elements is strengthened
00188fe8: 00000000 nop                      |
00188fec: 0c061881 jal 0x00186204           |-->Magic_Attack_Up_routine Ability XA +33% If Attacker uses Magic Attack Up
00188ff0: 00000000 nop                      |
00188ff4: 3c028019 lui r2,0x8019            |
00188ff8: 904238e6 lbu r2,0x38e6(r2)        |r2 = Current Ability Undead Flag
00188ffc: 00000000 nop                      |
00189000: 14400005 bne r2,r0,0x00189018     #If Target is not Undead
00189004: 00000000 nop                          |
00189008: 0c0618c7 jal 0x0018631c               |-->Magic_Defense_Up_routine Ability XA -33% If Target uses Magic Defense Up
0018900c: 00000000 nop                          |
00189010: 0c061918 jal 0x00186460               |-->Target%27s_Status_Affecting_XA_(Magical) XA - 33% if Target has Shell / XA + 50% if Target has Chicken or Frog
00189014: 00000000 nop                          |
00189018: 0c061259 jal 0x00184964           |-->Compatibility Alters XA (-50% to +50%) based on compatibility
0018901c: 00000000 nop                      |
00189020: 0c061967 jal 0x0018659c           |-->XA + YA for Accuracy XA+YA becomes TCA HP damage (YA is processed via compatibility) - Will be used as accuracy
00189024: 00000000 nop                      |
00189028: 0c061c54 jal 0x00187150           |-->Faith_Calculation HP damage becomes Base HP damage * Target faith/100 * Attacker faith/100
0018902c: 00000000 nop                      |
00189030: 0c061d44 jal 0x00187510           |-->Uses_HP_damage_as_Action_hit%25 HP damage becomes Hit% - Roll Hit% vs random (0 to 100), Set Action hit flag to miss if it fails
00189034: 00000000 nop                      |
00189038: 3c028019 lui r2,0x8019            |
0018903c: 8c422d90 lw r2,0x2d90(r2)         |r2 = TCA data pointer
00189040: 00000000 nop                      |
00189044: 90420000 lbu r2,0x0000(r2)        |r2 = TCA hit flag
00189048: 00000000 nop                      |
0018904c: 10400009 beq r2,r0,0x00189074     #If Attack hits
00189050: 00000000 nop                          |
00189054: 0c062b37 jal 0x0018acdc               |-->Apply_Status_and_Check_Undead Nullify Action if Status infliction fails and Target is not undead / Returns r2 = 0x00 if nullified
00189058: 00000000 nop                          |
0018905c: 10400005 beq r2,r0,0x00189074         #If Action is not nullified
00189060: 00000000 nop                              |
00189064: 0c061989 jal 0x00186624                   |-->Calculate HP% damage Set Target Current Action HP damage to [Used Ability Y]% of Target max HP
00189068: 00000000 nop                              |
0018906c: 0c061cf6 jal 0x001873d8                   |-->Undead_Absorb_Attack  If Target is undead : HP damage becomes HP recovery, no status infliction
00189070: 00000000 nop                              |
00189074: 8fbf0010 lw r31,0x0010(r29)       END
00189078: 27bd0018 addiu r29,r29,0x0018     
0018907c: 03e00008 jr r31                   
00189080: 00000000 nop                      

Return locations

Battle.bin
0018b97c - Pre Formula Setup