Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; ===============================================================
- ; GHZ MidBoss Object
- ; ===============================================================
- Xpos = 8
- Ypos = $C
- ; ---------------------------------------------------------------
- Obj_GHZ_MidBoss:
- move.b #4,render(a0)
- move.w #$43AA,art(a0)
- move.l #???,maps(a0) ; use ??? mappings
- move.b #$20,visible_width(a0)
- move.b #$16,height(a0)
- move.l #GHZ_MidBoss_Idle,obj(a0)
- ; ===============================================================
- ; ---------------------------------------------------------------
- ; The ??? sits still waiting while Sonic passes it
- ; ---------------------------------------------------------------
- GHZ_MidBoss_Idle:
- cmpi.b #4,LvlEventsRoutine
- beq.s GHZ_MidBoss_ToBounceSequence
- ; Make idle ??? solid
- moveq #$1C,d1
- moveq #$16,d2
- moveq #$19,d3
- move.w Xpos(a0),d4
- jsr SolidObject
- ; ===============================================================
- ; ---------------------------------------------------------------
- ; Subroutine to display the ??? and apply rolling
- ; ---------------------------------------------------------------
- rotframe = $26 ; .w Rotation frame ($100..$3FF)
- rotspeed = $28 ; .w Rotation speed
- GHZ_MidBoss_RotDisplay:
- ; apply rotation speed
- move.w rotspeed(a0),d0
- add.w d0,rotframe(a0)
- ; make sure the frame is within 1..3 range
- move.b rotframe(a0),d0
- andi.b #%11,d0
- bne.s @0
- moveq #1,d0
- @0 move.b d0,rotframe(a0)
- ; display a frame
- btst.b #0,LevelTimer+1 ; even = 'rotframe'
- beq.s @1 ; odd = $00
- moveq #0,d0
- @1 move.b d0,frame(a0)
- jmp DisplaySprite
- ; ---------------------------------------------------------------
- ; Subroutine to stop the ??? rolling
- ; ---------------------------------------------------------------
- GHZ_MidBoss_StopRotate:
- cmpi.b #1,rotframe(a0)
- bne.s @Quit
- clr.w rotspeed(a0)
- @Quit rts
- ; ===============================================================
- ; ===============================================================
- ; ---------------------------------------------------------------
- ; The ??? bounces through the boss arena
- ; ---------------------------------------------------------------
- ; For bouncing sequence
- CamBaseX = $2600
- CamBaseY = $300
- bouncespeed = $14
- GHZ_MidBoss_ToBounceSequence:
- move.l #GHZ_MidBoss_BounceSequence,obj(a0)
- GHZ_MidBoss_BounceSequence:
- ; Scroll Camera
- move.w CamXpos,d1 ; d1 = CamXPos
- cmpi.w #CamBaseX+$300,d1 ; camera stops at this point
- beq.s @Bounce_ToChkBoundary ; and objects goes to new routine...
- addq.w #1,CamRightBound ; scroll camera right
- cmpi.w #CamBaseX+$40,d1
- beq.s @Setup???
- bhi.s @Bounce_Process
- rts
- ; ---------------------------------------------------------------
- @Setup???:
- ; Setup bouncing ???
- move.b #$81,touch(a0) ; it hurts
- move.w #CamBaseX,Xpos(a0)
- move.w #CamBaseY+$40,Ypos(a0)
- move.w #$170,XVel(a0)
- move.w #$40,rotspeed(a0)
- move.w #-$7C0,bouncespeed(a0)
- bra.s @Bounce_Process
- ; ---------------------------------------------------------------
- @Bounce_ToChkBoundary:
- move.l #@Bounce_ChkBoundary,obj(a0)
- @Bounce_ChkBoundary:
- ; Check if ??? reached it's destination place
- cmpi.w #CamBaseX+$440-$28,Xpos(a0) ; has the ??? reached stop point?
- bcs.s @Bounce_Process ; not yet...
- clr.w Xvel(a0) ; stop the ???
- move.l #@Bounce_StopRotate,obj(a0)
- @Bounce_StopRotate:
- bsr GHZ_MidBoss_StopRotate
- @Bounce_Process:
- ; Make ??? fall
- jsr ObjectFall
- ; Check if the ??? collided with the floor
- jsr ObjHitFloor
- tst.w d1
- bpl GHZ_MidBoss_RotDisplay
- add.w d1,Ypos(a0)
- moveq #$FFFFFFBD,d0
- jsr PlaySound_Special
- ; Check if the ??? should stop (bounce weaker and weaker)
- move.w bouncespeed(a0),d0 ; d0 = BounceSpeed
- tst.w Xvel(a0)
- bne.s @1 ; not yet...
- move.w d0,d1
- asr.w #2,d1 ; d1 = BounceSpeed / 4
- sub.w d1,d0
- move.w d0,bouncespeed(a0) ; save new BounceSpeed
- cmpi.w #-$200,d0 ; is speed too fucking small?
- bge.s GHZ_MidBoss_ToIntro ; yes, we're done!
- @1 move.w d0,Yvel(a0)
- bra GHZ_MidBoss_RotDisplay
- ; ===============================================================
- ; ---------------------------------------------------------------
- ; Boss battle beings!
- ; ---------------------------------------------------------------
- timer = $38 ; .w
- GHZ_MidBoss_ToIntro:
- moveq #$FFFFFFE0,d0 ; Fade out music
- jsr PlaySound_Special
- move.w #3*60,timer(a0) ; Setup timer
- move.l #GHZ_MidBoss_Intro,obj(a0)
- GHZ_MidBoss_Intro:
- jsr ObjectTimer
- bne GHZ_MidBoss_RotDisplay ; no timer
- moveq #$FFFFFF9C,d0 ; Play boss music
- jsr PlaySound
- move.l #GHZ_MidBoss_RotDisplay,obj(a0)
- bra GHZ_MidBoss_RotDisplay
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement