Difference between revisions of "58 Generic: Set Morbol: Hit(MA+X)%"

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search
(Created page with " [58] 0018a824: 27bdffe8 addiu r29,r29,0xffe8 0018a828: afbf0010 sw r31,0x0010(r29) 0018a82c: 0c061760 jal 0x00185d80 Get MA and X 0018a830: 00000000 nop 0...")
 
(Typo - bad orkney...)
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
  [58]
 
  [58]
  0018a824: 27bdffe8 addiu r29,r29,0xffe8
+
  0018a824: 27bdffe8 addiu r29,r29,-0x0018
  0018a828: afbf0010 sw r31,0x0010(r29)
+
  0018a828: afbf0010 sw r31,0x0010(r29)
  0018a82c: 0c061760 jal 0x00185d80     Get MA and X
+
  0018a82c: 0c061760 jal 0x00185d80           |{{f/jal|Store_MA_and_X|Store_MA_and_X}} Set Ability XA = Attacker's MA and YA = used Ability X
  0018a830: 00000000 nop
+
  0018a830: 00000000 nop                     |
  0018a834: 0c0617ff jal 0x00185ffc     Elemental Boost
+
  0018a834: 0c0617ff jal 0x00185ffc           |{{f/jal|Elemental_Strengthen|Elemental_Strengthen}} XA + 25% if used Ability Element is strengthened
  0018a838: 00000000 nop
+
  0018a838: 00000000 nop                     |
  0018a83c: 0c061881 jal 0x00186204     MATUP Boost
+
  0018a83c: 0c061881 jal 0x00186204           |{{f/jal|Magic_Attack_Up_routine|Magic_Attack_Up_routine}} Ability XA +33% If Attacker uses Magic Attack Up
  0018a840: 00000000 nop
+
  0018a840: 00000000 nop                     |
  0018a844: 0c061259 jal 0x00184964     Zodiac Calculation
+
  0018a844: 0c061259 jal 0x00184964           |{{f/jal|Compatibility|Compatibility}} Alters XA (-50% to +50%) based on compatibility
  0018a848: 00000000 nop
+
  0018a848: 00000000 nop                     |
  0018a84c: 0c061967 jal 0x0018659c     Set MA + X as X
+
  0018a84c: 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)
  0018a850: 00000000 nop
+
  0018a850: 00000000 nop                     |
  0018a854: 0c061d44 jal 0x00187510     Total Evasion Check
+
  0018a854: 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
  0018a858: 00000000 nop
+
  0018a858: 00000000 nop                     |
  0018a85c: 3c048019 lui r4,0x8019
+
  0018a85c: 3c048019 lui r4,0x8019           |
  0018a860: 8c842d90 lw r4,0x2d90(r4)
+
  0018a860: 8c842d90 lw r4,0x2d90(r4)         |{{f/adr|<nowiki>r2 = Target Current Action (TCA) data pointer</nowiki>}}
  0018a864: 00000000 nop
+
  0018a864: 00000000 nop                     |
  0018a868: 90820000 lbu r2,0x0000(r4)
+
  0018a868: 90820000 lbu r2,0x0000(r4)       |{{f/load|<nowiki>r2 = TCA hit flag</nowiki>}}
  0018a86c: 00000000 nop
+
  0018a86c: 00000000 nop                     |
  0018a870: 10400021 beq r2,r0,0x0018a8f8
+
  0018a870: 10400021 beq r2,r0,0x0018a8f8     {{f/Cond|If Attack hits}}
  0018a874: 00000000 nop
+
  0018a874: 00000000 nop                         |
  0018a878: 3c038019 lui r3,0x8019
+
  0018a878: 3c038019 lui r3,0x8019               |
  0018a87c: 8c632d98 lw r3,0x2d98(r3)
+
  0018a87c: 8c632d98 lw r3,0x2d98(r3)             |{{f/adr|<nowiki>r3 = Target data pointer</nowiki>}}
  0018a880: 00000000 nop
+
  0018a880: 00000000 nop                         |
  0018a884: 90620005 lbu r2,0x0005(r3)
+
  0018a884: 90620005 lbu r2,0x0005(r3)           |{{f/load|<nowiki>r2 = ENTD flags</nowiki>}}
  0018a888: 00000000 nop
+
  0018a888: 00000000 nop                         |
  0018a88c: 30420004 andi r2,r2,0x0004
+
  0018a88c: 30420004 andi r2,r2,0x0004           |{{f/std|<nowiki>r2 = 0x04 if Target is immortal</nowiki>}}
  0018a890: 14400017 bne r2,r0,0x0018a8f0     Immortal Check
+
  0018a890: 14400017 bne r2,r0,0x0018a8f0         {{f/Cond|If Target is Not immortal}} /Else branch to Force Attack miss routine
  0018a894: 00000000 nop
+
  0018a894: 00000000 nop                             |
  0018a898: 90620182 lbu r2,0x0182(r3)
+
  0018a898: 90620182 lbu r2,0x0182(r3)               |{{f/load|<nowiki>r2 = Target Mount info</nowiki>}}
  0018a89c: 00000000 nop
+
  0018a89c: 00000000 nop                             |
  0018a8a0: 14400013 bne r2,r0,0x0018a8f0     Rider/Water Check
+
  0018a8a0: 14400013 bne r2,r0,0x0018a8f0             {{f/Cond|If Target is Not ridden/riding}} /Else branch to Force Attack miss routine
  0018a8a4: 00000000 nop
+
  0018a8a4: 00000000 nop                                 |
  0018a8a8: 90620000 lbu r2,0x0000(r3)
+
  0018a8a8: 90620000 lbu r2,0x0000(r3)                   |{{f/load|<nowiki>r2 = Target identity</nowiki>}}
  0018a8ac: 00000000 nop
+
  0018a8ac: 00000000 nop                                 |
  0018a8b0: 2442ff80 addiu r2,r2,0xff80
+
  0018a8b0: 2442ff80 addiu r2,r2,-0x0080                  |{{f/std|<nowiki>r2 >= 0x00 if Unit is generic</nowiki>}}
  0018a8b4: 304200ff andi r2,r2,0x00ff     Unit Type (8?) + 0x80
+
  0018a8b4: 304200ff andi r2,r2,0x00ff                   |{{f/std|keep the byte only (make the negative values positive ?)}}
  0018a8b8: 2c420003 sltiu r2,r2,0x0003
+
  0018a8b8: 2c420003 sltiu r2,r2,0x0003                   |{{f/std|<nowiki>r2 = 0x01 if Unit is generic (male female monster)</nowiki>}}
  0018a8bc: 1040000c beq r2,r0,0x0018a8f0    
+
  0018a8bc: 1040000c beq r2,r0,0x0018a8f0                 {{f/Cond|If Target is a generic unit}} /Else branch to Force Attack miss routine
  0018a8c0: 00000000 nop
+
  0018a8c0: 00000000 nop                                     |
  0018a8c4: 90620003 lbu r2,0x0003(r3)     Run only if unit is generic; Loads job class
+
  0018a8c4: 90620003 lbu r2,0x0003(r3)                       |{{f/load|<nowiki>r2 = Target Current Job</nowiki>}}
  0018a8c8: 00000000 nop
+
  0018a8c8: 00000000 nop                                     |
  0018a8cc: 2442007e addiu r2,r2,0x007e
+
  0018a8cc: 2442007e addiu r2,r2,0x007e                       |{{f/std|<nowiki>r2 = Job + 0x7e (if Morbol type  = 0x100 to 0x102)</nowiki>}}
  0018a8d0: 304200ff andi r2,r2,0x00ff     r2 = Job Class + 0x7e
+
  0018a8d0: 304200ff andi r2,r2,0x00ff                       |{{f/std|last byte only}}
  0018a8d4: 2c420003 sltiu r2,r2,0x0003    
+
  0018a8d4: 2c420003 sltiu r2,r2,0x0003                       |{{f/std|<nowiki>r2 = 0x01 if Target is already Morbol Type</nowiki>}}
  0018a8d8: 14400005 bne r2,r0,0x0018a8f0     Check if already murbol
+
  0018a8d8: 14400005 bne r2,r0,0x0018a8f0                     {{f/Cond|If Target is not a Morbol}} /Else branch to Force Attack miss routine
  0018a8dc: 34020002 ori r2,r0,0x0002
+
  0018a8dc: 34020002 ori r2,r0,0x0002                             |{{f/std|<nowiki>r2 = 0x02</nowiki>}}
  0018a8e0: a4820010 sh r2,0x0010(r4)     Turn unit into murbol
+
  0018a8e0: a4820010 sh r2,0x0010(r4)                             |{{f/store|Enables TCA special flag 1 0x02 : Turn in Morbol}}
  0018a8e4: 34020001 ori r2,r0,0x0001
+
  0018a8e4: 34020001 ori r2,r0,0x0001                             |{{f/std|<nowiki>r2 = 0x01</nowiki>}}
  0018a8e8: 08062a3e j 0x0018a8f8
+
  0018a8e8: 08062a3e j 0x0018a8f8                                 {{f/jump|Jump to END (Avoid force to miss)}}
  0018a8ec: a0820025 sb r2,0x0025(r4)     Set as Psuedo-Status
+
  0018a8ec: a0820025 sb r2,0x0025(r4)                             |{{f/store|<nowiki>Set TCA Attack Type = pseudo status</nowiki>}}
  0018a8f0: 0c0610c3 jal 0x0018430c     ELSE MISS Routine
+
  0018a8f4: 00000000 nop
+
                                                '''All Fails section'''
  0018a8f8: 8fbf0010 lw r31,0x0010(r29)
+
  0018a8f0: 0c0610c3 jal 0x0018430c               |{{f/jal|Force_Attack_Miss|Force_Attack_Miss}} {{f/std|<nowiki>Hit Flag = Miss Hit% = 0 - Evade type = 0x07</nowiki>}}
  0018a8fc: 27bd0018 addiu r29,r29,0x0018
+
  0018a8f4: 00000000 nop                         |
  0018a900: 03e00008 jr r31
+
  0018a8f8: 8fbf0010 lw r31,0x0010(r29)       END
 +
  0018a8fc: 27bd0018 addiu r29,r29,0x0018
 +
  0018a900: 03e00008 jr r31
 
  0018a904: 00000000 nop
 
  0018a904: 00000000 nop
 +
=== Return location ===
 +
'''Battle.bin'''
 +
0018b97c : [[Pre Formula Setup (FDC)|Pre Formula Setup]]

Latest revision as of 21:06, 2 January 2024

[58]
0018a824: 27bdffe8 addiu r29,r29,-0x0018 
0018a828: afbf0010 sw r31,0x0010(r29)
0018a82c: 0c061760 jal 0x00185d80           |-->Store_MA_and_X Set Ability XA = Attacker's MA and YA = used Ability X
0018a830: 00000000 nop                      |
0018a834: 0c0617ff jal 0x00185ffc           |-->Elemental_Strengthen XA + 25% if used Ability Element is strengthened
0018a838: 00000000 nop                      |
0018a83c: 0c061881 jal 0x00186204           |-->Magic_Attack_Up_routine Ability XA +33% If Attacker uses Magic Attack Up
0018a840: 00000000 nop                      |
0018a844: 0c061259 jal 0x00184964           |-->Compatibility Alters XA (-50% to +50%) based on compatibility
0018a848: 00000000 nop                      |
0018a84c: 0c061967 jal 0x0018659c           |-->XA + YA for Accuracy XA+YA becomes TCA HP damage (YA is processed via compatibility)
0018a850: 00000000 nop                      |
0018a854: 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
0018a858: 00000000 nop                      |
0018a85c: 3c048019 lui r4,0x8019            |
0018a860: 8c842d90 lw r4,0x2d90(r4)         |r2 = Target Current Action (TCA) data pointer
0018a864: 00000000 nop                      |
0018a868: 90820000 lbu r2,0x0000(r4)        |r2 = TCA hit flag
0018a86c: 00000000 nop                      |
0018a870: 10400021 beq r2,r0,0x0018a8f8     #If Attack hits
0018a874: 00000000 nop                          |
0018a878: 3c038019 lui r3,0x8019                |
0018a87c: 8c632d98 lw r3,0x2d98(r3)             |r3 = Target data pointer
0018a880: 00000000 nop                          |
0018a884: 90620005 lbu r2,0x0005(r3)            |r2 = ENTD flags
0018a888: 00000000 nop                          |
0018a88c: 30420004 andi r2,r2,0x0004            |r2 = 0x04 if Target is immortal
0018a890: 14400017 bne r2,r0,0x0018a8f0         #If Target is Not immortal /Else branch to Force Attack miss routine
0018a894: 00000000 nop                              |
0018a898: 90620182 lbu r2,0x0182(r3)                |r2 = Target Mount info
0018a89c: 00000000 nop                              |
0018a8a0: 14400013 bne r2,r0,0x0018a8f0             #If Target is Not ridden/riding /Else branch to Force Attack miss routine
0018a8a4: 00000000 nop                                  |
0018a8a8: 90620000 lbu r2,0x0000(r3)                    |r2 = Target identity
0018a8ac: 00000000 nop                                  |
0018a8b0: 2442ff80 addiu r2,r2,-0x0080                  |r2 >= 0x00 if Unit is generic
0018a8b4: 304200ff andi r2,r2,0x00ff                    |keep the byte only (make the negative values positive ?)
0018a8b8: 2c420003 sltiu r2,r2,0x0003                   |r2 = 0x01 if Unit is generic (male female monster)
0018a8bc: 1040000c beq r2,r0,0x0018a8f0                 #If Target is a generic unit /Else branch to Force Attack miss routine
0018a8c0: 00000000 nop                                      |
0018a8c4: 90620003 lbu r2,0x0003(r3)                        |r2 = Target Current Job
0018a8c8: 00000000 nop                                      |
0018a8cc: 2442007e addiu r2,r2,0x007e                       |r2 = Job + 0x7e (if Morbol type  = 0x100 to 0x102)
0018a8d0: 304200ff andi r2,r2,0x00ff                        |last byte only
0018a8d4: 2c420003 sltiu r2,r2,0x0003                       |r2 = 0x01 if Target is already Morbol Type
0018a8d8: 14400005 bne r2,r0,0x0018a8f0                     #If Target is not a Morbol /Else branch to Force Attack miss routine
0018a8dc: 34020002 ori r2,r0,0x0002                             |r2 = 0x02
0018a8e0: a4820010 sh r2,0x0010(r4)                             |Enables TCA special flag 1 0x02 : Turn in Morbol
0018a8e4: 34020001 ori r2,r0,0x0001                             |r2 = 0x01
0018a8e8: 08062a3e j 0x0018a8f8                                 >>Jump to END (Avoid force to miss)
0018a8ec: a0820025 sb r2,0x0025(r4)                             |Set TCA Attack Type = pseudo status

                                                All Fails section
0018a8f0: 0c0610c3 jal 0x0018430c               |-->Force_Attack_Miss Hit Flag = Miss Hit% = 0 - Evade type = 0x07
0018a8f4: 00000000 nop                          |
0018a8f8: 8fbf0010 lw r31,0x0010(r29)       END
0018a8fc: 27bd0018 addiu r29,r29,0x0018
0018a900: 03e00008 jr r31
0018a904: 00000000 nop

Return location

Battle.bin
0018b97c : Pre Formula Setup