Difference between revisions of "32 Dmg (Rdm(1…X)*(PA*3+Y)/2)"

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search
m
Line 1: Line 1:
 
  [32]
 
  [32]
  00189d74: 27bdffe8 addiu r29,r29,0xffe8
+
  00189d74: 27bdffe8 addiu r29,r29,-0x0018    |
  00189d78: afbf0010 sw r31,0x0010(r29)
+
  00189d78: afbf0010 sw r31,0x0010(r29)       |
  00189d7c: 0c062144 jal 0x 00188510      [[Physical Evade Calculation]]
+
  00189d7c: 0c062144 jal 0x00188510          |{{f/jal|Physical Evade Calculation|Physical Evade Calculation}} If Abillity is evadeable roll Ability Evade byte against Ability base Hit - Returns r2
  00189d80: 00000000 nop
+
  00189d80: 00000000 nop                     |
  00189d84: 14400024 bne r2,r0,0x 00189e18 Branch to end if attack is evaded
+
  00189d84: 14400024 bne r2,r0,0x00189e18    {{f/Cond|If Attack is not evaded}}
  00189d88: 00000000 nop
+
  00189d88: 00000000 nop                         |
  00189d8c: 0c061740 jal 0x 00185d00      [[Store PA and PA + Y / 2]]
+
  00189d8c: 0c061740 jal 0x00185d00              |{{f/jal|Store PA and PA + Y / 2|Store PA and PA + Y / 2}} Set XA = Attacker's PA and YA = (Attacker's PA + Ability Y)/2
  00189d90: 00000000 nop
+
  00189d90: 00000000 nop                         |
  00189d94: 0c061853 jal 0x 0018614c      [[Formula 32, 33, 34, 35 Attack Up and Martial Arts]]
+
  00189d94: 0c061853 jal 0x0018614c              |{{f/jal|Formula 32, 33, 34, 35 Attack Up and Martial Arts|Formula 32, 33, 34, 35 Attack Up and Martial Arts}} Increase XA if Attacker uses Attack Up or Martial art with elligible weapon
  00189d98: 00000000 nop
+
  00189d98: 00000000 nop                         |
  00189d9c: 0c0622b7 jal 0x 00188adc      [[Cluster of Physical Routines]] (Contains checks for frog and berserk for the caster.)
+
  00189d9c: 0c0622b7 jal 0x00188adc              |{{f/jal|Cluster of Physical Routines|Cluster of Physical Routines}} Modify XA (Attacker status, Target Status/Support, Compatibility)
  00189da0: 00000000 nop
+
  00189da0: 00000000 nop                         |
  00189da4: 0c06193e jal 0x 001864f8      [[Critical Hit Calculation]]
+
  00189da4: 0c06193e jal 0x001864f8              |{{f/jal|Critical Hit Calculation|Critical Hit Calculation}} If Critical Hit : Increase XA (+0% to +100%) Add Knockback (if possible)
  00189da8: 00000000 nop
+
  00189da8: 00000000 nop                         |
  00189dac: 0c061967 jal 0x 0018659c      [[Set XA + YA for Status Formulas (Stupid section)]]
+
  00189dac: 0c061967 jal 0x0018659c              |{{f/jal|Set XA + YA for Status Formulas (Stupid section)|XA + YA for Accuracy}} XA+YA becomes TCA HP damage (YA is processed via compatibility)
  00189db0: 00000000 nop
+
  00189db0: 00000000 nop                         |
  00189db4: 0c063ba8 jal 0x 0018eea0      [[Random Process, gives a number between 0-7fff]]
+
  00189db4: 0c063ba8 jal 0x0018eea0              |{{f/jal|Random Process, gives a number between 0-7fff|Random Process, gives a number between 0-7fff}} Returns r2 between 0x00 and 0x7fff
  00189db8: 00000000 nop
+
  00189db8: 00000000 nop                         |
  00189dbc: 3c038019 lui r3,0x8019
+
  00189dbc: 3c038019 lui r3,0x8019               |
  00189dc0: 906338f9 lbu r3,0x38f9(r3)     Load X
+
  00189dc0: 906338f9 lbu r3,0x38f9(r3)           |{{f/load|<nowiki>r3 = Current Ability used Ability X</nowiki>}}
  00189dc4: 00000000 nop
+
  00189dc4: 00000000 nop                         |
  00189dc8: 0043 0018 mult r2,r3        
+
  00189dc8: 00430018 mult r2,r3                   |{{f/std|Random * X}}
  00189dcc: 3c058019 lui r5,0x8019
+
  00189dcc: 3c058019 lui r5,0x8019               |
  00189dd0: 24a538ea addiu r5,r5,0x38ea
+
  00189dd0: 24a538ea addiu r5,r5,0x38ea           |{{f/adr|<nowiki>r5 = 0x801938ea pointer (Current Ability ?)</nowiki>}} {{f/std|      801938ea}}
  00189dd4: 00001012 mflo r2                 X * RN
+
  00189dd4: 00001012 mflo r2                     |{{f/std|<nowiki>r2 = Random * X</nowiki>}}
  00189dd8: 04410002 bgez r2,0x 00189de4
+
  00189dd8: 04410002 bgez r2,0x00189de4          {{f/Cond|If Random * X < 0}}
  00189ddc: 00000000 nop
+
  00189ddc: 00000000 nop                             |
  00189de0: 24427fff addiu r2,r2,0x7fff
+
  00189de0: 24427fff addiu r2,r2,0x7fff               |{{f/std|<nowiki>r2 = positive random * X</nowiki>}}
  00189de4: 000213c3 sra r2,r2,0xf
+
  00189de4: 000213c3 sra r2,r2,0xf               |{{f/std|<nowiki>r2 = Random between 0 and X-1</nowiki>}} {{f/std| (X * random / [max possible random +1])}}
  00189de8: 3c048019 lui r4,0x8019
+
  00189de8: 3c048019 lui r4,0x8019               |
  00189dec: 8c842d90 lw r4,0x2d90(r4)
+
  00189dec: 8c842d90 lw r4,0x2d90(r4)             |{{f/adr|<nowiki>r4 = Target Current Action (TCA) data pointer</nowiki>}}
  00189df0: 24420001 addiu r2,r2,0x0001
+
  00189df0: 24420001 addiu r2,r2,0x0001           |{{f/std|<nowiki>r2 = Random between 1 and X</nowiki>}}
  00189df4: a0a20000 sb r2,0x0000(r5)    
+
  00189df4: a0a20000 sb r2,0x0000(r5)             |{{f/store|Store Random Dmg factor at 0x801938ea}}
  00189df8: 90a20000 lbu r2,0x0000(r5)       (Replace with  AND r2, r2, 0x00FF)
+
  00189df8: 90a20000 lbu r2,0x0000(r5)           |{{f/load|<nowiki>r2 = Random between 1 and X</nowiki>}}
  00189dfc: 84830004 lh r3,0x0004(r4)     Load PA + (PA + Y) / 2
+
  00189dfc: 84830004 lh r3,0x0004(r4)             |{{f/load|<nowiki>r3 = TCA HP damage (XA+YA)</nowiki>}}
  00189e00: 00000000 nop
+
  00189e00: 00000000 nop                         |
  00189e04: 0062 0018 mult r3,r2
+
  00189e04: 00620018 mult r3,r2                   |{{f/std|(XA + YA) * Random (1 to X)}}
  00189e08: 34020080 ori r2,r0,0x0080
+
  00189e08: 34020080 ori r2,r0,0x0080             |{{f/std|<nowiki>r2 = 0x80</nowiki>}}
  00189e0c: a0820025 sb r2,0x0025(r4)     Set as HP Damage
+
  00189e0c: a0820025 sb r2,0x0025(r4)             |{{f/store|Set TCA Attack type to HP damage (disables other flags)}}
  00189e10: 00001012 mflo r2                 Damage = {1...X} * [PA + (PA + Y) / 2]
+
  00189e10: 00001012 mflo r2                     |r2 = Damage = {1...X} * [PA + (PA + Y) / 2]
  00189e14: a4820004 sh r2,0x0004(r4)     Store Damage
+
  00189e14: a4820004 sh r2,0x0004(r4)             |{{f/store|Store Randomized damage}}
  00189e18: 8fbf0010 lw r31,0x0010(r29)
+
  00189e18: 8fbf0010 lw r31,0x0010(r29)       END
  00189e1c: 27bd 0018 addiu r29,r29,0x 0018
+
  00189e1c: 27bd0018 addiu r29,r29,0x0018
  00189e20: 03e00008 jr r31
+
  00189e20: 03e00008 jr r31
 
  00189e24: 00000000 nop
 
  00189e24: 00000000 nop
 +
=== Return location ===
 +
'''Battle.bin'''
 +
0018b97c - [[Pre Formula Setup (FDC)|Pre Formula Setup]]

Revision as of 19:58, 23 April 2022

[32]
00189d74: 27bdffe8 addiu r29,r29,-0x0018    |
00189d78: afbf0010 sw r31,0x0010(r29)       |
00189d7c: 0c062144 jal 0x00188510           |-->Physical Evade Calculation If Abillity is evadeable roll Ability Evade byte against Ability base Hit - Returns r2
00189d80: 00000000 nop                      |
00189d84: 14400024 bne r2,r0,0x00189e18     #If Attack is not evaded
00189d88: 00000000 nop                          |
00189d8c: 0c061740 jal 0x00185d00               |-->Store PA and PA + Y / 2 Set XA = Attacker's PA and YA = (Attacker's PA + Ability Y)/2
00189d90: 00000000 nop                          |
00189d94: 0c061853 jal 0x0018614c               |-->Formula 32, 33, 34, 35 Attack Up and Martial Arts Increase XA if Attacker uses Attack Up or Martial art with elligible weapon
00189d98: 00000000 nop                          |
00189d9c: 0c0622b7 jal 0x00188adc               |-->Cluster of Physical Routines Modify XA (Attacker status, Target Status/Support, Compatibility)
00189da0: 00000000 nop                          |
00189da4: 0c06193e jal 0x001864f8               |-->Critical Hit Calculation If Critical Hit : Increase XA (+0% to +100%) Add Knockback (if possible)
00189da8: 00000000 nop                          |
00189dac: 0c061967 jal 0x0018659c               |-->XA + YA for Accuracy XA+YA becomes TCA HP damage (YA is processed via compatibility)
00189db0: 00000000 nop                          |
00189db4: 0c063ba8 jal 0x0018eea0               |-->Random Process, gives a number between 0-7fff Returns r2 between 0x00 and 0x7fff
00189db8: 00000000 nop                          |
00189dbc: 3c038019 lui r3,0x8019                |
00189dc0: 906338f9 lbu r3,0x38f9(r3)            |r3 = Current Ability used Ability X
00189dc4: 00000000 nop                          |
00189dc8: 00430018 mult r2,r3                   |Random * X
00189dcc: 3c058019 lui r5,0x8019                |
00189dd0: 24a538ea addiu r5,r5,0x38ea           |r5 = 0x801938ea pointer (Current Ability ?)       801938ea
00189dd4: 00001012 mflo r2                      |r2 = Random * X
00189dd8: 04410002 bgez r2,0x00189de4           #If Random * X < 0
00189ddc: 00000000 nop                              |
00189de0: 24427fff addiu r2,r2,0x7fff               |r2 = positive random * X
00189de4: 000213c3 sra r2,r2,0xf                |r2 = Random between 0 and X-1  (X * random / [max possible random +1])
00189de8: 3c048019 lui r4,0x8019                |
00189dec: 8c842d90 lw r4,0x2d90(r4)             |r4 = Target Current Action (TCA) data pointer
00189df0: 24420001 addiu r2,r2,0x0001           |r2 = Random between 1 and X
00189df4: a0a20000 sb r2,0x0000(r5)             |Store Random Dmg factor at 0x801938ea
00189df8: 90a20000 lbu r2,0x0000(r5)            |r2 = Random between 1 and X
00189dfc: 84830004 lh r3,0x0004(r4)             |r3 = TCA HP damage (XA+YA)
00189e00: 00000000 nop                          |
00189e04: 00620018 mult r3,r2                   |(XA + YA) * Random (1 to X)
00189e08: 34020080 ori r2,r0,0x0080             |r2 = 0x80
00189e0c: a0820025 sb r2,0x0025(r4)             |Set TCA Attack type to HP damage (disables other flags)
00189e10: 00001012 mflo r2                      |r2 = Damage = {1...X} * [PA + (PA + Y) / 2]
00189e14: a4820004 sh r2,0x0004(r4)             |Store Randomized damage
00189e18: 8fbf0010 lw r31,0x0010(r29)       END
00189e1c: 27bd0018 addiu r29,r29,0x0018
00189e20: 03e00008 jr r31
00189e24: 00000000 nop

Return location

Battle.bin
0018b97c - Pre Formula Setup