Caterkiller Fix - RetroKoH/S1Fixed GitHub Wiki
(Original guide by Mercury)
Source: ReadySonic
Main Commit: 1b29604
Second Commit: 250f2fa
The Caterkiller enemy is an interesting one. It's tricky to defeat with a jump, as you have to land precisely on the head. Landing on the body will cause you damage, and cause it to break apart, potentially causing more damage. Its weakness? It can be easily dispatched by rolling into it from the front.
The problem with this, however, is that this mechanic is completely ruined because Sonic can still get hurt even if he rolls into one while moving too fast - he'll move fast enough to bump into the spiky segment behind the head and get hurt anyway. This is especially likely if he uses the Spindash to defeat the Caterkiller. Let's fix this.
Bugfix
In _incObj\sub ReactToItem.asm, go to React_Caterkiller and add these lines:
React_Caterkiller:
+ move.b #1,d0
+ move.w obInertia(a0),d1
+ bmi.s .skip
+ move.b #0,d0
+ .skip:
+ move.b obStatus(a1),d1
+ andi.b #1,d1
+ cmp.b d0,d1 ; are Sonic and the Caterkiller facing the same way?
+ bne.s .hurt ; if not, branch
+ btst #staAir,obStatus(a0) ; is Sonic in the air?
+ bne.s .hurt ; if so, branch
+ btst #staSpin,obStatus(a0) ; is Sonic spinning?
+ beq.s .hurt ; if not, branch
+ moveq #-1,d0 ; else, he shouldn't be hurt
+ rts
+ .hurt:
bset #7,obStatus(a1)
React_ChkHurt:
Additional Change (Bugged?)
NOTE: ReadySonic applied a second fix that I later removed in a more recent commit (noted above). Mercury added this line in an attempt to fix a bug with object collision behavior with the broken body parts. I noticed, however, that Sonic could no longer damage the Caterkiller head after the Caterkiller broke apart. Removing this line fixed that bug, and the body parts seemingly behave normally. For posterity, here is Mercury's added line of code that I later removed. Go to _incObj\78 Caterkiller.asm and find loc_16CAA:. At the very end, Mercury added this line.
move.w d0,obVelX(a0)
move.w #-$400,obVelY(a0)
move.b #$C,obRoutine(a0)
+ move.b #$98,obColType(a0)
andi.b #$F8,obFrame(a0)
loc_16CC0:
With this added line, all parts, including the head, always hurt Sonic. It's possible that other changes made to the Caterkiller object, and ReactToItem, rendered this change unnecessary. Please keep this in mind if applying this fix.