Conditional Status Proc Roll (19%) Inner Routine

From Final Fantasy Hacktics Wiki
Revision as of 19:04, 5 April 2022 by Orkney (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
80187690: 3c028019 lui r2,0x8019
80187694: 8c42f5fc lw r2,-0x0a04(r2)                #   actionState
80187698: 27bdffe8 addiu r29,r29,-0x0018
8018769c: 1440000d bne r2,r0,0x801876d4
801876a0: afbf0010 sw r31,0x0010(r29)
                                                    #   if (actionState == 0) {                         // Action executing
801876a4: 34040064 ori r4,r0,0x0064
801876a8: 0c017833 jal 0x8005e0cc                   #       rollResult = Pass/Fail Roll (100, 19);      // Roll (0-99) and return 0 if result < 19 (19% chance)
801876ac: 34050013 ori r5,r0,0x0013
801876b0: 14400008 bne r2,r0,0x801876d4             #       if (rollResult != 0) {                      // Roll was under 19 (19% chance)
801876b4: 00000000 nop
801876b8: 3c038019 lui r3,0x8019
801876bc: 8c632d90 lw r3,0x2d90(r3)                 #           action
801876c0: 00000000 nop
801876c4: 94620010 lhu r2,0x0010(r3)                #           action.0x10                             // (halfword)
801876c8: 00000000 nop
801876cc: 34420200 ori r2,r2,0x0200                 #           action.0x10 | 0x200
801876d0: a4620010 sh r2,0x0010(r3)                 #           action.0x10 = action.0x10 | 0x200       // Flags status proc?
                                                    #       }
                                                    #   }
801876d4: 8fbf0010 lw r31,0x0010(r29)
801876d8: 27bd0018 addiu r29,r29,0x0018
801876dc: 03e00008 jr r31
801876e0: 00000000 nop

Notes

If Action is being executed ( 0x8018f5fc = 0x00)
    -->Pass/Fail Roll  Returns r2 = 0x00 if Proc is ok (random between 0-100 is < 19)
    If Proc is triggered ( Random < 19% )
        |Enable Target Current Action Special flag 2 0x02 (preserves other flags)

Return Location

801884d0: Conditional Status Proc Roll (19%)