Users browsing this thread: 1 Guest(s)
Jumping Imps, Land!

Posts: 335
Threads: 26
Thanks Received: 135
Thanks Given: 125
Joined: Dec 2018
Reputation: 18
This is a vanilla-in-principle bug, as it's an error in how the jump code is handled but it is created by a situation that cannot happen in Vanilla.

The jump command can be set to be imp-restricted... Kappa!
But if you do that, you'll get an edge case where an imp jumps up... and doesn't come down.  Instead, they'll attack as if they used the fight command and become untargetable for the rest of the fight.  This happens with enemies, too, which can cause a disastrous soft-lock in the Dadaluma fight (if you had access to Imp at that point in the game, that is!).

To make the Jump command play better with the editor, Serity suggested this fix and I scrapped together some code to make it happen.

Airborne Imp fix
C2/02a0:    [1 - Hook interrupt to Imp command blocker]
    4C FD FB            JMP FreespaceC2

C2/FBF2:    [2 - Airborne bypass exit for Imp command blocker] ***Could be FBFA
    4C DA 02            JMP ExitCommandBlock            ; If airborne, skip the command blocking check so the imp can come down.
C2/FBFD:    [3 - Check for Airborne Imps and prohibit command if grounded]
    C2 20                REP #$20
    BD 18 30            LDA $3018,X
    2C 2C 3F            BIT $3F2C                          ; Are they in the middle of a Jump?
    E2 20                SEP #$20
    D0 E9                BRA Back to C2/FBF2   %%%If FBFA instead, this is D0 F1
    BD E4 3E            LDA $3EE4,X
    4C A3 02            JMP $02A3                        ; Continue with Imp check for command blocking.
This code isn't optimized, there's a gap in the middle of it because I was pressed for space in the C2 bank.  The code consists of three parts; an interrupt hook to the Imp command restrictions, a check if the imp is airborne, and two exits: one where Jump is prohibited and one where Jump is permitted.

Jump MUST be permitted if the Imp is airborne, because the landing command--while queued separately--is handled as a jump command and the imp blocker will stop it otherwise.

No .ips patch for this one, and apologies that it's not in one continuous block.  You'll have to recalculate the backwards branch (or make it a forwards branch) if you put the two pieces in an adjoining spot.  For your convenience, that branch calculation has already been done if you place the second section immediately before the third [C2/FBFA with these default addresses].

Messages In This Thread
Jumping Imps, Land! - by C-Dude - 09-18-2021, 10:07 PM

Forum Jump:

Users browsing this thread: 1 Guest(s)

Theme by Madsiur2017Custom Graphics by JamesWhite