Rebound Mod - RetroKoH/S1Fixed GitHub Wiki
(Original guide by Mercury)
Source: ReadySonic
Original Commit: c5fd9a4
Bugfix Commit: 8486d6c
This mod can be toggled in S1Fixed by setting ReboundMod to 0 or 1.
When Sonic jumps onto an enemy or a monitor, his rebound is dependent upon whether or not the player is holding down a jump button. If a button is held down, Sonic will rebound higher into the air, and if not, then he won't.
This behavior isn't quite the same if he rolls onto an enemy or monitor. A great place to observe this is in Star Light Zone 1. Roll through the breakable wall and watch as he bounces off the monitors, rebounding high into the air, regardless of your input.
This MIGHT be ideal, but we can adjust this to be more consistent with rebounding while jumping. Open _incObj/sub ReactToItem.asm, and enjoy relief that all of our work is in this one file, and it's quite easy!
Monitors
First, we need to apply the mod to monitor collision. Go to the label React_Monitor. Scroll down a bit to find .movingdown and add:
.movingdown:
cmpi.b #aniID_Roll,obAnim(a0) ; is Sonic rolling/jumping?
bne.s .donothing ; if not, branch
neg.w obVelY(a0) ; reverse Sonic's y-motion
! tst.b obJumping(a0) ; +++ Double Jump BUGFIX
! bne.s .isjumping ; +++ Double Jump BUGFIX
+ move.b #1,obJumping(a0)
! move.b #3,obDoubleJumpFlag(a0) ; +++ Double Jump BUGFIX
!.isjumping:
addq.b #2,obRoutine(a1) ; advance the monitor's routine counter
Badniks
Next, go to the label React_Enemy. Scroll down a bit to find .lessthan16 and add the same line here:
.lessthan16:
bsr.w AddPoints
_move.b #id_ExplosionItem,obID(a1) ; change object to explosion
clr.b obRoutine(a1)
tst.w obVelY(a0)
bmi.s .bouncedown
move.w obY(a0),d0
cmp.w obY(a1),d0
bhs.s .bounceup
neg.w obVelY(a0)
! tst.b obJumping(a0) ; +++ Double Jump BUGFIX
! bne.s .isjumping ; +++ Double Jump BUGFIX
+ move.b #1,obJumping(a0)
! move.b #3,obDoubleJumpFlag(a0) ; +++ Double Jump BUGFIX
!.isjumping:
rts
Note that the orange marked lines are only to be added if you are adding double jump abilities. These marked lines are important because without them, you can roll onto an enemy or monitor, then initiate a double jump ability. I set the double jump flag to 3 because of how I set up double jumps, namely the Drop Dash. You can use whatever value suits, but it really shouldn't matter.
But... if you actually want that behavior (greater ease of use w/ Drop Dash, perhaps?), don't add those lines.