Correct CPZ boss attack behavior
From Sonic Retro
Revision as of 21:47, 20 December 2015 by Scarred Sun (talk | contribs) (Text replacement - "<asm>" to "<syntaxhighlight lang="asm">")
(Guide by redhotsonic using the 2007 Xenowhirl disassembly)
As many of you are aware, during the CPZ boss, when Eggman drops the blue slime on you, ducking will protect you, and the chemical cannot hurt you, making it too easy to defend against Eggman's attacks. To fix this so you will get hurt whilst ducking, follow this.
The Fix
Go to "loc_2E692:" (OR "Obj5D_Gunk_Init:") and you'll see this:
loc_2E692:
addq.b #2,routine_secondary(a0)
move.b #$20,y_radius(a0)
move.b #$19,anim(a0)
move.w #0,y_vel(a0)
movea.l objoff_34(a0),a1 ; a1=object
movea.l $34(a1),a1
btst #2,$2D(a1)
beq.s loc_2E6CA
bclr #2,$2D(a1)
move.b #6,routine_secondary(a0)
move.w #9,objoff_2A(a0)
See that command?
move.b #$20,y_radius(a0)
Change #$20 to #$16. So you have this in the end:
loc_2E692:
addq.b #2,routine_secondary(a0)
move.b #$16,y_radius(a0)
move.b #$19,anim(a0)
move.w #0,y_vel(a0)
movea.l objoff_34(a0),a1 ; a1=object
movea.l $34(a1),a1
btst #2,$2D(a1)
beq.s loc_2E6CA
bclr #2,$2D(a1)
move.b #6,routine_secondary(a0)
move.w #9,objoff_2A(a0)
DONE!
Explanation
The slime's y_radius is $20. This is fine normally. But when Sonic "ducks", Sonic's y_radius is "shortened". So, now, when the gunk is falling and hits the ground, it actually doesn't touch Sonic.
Because we have "lowered" the gunk's y_radius, its distance from the floor has grown just a little bit. Because of this, the chemical now falls down, just a little bit more, and because of this, it will now hit Sonic when he's "ducking", and it will still hurt Sonic in any other position as well.
BONUS
THIS IS JUST FOR LAUGHS, but try it anyway! Back at the label "loc_2E692:". See these two lines?
btst #2,$2D(a1)
beq.s loc_2E6CA
Comment them out! And see what happens for yourself! (SPOILER ALERT: Or, don't be a fun person, and check the OP to see the picture instead... [1] I hate you.)
FOR MORE FUN, CHECK OUT THIS GUIDE!