58 Generic: Set Morbol: Hit(MA+X)%

From Final Fantasy Hacktics Wiki
(Redirected from 0018a824 - 0018a904)
Jump to navigation Jump to search
[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