Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; ---------------------------------------------------------------------------
- ; Босс-шар
- ; ---------------------------------------------------------------------------
- ; Hits
- BossGreyBall_Hits = 6
- ; Attributes
- _Setup4 = 8
- _Setup5 = $A
- _Setup6 = $C
- _Setup7 = $E
- _Setup8 = $10
- _Setup9 = $12
- ; Dynamic object variables
- obBGB_XPos = $30 ; .w
- obBGB_Routine = $32 ; .b
- obBGB_Draw = $33 ; .b
- ; =============== S U B R O U T I N E =======================================
- Obj_BossGreyBall:
- moveq #0,d0
- move.b routine(a0),d0
- move.w BossGreyBall_Index(pc,d0.w),d0
- jsr BossGreyBall_Index(pc,d0.w)
- bsr.w BossGreyBall_CheckTouch
- moveq #0,d0
- btst #0,(V_int_run_count+3).w
- beq.s +
- addq.b #1,d0
- + move.b d0,mapping_frame(a0)
- tst.b obBGB_Draw(a0)
- bne.w BossGreyBall_CheckCameraPosition_Return
- jmp (Draw_And_Touch_Sprite).l
- ; ---------------------------------------------------------------------------
- BossGreyBall_Index: offsetTable
- offsetTableEntry.w BossGreyBall_Init ; 0
- offsetTableEntry.w BossGreyBall_Setup ; 2
- offsetTableEntry.w BossGreyBall_Setup2 ; 4
- offsetTableEntry.w BossGreyBall_Setup3 ; 6
- offsetTableEntry.w BossGreyBall_Setup4 ; 8
- offsetTableEntry.w BossGreyBall_Setup5 ; A
- offsetTableEntry.w BossGreyBall_Setup6 ; C
- offsetTableEntry.w BossGreyBall_Setup7 ; E
- offsetTableEntry.w BossGreyBall_Setup8 ; 10
- offsetTableEntry.w BossGreyBall_Setup9 ; 12
- ; ---------------------------------------------------------------------------
- BossGreyBall_Init:
- lea ObjDat3_BossGreyBall(pc),a1
- jsr (SetUp_ObjAttributes).l
- st (Boss_flag).w
- move.b #62/2,y_radius(a0)
- move.b #BossGreyBall_Hits,collision_property(a0)
- move.l #BossGreyBall_Intro,$34(a0)
- lea ChildObjDat_BossGreyBall_Face(pc),a2
- jmp (CreateChild6_Simple).l
- ; ---------------------------------------------------------------------------
- BossGreyBall_Setup2:
- bsr.s BossGreyBall_CheckCameraPosition
- jsr (Find_SonicTails).l
- addi.w #$20,d2
- cmpi.w #$80,d2
- blo.s BossGreyBall_Setup3
- move.w #$100,d1
- tst.w d0
- bne.s +
- neg.w d1
- + move.w d1,x_vel(a0)
- BossGreyBall_Setup3:
- jsr (Swing_UpAndDown).l
- BossGreyBall_Setup:
- jsr (MoveSprite2).l
- BossGreyBall_Setup_2:
- jmp (Obj_Wait).l
- ; ---------------------------------------------------------------------------
- BossGreyBall_Setup5:
- jsr (Swing_LeftAndRight).l
- bra.s BossGreyBall_Setup
- ; ---------------------------------------------------------------------------
- BossGreyBall_Setup4:
- jsr (MoveSprite).l
- jmp (ObjHitFloor_DoRoutine).l
- ; ---------------------------------------------------------------------------
- BossGreyBall_Setup6:
- bsr.s BossGreyBall_CheckCameraPosition
- bsr.s BossGreyBall_CreateFire
- bsr.s BossGreyBall_CheckFireShield
- jsr (MoveSprite).l
- bra.s BossGreyBall_Setup_2
- ; ---------------------------------------------------------------------------
- BossGreyBall_Setup7:
- bsr.s BossGreyBall_CheckCameraPosition
- bsr.s BossGreyBall_CreateFire
- bsr.s BossGreyBall_CheckFireShield
- bra.s BossGreyBall_Setup
- ; ---------------------------------------------------------------------------
- BossGreyBall_Setup8:
- move.w (Oscillating_Data+2).w,d0
- asr.w #1,d0
- move.w d0,x_vel(a0)
- bra.s BossGreyBall_Setup3
- ; ---------------------------------------------------------------------------
- BossGreyBall_Setup9:
- bsr.w BossGreyBall_CreateFire
- move.b (Level_frame_counter+1).w,d0
- andi.w #7,d0
- bne.s +
- sfx sfx_BreakBridge,0,0,0
- + bra.s BossGreyBall_Setup
- ; =============== S U B R O U T I N E =======================================
- BossGreyBall_CheckCameraPosition:
- move.w (Camera_X_pos).w,d0
- addi.w #$20,d0
- cmp.w x_pos(a0),d0
- blt.s +
- neg.w x_vel(a0)
- + addi.w #$100,d0
- cmp.w x_pos(a0),d0
- bgt.s BossGreyBall_CheckCameraPosition_Return
- neg.w x_vel(a0)
- BossGreyBall_CheckCameraPosition_Return:
- rts
- ; =============== S U B R O U T I N E =======================================
- BossGreyBall_CheckFireShield:
- lea (Player_1).w,a1
- cmpi.b #id_SonicDeath,routine(a1)
- bhs.s BossGreyBall_CheckFireShield_Return
- btst #Status_FireShield,status_secondary(a1)
- bne.s BossGreyBall_CheckFireShield_Return
- bsr.w BossGreyBall_FinalPhase_Intro_CreateFireShield
- BossGreyBall_CheckFireShield_Return:
- rts
- ; =============== S U B R O U T I N E =======================================
- BossGreyBall_CreateFire:
- btst #1,(Level_frame_counter+1).w
- beq.s +
- lea ChildObjDat_BossGreyBall_Fire(pc),a2
- jsr (CreateChild6_Simple).l
- bne.s +
- move.b #48/2,$3A(a1)
- move.b #48/2,$3B(a1)
- move.w #$100,$3C(a1)
- + rts
- ; =============== S U B R O U T I N E =======================================
- BossGreyBall_CreateFire_2:
- btst #1,(Level_frame_counter+1).w
- beq.s +
- lea ChildObjDat_BossGreyBall_Fire(pc),a2
- jsr (CreateChild6_Simple).l
- bne.s +
- move.b #24/2,$3A(a1)
- move.b #24/2,$3B(a1)
- move.w #$80,$3C(a1)
- + rts
- ; ---------------------------------------------------------------------------
- ; Интро
- ; ---------------------------------------------------------------------------
- ; =============== S U B R O U T I N E =======================================
- BossGreyBall_Intro:
- sfx sfx_Flash,0,0,0
- move.b #4,(Hyper_Sonic_flash_timer).w
- move.l #BossGreyBall_CheckFireShield_Return,$34(a0)
- lea ChildObjDat_BossGreyBall_IntroClone(pc),a2
- jmp (CreateChild6_Simple).l
- ; ---------------------------------------------------------------------------
- BossGreyBall_Intro_MoveSwing:
- move.b #_Setup8,routine(a0)
- tst.b (Intro_flag).w
- bne.s BossGreyBall_Intro_SkipIntro
- st (Intro_flag).w
- move.l #BossGreyBall_CheckFireShield_Return,$34(a0)
- lea ChildObjDat_Dialog_Process(pc),a2
- jsr (CreateChild6_Simple).l
- bne.s +
- move.b #_GreyBallStart,routine(a1)
- move.l #DialogGreyBallStart_Process_Index-4,$34(a1)
- move.b #(DialogGreyBallStart_Process_Index_End-DialogGreyBallStart_Process_Index)/8,$39(a1)
- + bra.w BossGreyBall_Swing_Setup
- ; ---------------------------------------------------------------------------
- BossGreyBall_Intro_SkipIntro:
- move.w #$F,$2E(a0)
- move.w #-$100,y_vel(a0)
- move.b #_Setup1,routine(a0)
- move.l #BossGreyBall_Intro_CheckPosition,$34(a0)
- lea ChildObjDat_RobotnikHud(pc),a2
- jsr (CreateChild6_Simple).l
- bne.s +
- move.w a0,parent3(a1)
- + sf (Ctrl_1_locked).w
- jmp (Restore_PlayerControl).l
- ; ---------------------------------------------------------------------------
- BossGreyBall_Intro_CheckPosition:
- move.w (Camera_Y_pos).w,d0
- addi.w #$50,d0
- cmp.w y_pos(a0),d0
- blo.s BossGreyBall_Intro_CheckPosition_Return
- move.l #BossGreyBall_SetSubroutine,$34(a0)
- clr.l x_vel(a0)
- lea ChildObjDat_BossGreyBall_Designator(pc),a2
- jsr (CreateChild1_Normal).l
- BossGreyBall_Intro_CheckPosition_Return:
- rts
- ; =============== S U B R O U T I N E =======================================
- BossGreyBall_SetSubroutine:
- moveq #0,d0
- move.b obBGB_Routine(a0),d0
- addq.b #1,obBGB_Routine(a0)
- move.b BossGreyBall_SetMovement(pc,d0.w),d0
- bmi.s +
- move.l BossGreyBall_Movement(pc,d0.w),$34(a0)
- rts
- + clr.b obBGB_Routine(a0)
- rts
- ; ---------------------------------------------------------------------------
- BossGreyBall_SetMovement:
- dc.b 0
- dc.b 1<<2
- dc.b 2<<2
- dc.b 1<<2
- dc.b -1 ; Конец
- even
- BossGreyBall_Movement:
- dc.l BossGreyBall_MoveSpikeBall_Explosion ; 0
- dc.l BossGreyBall_MoveSpikeBall_Hand ; 1
- dc.l BossGreyBall_MoveSpikeBall_Bounced ; 2
- ; ---------------------------------------------------------------------------
- ; Босс атакует с помощью взрывающихся шипастых шаров
- ; ---------------------------------------------------------------------------
- ; =============== S U B R O U T I N E =======================================
- BossGreyBall_MoveSpikeBall_Explosion:
- move.b #_Setup2,routine(a0)
- bsr.w BossGreyBall_Swing_Setup
- move.b #6,$39(a0)
- jsr (Find_SonicTails).l
- move.w #$100,x_vel(a0)
- tst.w d0
- bne.s +
- neg.w x_vel(a0)
- + move.l #BossGreyBall_MoveSpikeBall_Explosion_Attack,$34(a0)
- BossGreyBall_MoveSpikeBall_Explosion_Attack:
- move.w #$6F,$2E(a0)
- lea ChildObjDat_BossGreyBall_SpikeBall_Explosion(pc),a2
- jsr (CreateChild6_Simple).l
- subq.b #1,$39(a0)
- bne.s +
- move.l #BossGreyBall_SetSubroutine,$34(a0)
- + rts
- ; ---------------------------------------------------------------------------
- ; Босс атакует с помощью шипастой руки
- ; ---------------------------------------------------------------------------
- ; =============== S U B R O U T I N E =======================================
- BossGreyBall_MoveSpikeBall_Hand:
- move.b #_Setup3,routine(a0)
- bsr.w BossGreyBall_Swing_Setup
- move.l #BossGreyBall_MoveSpikeBall_Hand_CheckPosition,$34(a0)
- jsr (Find_SonicTails).l
- move.w #$10,d1
- tst.w d0
- bne.s +
- move.w #$130,d1
- + move.w d1,obBGB_XPos(a0)
- BossGreyBall_MoveSpikeBall_Hand_CheckPosition:
- move.w (Camera_X_pos).w,d0
- add.w obBGB_XPos(a0),d0
- sub.w x_pos(a0),d0
- bmi.s +
- cmpi.w #20,d0
- bhs.s +++
- bra.s ++
- + cmpi.w #-20,d0
- blo.s ++
- + move.l #BossGreyBall_MoveSpikeBall_Hand_Bounced,$34(a0)
- + asl.w #3,d0
- move.w d0,x_vel(a0)
- BossGreyBall_MoveSpikeBall_Hand_Wait:
- rts
- ; ---------------------------------------------------------------------------
- BossGreyBall_MoveSpikeBall_Hand_Bounced:
- move.b #_Setup4,routine(a0)
- move.l #BossGreyBall_MoveSpikeBall_Hand_CheckBounced,$34(a0)
- clr.w x_vel(a0)
- rts
- ; ---------------------------------------------------------------------------
- BossGreyBall_MoveSpikeBall_Hand_CheckBounced:
- move.w y_vel(a0),d0
- bmi.s BossGreyBall_MoveSpikeBall_Hand_Wait
- cmpi.w #$180,d0
- blo.s BossGreyBall_MoveSpikeBall_Hand_SetCreate
- asr.w d0
- neg.w d0
- move.w d0,y_vel(a0)
- BossGreyBall_MoveSpikeBall_Hand_Shaking:
- move.w #$14,(Screen_Shaking_Flag).w
- lea ChildObjDat_BossGreyBall_Spark(pc),a2
- jsr (CreateChild6_Simple).l
- moveq #sfx_Wham,d0
- jmp (Play_Sound_2).l
- ; ---------------------------------------------------------------------------
- BossGreyBall_MoveSpikeBall_Hand_SetCreate:
- move.b #_Setup1,routine(a0)
- move.w #$1F,$2E(a0)
- move.l #BossGreyBall_MoveSpikeBall_Hand_Create,$34(a0)
- clr.w y_vel(a0)
- rts
- ; ---------------------------------------------------------------------------
- BossGreyBall_MoveSpikeBall_Hand_Create:
- move.l #BossGreyBall_MoveSpikeBall_Hand_Wait,$34(a0)
- lea ChildObjDat_BossGreyBall_SpikeBall(pc),a2
- jmp (CreateChild6_Simple).l
- ; ---------------------------------------------------------------------------
- BossGreyBall_MoveSpikeBall_Hand_ReturnPosition:
- move.b #_Setup5,routine(a0)
- move.w #$2F,$2E(a0)
- move.l #BossGreyBall_MoveSpikeBall_Hand_Return,$34(a0)
- move.w #-$200,y_vel(a0)
- bra.w BossGreyBall_Swing_Setup2
- ; ---------------------------------------------------------------------------
- BossGreyBall_MoveSpikeBall_Hand_Return:
- move.b #_Setup3,routine(a0)
- move.l #BossGreyBall_SetSubroutine,$34(a0)
- clr.w x_vel(a0)
- rts
- ; ---------------------------------------------------------------------------
- ; Босс атакует с помощью шипастых шаров на цепи
- ; ---------------------------------------------------------------------------
- ; =============== S U B R O U T I N E =======================================
- BossGreyBall_MoveSpikeBall_Bounced:
- move.b #_Setup2,routine(a0)
- bsr.w BossGreyBall_Swing_Setup
- move.b #4,$39(a0)
- jsr (Find_SonicTails).l
- move.w #$100,x_vel(a0)
- tst.w d0
- bne.s +
- neg.w x_vel(a0)
- + move.l #BossGreyBall_MoveSpikeBall_Bounced_Attack,$34(a0)
- BossGreyBall_MoveSpikeBall_Bounced_Attack:
- move.w #$EF,$2E(a0)
- lea ChildObjDat_BossGreyBall_SpikeBall_Bounced(pc),a2
- jsr (CreateChild6_Simple).l
- subq.b #1,$39(a0)
- bne.s +
- move.l #BossGreyBall_SetSubroutine,$34(a0)
- + rts
- ; ---------------------------------------------------------------------------
- ; Интро (последняя фаза)
- ; ---------------------------------------------------------------------------
- ; =============== S U B R O U T I N E =======================================
- BossGreyBall_FinalPhase_Intro:
- move.b #_Setup5,routine(a0)
- move.l #BossGreyBall_FinalPhase_Intro_CheckPosition,$34(a0)
- move.w #-$200,y_vel(a0)
- move.b #$67,(Negative_flash_timer).w
- bra.w BossGreyBall_Swing_Setup2
- ; ---------------------------------------------------------------------------
- BossGreyBall_FinalPhase_Intro_CheckPosition:
- bsr.w BossGreyBall_CreateFire
- move.b (Level_frame_counter+1).w,d0
- andi.w #7,d0
- bne.s +
- sfx sfx_BreakBridge,0,0,0
- + move.w (Camera_Y_pos).w,d0
- addi.w #$40,d0
- cmp.w y_pos(a0),d0
- blo.s BossGreyBall_FinalPhase_Intro_Return
- move.b #_Setup9,routine(a0)
- move.w #$1F,$2E(a0)
- move.l #BossGreyBall_FinalPhase_Intro_Fall,$34(a0)
- clr.l x_vel(a0)
- rts
- ; ---------------------------------------------------------------------------
- BossGreyBall_FinalPhase_Intro_Fall:
- move.b #_Setup1,routine(a0)
- move.l #BossGreyBall_MoveJump_Attack,$34(a0)
- clr.l x_vel(a0)
- lea (Player_1).w,a1
- sfx sfx_FireShield,0,0,0
- BossGreyBall_FinalPhase_Intro_CreateFireShield:
- andi.b #$8E,status_secondary(a1)
- bset #Status_FireShield,status_secondary(a1)
- move.l #Obj_Fire_Shield,(v_Shield).w
- move.w a1,(v_Shield+parent).w
- BossGreyBall_FinalPhase_Intro_Return:
- rts
- ; ---------------------------------------------------------------------------
- ; Босс атакует с помощью прыжка (последняя фаза)
- ; ---------------------------------------------------------------------------
- ; =============== S U B R O U T I N E =======================================
- BossGreyBall_MoveJump_Attack:
- move.b #_Setup6,routine(a0)
- move.l #BossGreyBall_MoveJump_Floor,$34(a0)
- BossGreyBall_MoveJump_Wait:
- rts
- ; ---------------------------------------------------------------------------
- BossGreyBall_MoveJump_Floor:
- tst.w y_vel(a0)
- bmi.s BossGreyBall_MoveJump_Wait
- jsr (ObjCheckFloorDist).l
- tst.w d1
- bpl.s BossGreyBall_MoveJump_Wait
- add.w d1,y_pos(a0)
- move.l #BossGreyBall_MoveJump_CheckBounced,$34(a0)
- BossGreyBall_MoveJump_CheckBounced:
- move.w y_vel(a0),d0
- bmi.w BossGreyBall_MoveJump_Wait
- cmpi.w #$180,d0
- blo.s BossGreyBall_MoveJump_JumpWait
- asr.w d0
- neg.w d0
- move.w d0,y_vel(a0)
- move.l #BossGreyBall_MoveJump_Floor,$34(a0)
- bra.w BossGreyBall_MoveSpikeBall_Hand_Shaking
- ; ---------------------------------------------------------------------------
- BossGreyBall_MoveJump_JumpWait:
- move.b #_Setup7,routine(a0)
- move.l #BossGreyBall_MoveJump_StopVelocity,$34(a0)
- clr.w y_vel(a0)
- rts
- ; ---------------------------------------------------------------------------
- BossGreyBall_MoveJump_StopVelocity:
- move.w x_vel(a0),d0
- beq.s BossGreyBall_MoveJump_Return
- cmpi.w #-1,d0
- beq.s BossGreyBall_MoveJump_Return
- asr.w d0
- move.w d0,x_vel(a0)
- move.w #$F,$2E(a0)
- rts
- ; ---------------------------------------------------------------------------
- BossGreyBall_MoveJump_Return:
- move.w #$2F,$2E(a0)
- move.l #BossGreyBall_MoveJump_Start,$34(a0)
- clr.w x_vel(a0)
- rts
- ; ---------------------------------------------------------------------------
- BossGreyBall_MoveJump_Start:
- move.l #BossGreyBall_MoveJump_Attack,$34(a0)
- jsr (Find_SonicTails).l
- move.w #$200,x_vel(a0)
- tst.w d0
- bne.s +
- neg.w x_vel(a0)
- + move.w #-$700,y_vel(a0)
- sfx sfx_Jump2,0,0,0
- move.w #$14,(Screen_Shaking_Flag).w
- lea ChildObjDat_BossGreyBall_SpikeBall_Shot(pc),a2
- jmp (CreateChild6_Simple).l
- ; ---------------------------------------------------------------------------
- ; Проверка урона
- ; ---------------------------------------------------------------------------
- ; =============== S U B R O U T I N E =======================================
- BossGreyBall_CheckTouch:
- tst.b collision_flags(a0)
- bne.s BossGreyBall_CheckTouch_Return
- move.b collision_property(a0),d4
- beq.w BossGreyBall_CheckTouch_WaitExplosive
- tst.b $1C(a0)
- bne.s +
- jsr (Find_SonicTails).l
- tst.w d1
- bne.s BossGreyBall_CheckTouch_Bounce
- sfx sfx_HitBoss,0,0,0
- move.b #$60,$1C(a0)
- bset #6,status(a0)
- cmpi.b #BossGreyBall_Hits/3,d4
- bne.s +
- bset #5,status(a0)
- move.w #-1,$2E(a0)
- move.b #-1,$1C(a0)
- move.l #BossGreyBall_FinalPhase_Intro,$34(a0)
- + moveq #0,d0
- btst #0,$1C(a0)
- bne.s +
- addi.w #7*2,d0
- + bsr.w BossGreyBall_PalFlash
- subq.b #1,$1C(a0)
- bne.s BossGreyBall_CheckTouch_Return
- bclr #6,status(a0)
- BossGreyBall_CheckTouch_Restore:
- move.b collision_restore_flags(a0),collision_flags(a0)
- BossGreyBall_CheckTouch_Return:
- rts
- ; ---------------------------------------------------------------------------
- BossGreyBall_CheckTouch_Bounce:
- sfx sfx_Bumper2,0,0,0
- addq.b #1,collision_property(a0)
- lea (Player_1).w,a1
- move.w x_pos(a1),d1
- move.w y_pos(a1),d2
- sub.w x_pos(a0),d1
- sub.w y_pos(a0),d2
- jsr (GetArcTan).l
- jsr (GetSineCosine).l
- move.w #$400,d2
- muls.w d2,d1
- asr.l #8,d1
- move.w d1,x_vel(a1)
- muls.w d2,d0
- asr.l #8,d0
- move.w d0,y_vel(a1)
- bra.s BossGreyBall_CheckTouch_Restore
- ; ---------------------------------------------------------------------------
- BossGreyBall_CheckTouch_WaitExplosive:
- move.l #BossGreyBall_CheckTouch_WaitExplosive_Restore,address(a0)
- bset #7,status(a0)
- clr.w x_vel(a0)
- move.w #-$300,y_vel(a0)
- clr.w $2E(a0)
- move.b #$4F,(Negative_flash_timer).w
- jmp (BossDefeated_NoTime).l
- ; ---------------------------------------------------------------------------
- BossGreyBall_CheckTouch_WaitExplosive_Restore:
- move.l #BossGreyBall_CheckTouch_WaitPlayerExplosive,address(a0)
- bclr #7,status(a0)
- lea ChildObjDat_BossGreyBall_Face(pc),a2
- jsr (CreateChild6_Simple).l
- st (Screen_Shaking_Flag).w
- st (NoPause_flag).w
- lea (Pal_DEZ2_Intro).l,a1
- lea (Normal_palette_line_2).w,a2
- moveq #7,d0
- - move.l (a1)+,(a2)+
- dbf d0,-
- bra.w BossGreyBall_CheckTouch_TimeExplosive
- ; ---------------------------------------------------------------------------
- BossGreyBall_CheckTouch_WaitPlayerExplosive:
- bsr.w BossGreyBall_CheckTouch_TimeExplosive
- move.b (Level_frame_counter+1).w,d0
- andi.w #7,d0
- bne.s +
- sfx sfx_BreakBridge,0,0,0
- + jsr (MoveSprite2).l
- move.w (Camera_Y_pos).w,d0
- addi.w #$60,d0
- cmp.w y_pos(a0),d0
- blo.s +
- move.l #BossGreyBall_CheckTouch_PlayerExplosive,address(a0)
- + bra.w BossGreyBall_CheckTouch_TimeExplosive
- ; ---------------------------------------------------------------------------
- BossGreyBall_CheckTouch_PlayerExplosive:
- lea (Player_1).w,a1
- btst #Status_InAir,status(a1)
- bne.s BossGreyBall_CheckTouch_TimeExplosive
- move.l #BossGreyBall_CheckTouch_TimeExplosive,address(a0)
- clr.w (Ctrl_1_logical).w
- jsr (Find_SonicTails).l
- move.b #$81,object_control(a1)
- move.w #id_LookUp<<8,anim(a1)
- jsr (Stop_Object).l
- bclr #Status_Facing,status(a1)
- tst.w d0
- beq.s +
- bset #Status_Facing,status(a1)
- + lea ChildObjDat_Dialog_Process(pc),a2
- jsr (CreateChild6_Simple).l
- bne.s BossGreyBall_CheckTouch_TimeExplosive
- move.b #_GreyBallEnd,routine(a1)
- move.l #DialogGreyBallEnd_Process_Index-4,$34(a1)
- move.b #(DialogGreyBallEnd_Process_Index_End-DialogGreyBallEnd_Process_Index)/8,$39(a1)
- BossGreyBall_CheckTouch_TimeExplosive:
- bsr.w BossGreyBall_CreateFire
- moveq #0,d0
- btst #0,(V_int_run_count+3).w
- beq.s +
- addq.b #1,d0
- + move.b d0,mapping_frame(a0)
- jmp (Draw_Sprite).l
- ; ---------------------------------------------------------------------------
- BossGreyBall_CheckTouch_SuperExplosive:
- move.b $40(a0),d0
- add.b d0,$3C(a0)
- btst #0,(Level_frame_counter+1).w
- beq.s +
- lea ChildObjDat_DEZRadiusSuperExplosion(pc),a2
- jsr (CreateChild6_Simple).l
- bne.s +
- move.b $3C(a0),$3C(a1)
- + move.b (Level_frame_counter+1).w,d0
- andi.w #7,d0
- bne.s +
- sfx sfx_BreakBridge,0,0,0
- + subq.w #1,$2E(a0)
- bpl.s +
- addq.b #2,(Dynamic_resize_routine).w
- move.l #Go_Delete_Sprite,address(a0)
- + rts
- ; ---------------------------------------------------------------------------
- ; Клон (Интро)
- ; ---------------------------------------------------------------------------
- ; =============== S U B R O U T I N E =======================================
- Obj_BossGreyBall_IntroClone:
- lea ObjDat3_BossGreyBall(pc),a1
- jsr (SetUp_ObjAttributes).l
- move.b #8,objoff_41(a0)
- move.b #64,objoff_3C(a0)
- move.b #128,objoff_3A(a0)
- move.l #BossGreyBall_IntroClone_Frame2,address(a0)
- tst.b subtype(a0)
- beq.s BossGreyBall_IntroClone_Frame2
- neg.b objoff_3C(a0)
- move.l #BossGreyBall_IntroClone_Frame1,address(a0)
- BossGreyBall_IntroClone_Frame1:
- btst #0,(Level_frame_counter+1).w
- beq.s BossGreyBall_IntroClone_Draw
- BossGreyBall_IntroClone_Return:
- rts
- ; ---------------------------------------------------------------------------
- BossGreyBall_IntroClone_Frame2:
- btst #0,(Level_frame_counter+1).w
- beq.s BossGreyBall_IntroClone_Return
- BossGreyBall_IntroClone_Draw:
- subq.b #2,objoff_3A(a0)
- bmi.s BossGreyBall_IntroClone_Remove
- move.b objoff_41(a0),d0
- add.b d0,objoff_3C(a0)
- jsr (MoveSprite_Circular).l
- jmp (Child_Draw_Sprite).l
- ; ---------------------------------------------------------------------------
- BossGreyBall_IntroClone_Remove:
- move.l #Go_Delete_Sprite,address(a0)
- tst.b subtype(a0)
- bne.s +
- movea.w parent3(a0),a1
- move.l #BossGreyBall_Intro_MoveSwing,$34(a1)
- sf obBGB_Draw(a1)
- + rts
- ; ---------------------------------------------------------------------------
- ; Указатель
- ; ---------------------------------------------------------------------------
- ; =============== S U B R O U T I N E =======================================
- Obj_BossGreyBall_Designator:
- lea ObjDat3_BossGreyBall_Designator(pc),a1
- jsr (SetUp_ObjAttributes3).l
- move.b #8,$40(a0)
- move.l #BossGreyBall_Designator_Frame2,address(a0)
- tst.b subtype(a0)
- beq.s BossGreyBall_Designator_Frame2
- neg.b $40(a0)
- move.l #BossGreyBall_Designator_Frame1,address(a0)
- BossGreyBall_Designator_Frame1:
- btst #0,(Level_frame_counter+1).w
- beq.s BossGreyBall_Designator_Draw
- BossGreyBall_Designator_Return:
- rts
- ; ---------------------------------------------------------------------------
- BossGreyBall_Designator_Frame2:
- btst #0,(Level_frame_counter+1).w
- beq.s BossGreyBall_Designator_Return
- BossGreyBall_Designator_Draw:
- jsr (Refresh_ChildPosition).l
- move.b $40(a0),d0
- add.b d0,child_dx(a0)
- beq.s BossGreyBall_Designator_Remove
- jmp (Child_Draw_Sprite).l
- ; ---------------------------------------------------------------------------
- BossGreyBall_Designator_Remove:
- move.l #Go_Delete_Sprite,address(a0)
- tst.b subtype(a0)
- bne.s BossGreyBall_Designator_Return
- move.w #$3F,$2E(a0)
- move.l #Go_Delete_Sprite,$34(a0)
- move.l #BossGreyBall_Designator_Main,address(a0)
- BossGreyBall_Designator_Main:
- jsr (Refresh_ChildPosition).l
- jsr (Obj_Wait).l
- btst #1,(Level_frame_counter+1).w
- beq.w BossGreyBall_SpikeBall_Bounced_Chain_Trail_CheckParent
- jmp (Child_Draw_Sprite).l
- ; ---------------------------------------------------------------------------
- ; Глаза
- ; ---------------------------------------------------------------------------
- ; =============== S U B R O U T I N E =======================================
- Obj_BossGreyBall_Face:
- lea ObjDat3_BossGreyBall_Face(pc),a1
- jsr (SetUp_ObjAttributes3).l
- move.l #BossGreyBall_Face_Main,address(a0)
- BossGreyBall_Face_Main:
- movea.w parent3(a0),a1
- move.w y_pos(a1),y_pos(a0)
- move.w (Player_1+x_pos).w,d0
- move.w x_pos(a1),d1
- sub.w d1,d0
- smi d2
- bpl.s +
- neg.w d0
- + cmpi.w #8,d0
- bls.s +
- moveq #8,d0
- + tst.b d2
- beq.s +
- neg.w d0
- + add.w d0,d1
- move.w d1,x_pos(a0)
- jsr (Find_SonicTails).l
- moveq #2,d0
- tst.w d1
- bne.s +
- addq.b #1,d0
- + move.b d0,mapping_frame(a0)
- movea.w parent3(a0),a1
- tst.b obBGB_Draw(a1)
- bne.w BossGreyBall_IntroClone_Return
- jmp (Child_Draw_Sprite).l
- ; ---------------------------------------------------------------------------
- ; Взрывающийся шипастый шар
- ; ---------------------------------------------------------------------------
- ; =============== S U B R O U T I N E =======================================
- Obj_BossGreyBall_SpikeBall_Explosion:
- lea ObjDat3_BossGreyBall_SpikeBall(pc),a1
- jsr (SetUp_ObjAttributes3).l
- jsr (Find_SonicTails).l
- move.b #1,objoff_41(a0)
- move.b #64,objoff_3C(a0)
- tst.w d0
- bne.s +
- neg.b objoff_3C(a0)
- neg.b objoff_41(a0)
- + move.b #44/2,y_radius(a0)
- move.l #BossGreyBall_SpikeBall_Explosion_Radius,address(a0)
- BossGreyBall_SpikeBall_Explosion_Radius:
- jsr (MoveSprite_Circular).l
- addq.b #1,objoff_3A(a0)
- cmpi.b #48,objoff_3A(a0)
- bne.w BossGreyBall_SpikeBall_Explosion_Draw
- sfx sfx_SpikeBall2,0,0,0
- move.w #$100,priority(a0)
- BossGreyBall_SpikeBall_Explosion_Velocity:
- move.w #$180,x_vel(a0)
- tst.b objoff_41(a0)
- bpl.s +
- neg.w x_vel(a0)
- + move.w #$F,$2E(a0)
- move.l #BossGreyBall_SpikeBall_Explosion_Wait,address(a0)
- BossGreyBall_SpikeBall_Explosion_Wait:
- move.b objoff_41(a0),d0
- add.b d0,objoff_3C(a0)
- jsr (MoveSprite_Circular).l
- subq.w #1,$2E(a0)
- bpl.s BossGreyBall_SpikeBall_Explosion_Draw
- sfx sfx_Fire2,0,0,0
- move.l #BossGreyBall_SpikeBall_Explosion_Fall,address(a0)
- BossGreyBall_SpikeBall_Explosion_Fall:
- btst #0,(Level_frame_counter+1).w
- bne.s +
- eori.b #$60,art_tile(a0)
- + btst #1,(Level_frame_counter+1).w
- beq.s +
- lea ChildObjDat_BossGreyBall_SpikeBall_Fire(pc),a2
- jsr (CreateChild6_Simple).l
- + jsr (MoveSprite).l
- tst.w y_vel(a0)
- bmi.s BossGreyBall_SpikeBall_Explosion_Draw
- jsr (ObjCheckFloorDist).l
- tst.w d1
- bpl.s BossGreyBall_SpikeBall_Explosion_Draw
- add.w d1,y_pos(a0)
- move.l #BossGreyBall_SpikeBall_CheckBounced,address(a0)
- BossGreyBall_SpikeBall_CheckBounced:
- jsr (MoveSprite).l
- move.w y_vel(a0),d0
- bmi.s BossGreyBall_SpikeBall_Explosion_Draw
- cmpi.w #$180,d0
- blo.s BossGreyBall_SpikeBall_Remove
- asr.w d0
- neg.w d0
- move.w d0,y_vel(a0)
- sfx sfx_SpikeBall,0,0,0
- lea ChildObjDat_BossGreyBall_Spark(pc),a2
- jsr (CreateChild6_Simple).l
- move.l #BossGreyBall_SpikeBall_Explosion_Fall,address(a0)
- BossGreyBall_SpikeBall_Explosion_Draw:
- jmp (Child_DrawTouch_Sprite).l
- ; ---------------------------------------------------------------------------
- BossGreyBall_SpikeBall_Remove:
- ori.b #$60,art_tile(a0)
- BossGreyBall_SpikeBall_Remove2:
- sfx sfx_BreakBridge,0,0,0
- move.w #$14,(Screen_Shaking_Flag).w
- move.l #Go_Delete_Sprite,address(a0)
- lea ChildObjDat_DEZRadiusExplosion(pc),a2
- jsr (CreateChild6_Simple).l
- lea ChildObjDat_BossGreyBall_Splinter(pc),a2
- jmp (CreateChild6_Simple).l
- ; ---------------------------------------------------------------------------
- ; Куски шипастого шара
- ; ---------------------------------------------------------------------------
- ; =============== S U B R O U T I N E =======================================
- Obj_BossGreyBall_Splinter:
- lea ObjDat3_BossRobot_Flicker(pc),a1
- jsr (SetUp_ObjAttributes3).l
- move.l #BossGreyBall_Splinter_Main,address(a0)
- moveq #0,d0
- move.b subtype(a0),d0
- move.b d0,d1
- lsr.b #1,d0
- addq.b #6,d0
- move.b d0,mapping_frame(a0)
- addq.b #1,d1
- lsl.b #5,d1
- move.b d1,d0
- jsr (GetSineCosine).l
- move.w #$C00,d2
- muls.w d2,d0
- asr.l #8,d0
- move.w d0,x_vel(a0)
- muls.w d2,d1
- asr.l #8,d1
- move.w d1,y_vel(a0)
- BossGreyBall_Splinter_Main:
- jsr (MoveSprite2).l
- btst #0,(Level_frame_counter+1).w
- bne.s BossGreyBall_Splinter_CheckParent
- jmp (Sprite_CheckDeleteXY).l
- ; ---------------------------------------------------------------------------
- BossGreyBall_Splinter_CheckParent:
- jmp (Child_CheckParent).l
- ; ---------------------------------------------------------------------------
- ; Искры
- ; ---------------------------------------------------------------------------
- ; =============== S U B R O U T I N E =======================================
- Obj_BossGreyBall_Spark:
- lea ObjDat3_BossGreyBall_Spark(pc),a1
- jsr (SetUp_ObjAttributes3).l
- moveq #0,d0
- move.b subtype(a0),d0
- move.w d0,d1
- addq.w #7,d0
- move.w d0,$2E(a0)
- movea.w parent3(a0),a1
- move.w x_vel(a1),d0
- asl.w #2,d0
- asl.w #6,d1
- add.w d1,d0
- neg.w d0
- move.w d0,x_vel(a0)
- jsr (Random_Number).l
- andi.w #$3FF,d0
- addi.w #$100,d0
- neg.w d0
- move.w d0,y_vel(a0)
- move.l #Go_Delete_Sprite,$34(a0)
- move.l #BossGreyBall_Spark_Draw,address(a0)
- BossGreyBall_Spark_Draw:
- jsr (MoveSprite2).l
- jsr (Obj_Wait).l
- jmp (Sprite_CheckDeleteXY).l
- ; ---------------------------------------------------------------------------
- ; Атакующий шипастый шар
- ; ---------------------------------------------------------------------------
- ; =============== S U B R O U T I N E =======================================
- Obj_BossGreyBall_SpikeBall:
- lea ObjDat3_BossGreyBall_SpikeBall(pc),a1
- jsr (SetUp_ObjAttributes3).l
- move.b #3,$39(a0)
- jsr (Find_SonicTails).l
- move.b #64,objoff_3C(a0)
- tst.w d0
- bne.s +
- neg.b objoff_3C(a0)
- + move.b #44/2,y_radius(a0)
- move.l #BossGreyBall_SpikeBall_Radius,address(a0)
- BossGreyBall_SpikeBall_Radius:
- jsr (MoveSprite_Circular).l
- addq.b #2,objoff_3A(a0)
- cmpi.b #48,objoff_3A(a0)
- bne.w BossGreyBall_SpikeBall_Draw
- move.w #$100,priority(a0)
- move.w #$9F,$2E(a0)
- BossGreyBall_SpikeBall_AimingStart:
- sfx sfx_LaserStart,0,0,0
- move.l #BossGreyBall_SpikeBall_Aiming,address(a0)
- BossGreyBall_SpikeBall_Aiming:
- btst #0,(Level_frame_counter+1).w
- bne.s +
- eori.b #$60,art_tile(a0)
- + lea (Player_1).w,a2
- movea.w parent3(a0),a1
- jsr (CalcObjAngle).l
- move.b d0,$3C(a0)
- jsr (MoveSprite_Circular).l
- subq.w #1,$2E(a0)
- bpl.w BossGreyBall_SpikeBall_Draw
- sfx sfx_SpikeAttack,0,0,0
- ori.b #$60,art_tile(a0)
- move.l #BossGreyBall_SpikeBall_AttackSonic,address(a0)
- lea (Player_1).w,a1
- move.w x_pos(a1),$30(a0)
- move.w y_pos(a1),$32(a0)
- movea.w parent3(a0),a2
- jsr (CalcObjAngle).l
- move.b d0,$3C(a0)
- lea ChildObjDat_BossGreyBall_SpikeBall_Chain(pc),a2
- jsr (CreateChild8_TreeListRepeated).l
- BossGreyBall_SpikeBall_AttackSonic:
- bsr.s BossGreyBall_SpikeBall_CheckFloor
- bsr.s BossGreyBall_SpikeBall_CalcPosition
- move.w $30(a0),d0
- sub.w x_pos(a0),d0
- bne.s +
- move.l #BossGreyBall_SpikeBall_AttackReturn,address(a0)
- + asl.w #5,d0
- move.w d0,x_vel(a0)
- move.w $32(a0),d0
- sub.w y_pos(a0),d0
- asl.w #5,d0
- move.w d0,y_vel(a0)
- bra.w BossGreyBall_SpikeBall_Draw
- ; ---------------------------------------------------------------------------
- BossGreyBall_SpikeBall_CheckFloor:
- btst #2,(Level_frame_counter+1).w
- bne.s BossGreyBall_SpikeBall_CalcPosition_Return
- jsr (ObjCheckFloorDist).l
- tst.w d1
- bpl.s BossGreyBall_SpikeBall_CalcPosition_Return
- sfx sfx_SpikeBall,0,0,0
- move.w #$14,(Screen_Shaking_Flag).w
- lea ChildObjDat_BossGreyBall_Spark(pc),a2
- jmp (CreateChild6_Simple).l
- ; ---------------------------------------------------------------------------
- BossGreyBall_SpikeBall_CalcPosition:
- movea.w parent3(a0),a1
- jsr (Find_OtherObject).l
- add.w d3,d2 ; X+Ypos
- lsr.w #3,d2
- move.b d2,objoff_3A(a0)
- lsr.w #3,d2
- tst.w d0
- beq.s +
- neg.w d2
- + move.b d2,child_dx(a0)
- BossGreyBall_SpikeBall_CalcPosition_Return:
- rts
- ; ---------------------------------------------------------------------------
- BossGreyBall_SpikeBall_AttackReturn:
- bsr.s BossGreyBall_SpikeBall_CalcPosition
- move.w x_pos(a1),d0
- sub.w x_pos(a0),d0
- asl.w #5,d0
- move.w d0,x_vel(a0)
- move.w y_pos(a1),d0
- sub.w y_pos(a0),d0
- asl.w #5,d0
- move.w d0,y_vel(a0)
- jsr (Find_OtherObject).l
- move.w #48,d1
- cmp.w d1,d2
- bhs.s BossGreyBall_SpikeBall_Draw
- cmp.w d1,d3
- bhs.s BossGreyBall_SpikeBall_Draw
- clr.l x_vel(a0)
- move.b #48,objoff_3A(a0)
- move.w #$7F,$2E(a0)
- movea.w $44(a0),a1
- move.l #Go_Delete_Sprite,address(a1)
- move.l #BossGreyBall_SpikeBall_AimingStart,address(a0)
- subq.b #1,$39(a0)
- bne.s BossGreyBall_SpikeBall_Draw
- movea.w parent3(a0),a1
- move.l #BossGreyBall_MoveSpikeBall_Hand_ReturnPosition,$34(a1)
- jsr (Find_SonicTails).l
- move.b #1,objoff_41(a0)
- move.b #64,objoff_3C(a0)
- tst.w d0
- bne.s +
- neg.b objoff_3C(a0)
- neg.b objoff_41(a0)
- + move.l #BossGreyBall_SpikeBall_Explosion_Velocity,address(a0)
- BossGreyBall_SpikeBall_Draw:
- jsr (MoveSprite2).l
- movea.w parent3(a0),a1
- btst #5,status(a1)
- bne.w BossGreyBall_SpikeBall_Remove2
- jmp (Child_DrawTouch_Sprite).l
- ; ---------------------------------------------------------------------------
- ; Атакующий шипастый шар (цепь)
- ; ---------------------------------------------------------------------------
- ; =============== S U B R O U T I N E =======================================
- Obj_BossGreyBall_SpikeBall_Chain:
- lea ObjDat3_BossGreyBall_SpikeBall_Chain(pc),a1
- jsr (SetUp_ObjAttributes3).l
- movea.w parent3(a0),a1
- move.l #BossGreyBall_SpikeBall_Chain_Main,address(a0)
- cmpi.l #BossGreyBall_SpikeBall_AttackSonic,address(a1)
- bne.s BossGreyBall_SpikeBall_Chain_Main
- move.w a0,$44(a1)
- BossGreyBall_SpikeBall_Chain_Main:
- movea.w parent3(a0),a1
- move.b child_dx(a1),child_dx(a0)
- move.b objoff_3A(a1),objoff_3A(a0)
- move.b objoff_3C(a1),objoff_3C(a0)
- jsr (MoveSprite_Circular).l
- btst #0,(Level_frame_counter+1).w
- bne.w BossGreyBall_SpikeBall_Bounced_Chain_Trail_CheckParent
- jmp (Child_Draw_Sprite).l
- ; ---------------------------------------------------------------------------
- ; Отскакивающий шипастый шар
- ; ---------------------------------------------------------------------------
- ; =============== S U B R O U T I N E =======================================
- Obj_BossGreyBall_SpikeBall_Bounced:
- lea ObjDat3_BossGreyBall_SpikeBall(pc),a1
- jsr (SetUp_ObjAttributes3).l
- jsr (Find_SonicTails).l
- move.b #1,objoff_41(a0)
- move.b #64,objoff_3C(a0)
- tst.w d0
- bne.s +
- neg.b objoff_3C(a0)
- neg.b objoff_41(a0)
- + move.b #44/2,y_radius(a0)
- move.l #BossGreyBall_SpikeBall_Bounced_Radius,address(a0)
- BossGreyBall_SpikeBall_Bounced_Radius:
- jsr (MoveSprite_Circular).l
- addq.b #1,objoff_3A(a0)
- cmpi.b #48,objoff_3A(a0)
- bne.s BossGreyBall_SpikeBall_Bounced_Setup
- sfx sfx_SpikeBall2,0,0,0
- move.w #$100,priority(a0)
- jsr (Find_SonicTails).l
- move.w #$200,x_vel(a0)
- tst.w d0
- bne.s +
- neg.w x_vel(a0)
- + move.w #$F,$2E(a0)
- move.l #BossGreyBall_SpikeBall_Bounced_Wait,address(a0)
- BossGreyBall_SpikeBall_Bounced_Wait:
- move.b objoff_41(a0),d0
- add.b d0,objoff_3C(a0)
- jsr (MoveSprite_Circular).l
- subq.w #1,$2E(a0)
- bpl.s BossGreyBall_SpikeBall_Bounced_Setup
- move.l #BossGreyBall_SpikeBall_Bounced_Jump,$34(a0)
- move.l #BossGreyBall_SpikeBall_Bounced_Setup2,address(a0)
- clearRAM3 Pos_objtable_Start, Pos_objtable_End
- lea ChildObjDat_BossGreyBall_SpikeBall_Bounced_Chain_Trail(pc),a2
- jsr (CreateChild6_Simple).l
- BossGreyBall_SpikeBall_Bounced_Setup2:
- jsr (MoveSprite).l
- jsr (ObjHitFloor_DoRoutine).l
- BossGreyBall_SpikeBall_Bounced_Setup:
- bsr.w Obj_ChasingBall_SendPos
- jmp (Sprite_ChildCheckDeleteTouchXY).l
- ; ---------------------------------------------------------------------------
- BossGreyBall_SpikeBall_Bounced_Jump:
- move.w #-$400,y_vel(a0)
- sfx sfx_SpikeBall,0,0,0
- move.w #$14,(Screen_Shaking_Flag).w
- lea ChildObjDat_BossGreyBall_Spark(pc),a2
- jmp (CreateChild6_Simple).l
- ; ---------------------------------------------------------------------------
- ; Тень отскакивающего шипастого шара
- ; ---------------------------------------------------------------------------
- ; =============== S U B R O U T I N E =======================================
- Obj_BossGreyBall_SpikeBall_Bounced_Chain_Trail:
- moveq #0,d0
- move.b subtype(a0),d0
- lsl.b #4,d0
- addi.b #$24,d0
- move.b d0,subtype(a0)
- lea ObjDat3_BossGreyBall_SpikeBall_Chain(pc),a1
- jsr (SetUp_ObjAttributes3).l
- move.l #+,address(a0)
- + bsr.w Obj_ChasingBall_CopyPos
- btst #0,(Level_frame_counter+1).w
- bne.s BossGreyBall_SpikeBall_Bounced_Chain_Trail_CheckParent
- jmp (Child_Draw_Sprite).l
- ; ---------------------------------------------------------------------------
- BossGreyBall_SpikeBall_Bounced_Chain_Trail_CheckParent:
- jmp (Child_CheckParent).l
- ; ---------------------------------------------------------------------------
- ; Выстреливающий шипастый шар
- ; ---------------------------------------------------------------------------
- ; =============== S U B R O U T I N E =======================================
- Obj_BossGreyBall_SpikeBall_Shot:
- lea ObjDat3_BossGreyBall_SpikeBall(pc),a1
- jsr (SetUp_ObjAttributes3).l
- jsr (Find_SonicTails).l
- move.b #1,objoff_41(a0)
- move.b #64,objoff_3C(a0)
- tst.w d0
- bne.s +
- neg.b objoff_3C(a0)
- neg.b objoff_41(a0)
- + move.b #44/2,y_radius(a0)
- move.l #BossGreyBall_SpikeBall_Shot_Radius,address(a0)
- BossGreyBall_SpikeBall_Shot_Radius:
- bsr.w BossGreyBall_CreateFire_2
- lea (Player_1).w,a2
- movea.w parent3(a0),a1
- jsr (CalcObjAngle).l
- move.b d0,$3C(a0)
- jsr (MoveSprite_Circular).l
- addq.b #1,objoff_3A(a0)
- cmpi.b #48,objoff_3A(a0)
- bne.w BossGreyBall_SpikeBall_Shot_Draw
- sfx sfx_SpikeBall2,0,0,0
- move.w #$100,priority(a0)
- move.l #BossGreyBall_SpikeBall_Shot_SubtractRadius,address(a0)
- BossGreyBall_SpikeBall_Shot_SubtractRadius:
- bsr.w BossGreyBall_CreateFire_2
- lea (Player_1).w,a2
- movea.w parent3(a0),a1
- jsr (CalcObjAngle).l
- move.b d0,$3C(a0)
- jsr (MoveSprite_Circular).l
- btst #1,(Level_frame_counter+1).w
- bne.w BossGreyBall_SpikeBall_Shot_Draw
- subq.b #1,objoff_3A(a0)
- cmpi.b #36,objoff_3A(a0)
- bne.w BossGreyBall_SpikeBall_Shot_Draw
- move.w #$2F,$2E(a0)
- move.l #BossGreyBall_SpikeBall_Shot_Warning,address(a0)
- BossGreyBall_SpikeBall_Shot_Warning:
- bsr.w BossGreyBall_CreateFire_2
- lea (Player_1).w,a2
- movea.w parent3(a0),a1
- jsr (CalcObjAngle).l
- move.b d0,$3C(a0)
- jsr (MoveSprite_Circular).l
- subq.w #1,$2E(a0)
- bpl.w BossGreyBall_SpikeBall_Shot_Draw
- sfx sfx_LaserStart,0,0,0
- move.w #$9F,$2E(a0)
- move.l #BossGreyBall_SpikeBall_Shot_Wait,address(a0)
- BossGreyBall_SpikeBall_Shot_Wait:
- btst #0,(Level_frame_counter+1).w
- bne.s +
- eori.b #$60,art_tile(a0)
- + bsr.w BossGreyBall_CreateFire_2
- lea (Player_1).w,a2
- movea.w parent3(a0),a1
- jsr (CalcObjAngle).l
- move.b d0,$3C(a0)
- jsr (MoveSprite_Circular).l
- subq.w #1,$2E(a0)
- bpl.w BossGreyBall_SpikeBall_Shot_Draw
- move.l #BossGreyBall_SpikeBall_Shot_CheckFloor,address(a0)
- clearRAM3 Pos_objtable_Start, Pos_objtable_End
- sfx sfx_Boom,0,0,0
- ori.b #$60,art_tile(a0)
- lea ChildObjDat_BossGreyBall_SpikeBall_Shot_Chain_Trail(pc),a2
- jsr (CreateChild6_Simple).l
- lea (Player_1).w,a1
- move.w x_pos(a1),d1
- move.w y_pos(a1),d2
- sub.w x_pos(a0),d1
- sub.w y_pos(a0),d2
- jsr (GetArcTan).l
- jsr (GetSineCosine).l
- move.w #$680,d2
- muls.w d2,d1
- asr.l #8,d1
- move.w d1,x_vel(a0)
- muls.w d2,d0
- asr.l #8,d0
- move.w d0,y_vel(a0)
- BossGreyBall_SpikeBall_Shot_CheckFloor:
- bsr.w BossGreyBall_CreateFire_2
- tst.w y_vel(a0)
- bmi.s BossGreyBall_SpikeBall_Shot_Draw
- btst #2,(Level_frame_counter+1).w
- bne.s BossGreyBall_SpikeBall_Shot_Draw
- jsr (ObjCheckFloorDist).l
- tst.w d1
- bpl.s BossGreyBall_SpikeBall_Shot_Draw
- add.w d1,y_pos(a0)
- neg.w y_vel(a0)
- sfx sfx_SpikeBall,0,0,0
- move.w #$14,(Screen_Shaking_Flag).w
- lea ChildObjDat_BossGreyBall_Spark(pc),a2
- jsr (CreateChild6_Simple).l
- BossGreyBall_SpikeBall_Shot_Draw:
- jsr (MoveSprite2).l
- bsr.w Obj_ChasingBall_SendPos
- jmp (Sprite_ChildCheckDeleteTouchXY).l
- ; ---------------------------------------------------------------------------
- ; Цепь выстреливающего шипастого шара
- ; ---------------------------------------------------------------------------
- ; =============== S U B R O U T I N E =======================================
- Obj_BossGreyBall_SpikeBall_Shot_Chain_Trail:
- moveq #0,d0
- move.b subtype(a0),d0
- lsl.b #2,d0
- addi.b #$14,d0
- move.b d0,subtype(a0)
- lea ObjDat3_BossGreyBall_SpikeBall_Chain(pc),a1
- jsr (SetUp_ObjAttributes3).l
- move.l #+,address(a0)
- + bsr.w Obj_ChasingBall_CopyPos
- movea.w parent3(a0),a1
- movea.w parent3(a1),a1
- tst.w y_vel(a1)
- bne.w BossGreyBall_SpikeBall_Bounced_Chain_Trail_CheckParent
- jmp (Child_Draw_Sprite).l
- ; ---------------------------------------------------------------------------
- ; Дым из босса шара
- ; ---------------------------------------------------------------------------
- ; =============== S U B R O U T I N E =======================================
- Obj_BossGreyBall_Fire:
- move.w #1-1,d6
- - jsr (Create_New_Sprite3).l
- bne.w ++
- move.l #Obj_BossGreyBall_SpikeBall_Fire_Anim,address(a1)
- move.l #Map_BossDEZExplosion,mappings(a1)
- move.w #$530,art_tile(a1)
- move.b #4,render_flags(a1)
- move.w $3C(a0),priority(a1)
- move.b #24/2,width_pixels(a1)
- move.b #24/2,height_pixels(a1)
- move.w x_pos(a0),x_pos(a1)
- move.w y_pos(a0),y_pos(a1)
- jsr (loc_83E90).l
- jsr (Random_Number).l
- andi.w #$FF,d0
- addi.w #$200,d0
- movea.w parent3(a0),a2
- tst.w x_vel(a2)
- bmi.s +
- neg.w d0
- + move.w d0,x_vel(a1)
- jsr (Random_Number).l
- andi.w #$FF,d0
- addi.w #$200,d0
- neg.w d0
- move.w d0,y_vel(a1)
- move.b #3,anim_frame_timer(a1)
- dbf d6,-
- + bra.w Robotnik_IntroFullExplosion_Delete
- ; ---------------------------------------------------------------------------
- ; Дым из шипастого шара
- ; ---------------------------------------------------------------------------
- ; =============== S U B R O U T I N E =======================================
- Obj_BossGreyBall_SpikeBall_Fire:
- move.w #1-1,d6
- - jsr (Create_New_Sprite3).l
- bne.s ++
- move.l #Obj_BossGreyBall_SpikeBall_Fire_Anim,address(a1)
- move.l #Map_BossDEZExplosion,mappings(a1)
- move.w #$8530,art_tile(a1)
- move.b #4,render_flags(a1)
- move.w #$100,priority(a1)
- move.b #24/2,width_pixels(a1)
- move.b #24/2,height_pixels(a1)
- move.w x_pos(a0),x_pos(a1)
- move.w y_pos(a0),y_pos(a1)
- jsr (Random_Number).l
- andi.w #$FF,d0
- addi.w #$200,d0
- movea.w parent3(a0),a2
- tst.b objoff_41(a2)
- bmi.s +
- neg.w d0
- + move.w d0,x_vel(a1)
- jsr (Random_Number).l
- andi.w #$FF,d0
- addi.w #$200,d0
- neg.w d0
- move.w d0,y_vel(a1)
- move.b #3,anim_frame_timer(a1)
- dbf d6,-
- + bra.w Robotnik_IntroFullExplosion_Delete
- ; ---------------------------------------------------------------------------
- Obj_BossGreyBall_SpikeBall_Fire_Anim:
- subq.b #1,anim_frame_timer(a0)
- bpl.s +
- move.b #3,anim_frame_timer(a0)
- addq.b #1,mapping_frame(a0)
- cmpi.b #7,mapping_frame(a0)
- beq.w Robotnik_IntroFullExplosion_Delete
- + jsr (MoveSprite2).l
- jmp (Draw_Sprite).l
- ; ---------------------------------------------------------------------------
- ; Взрыв по радиусу
- ; ---------------------------------------------------------------------------
- ; =============== S U B R O U T I N E =======================================
- Obj_DEZRadiusExplosion:
- moveq #0,d2
- move.w #8-1,d1
- - jsr (Create_New_Sprite3).l
- bne.s +
- move.l #Obj_DEZRadiusExplosion_GetVelocity,(a1)
- move.l #Map_BossDEZExplosion,mappings(a1)
- move.w #$8530,art_tile(a1)
- move.b #4,render_flags(a1)
- move.w #$100,priority(a1)
- move.b #24/2,width_pixels(a1)
- move.b #24/2,height_pixels(a1)
- move.w x_pos(a0),x_pos(a1)
- move.w y_pos(a0),y_pos(a1)
- move.b d2,angle(a1)
- move.b #3,anim_frame_timer(a1)
- addi.w #$20,d2
- dbf d1,-
- + bra.w Robotnik_IntroFullExplosion_Delete
- ; ---------------------------------------------------------------------------
- Obj_DEZRadiusExplosion_GetVelocity:
- move.b angle(a0),d0
- jsr (GetSineCosine).l
- move.w #$600,d2
- muls.w d2,d1
- asr.l #8,d1
- move.w d1,x_vel(a0)
- muls.w d2,d0
- asr.l #8,d0
- move.w d0,y_vel(a0)
- move.l #Obj_DEZRadiusExplosion_Anim,address(a0)
- Obj_DEZRadiusExplosion_Anim:
- subq.b #1,anim_frame_timer(a0)
- bpl.s +
- move.b #1,anim_frame_timer(a0)
- addq.b #1,mapping_frame(a0)
- cmpi.b #7,mapping_frame(a0)
- beq.w Robotnik_IntroFullExplosion_Delete
- + jsr (MoveSprite2).l
- jmp (Draw_Sprite).l
- ; ---------------------------------------------------------------------------
- ; Супер взрыв по радиусу
- ; ---------------------------------------------------------------------------
- ; =============== S U B R O U T I N E =======================================
- Obj_DEZRadiusSuperExplosion:
- moveq #0,d2
- move.w #3-1,d1
- - jsr (Create_New_Sprite3).l
- bne.s +
- move.l #Obj_DEZRadiusSuperExplosion_GetVelocity,address(a1)
- move.l #Map_BossDEZExplosion,mappings(a1)
- move.w #$8530,art_tile(a1)
- move.b #4,render_flags(a1)
- move.w #$100,priority(a1)
- move.b #24/2,width_pixels(a1)
- move.b #24/2,height_pixels(a1)
- move.w x_pos(a0),x_pos(a1)
- move.w y_pos(a0),y_pos(a1)
- move.b $3C(a0),$3C(a1)
- move.b d2,angle(a1)
- move.w parent3(a0),parent3(a1)
- move.b #$F,anim_frame_timer(a1)
- addi.w #$50,d2
- dbf d1,-
- + bra.w Robotnik_IntroFullExplosion_Delete
- ; ---------------------------------------------------------------------------
- Obj_DEZRadiusSuperExplosion_GetVelocity:
- movea.w parent3(a0),a1
- move.b $3C(a1),d0
- add.b angle(a0),d0
- jsr (GetSineCosine).l
- move.w #$600,d2
- muls.w d2,d1
- asr.l #8,d1
- move.w d1,x_vel(a0)
- muls.w d2,d0
- asr.l #8,d0
- move.w d0,y_vel(a0)
- move.l #Obj_DEZRadiusSuperExplosion_Anim,address(a0)
- Obj_DEZRadiusSuperExplosion_Anim:
- subq.b #1,anim_frame_timer(a0)
- bpl.s +
- move.b #3,anim_frame_timer(a0)
- addq.b #1,mapping_frame(a0)
- cmpi.b #7,mapping_frame(a0)
- beq.w Robotnik_IntroFullExplosion_Delete
- + jsr (MoveSprite2).l
- jmp (Draw_Sprite).l
- ; =============== S U B R O U T I N E =======================================
- BossGreyBall_Swing_Setup:
- move.w #$100,d0
- move.w d0,$3E(a0)
- move.w d0,y_vel(a0)
- move.w #8,$40(a0)
- bclr #0,$38(a0)
- rts
- ; ---------------------------------------------------------------------------
- BossGreyBall_Swing_Setup2:
- move.w #$100,d0
- move.w d0,$3A(a0)
- move.w d0,x_vel(a0)
- move.w #8,$3C(a0)
- bclr #3,$38(a0)
- move.w (Camera_X_pos).w,d0
- addi.w #$A0,d0
- sub.w x_pos(a0),d0
- bgt.s +
- neg.w x_vel(a0)
- + rts
- ; =============== S U B R O U T I N E =======================================
- BossGreyBall_PalFlash:
- lea BossGreyBall_PalCycle(pc),a2
- btst #5,status(a0)
- beq.s +
- lea BossGreyBall_PalCycle2(pc),a2
- + lea (a2,d0.w),a2
- lea BossGreyBall_PalRAM(pc),a1
- jmp (CopyWordData_7).l
- ; ---------------------------------------------------------------------------
- BossGreyBall_PalRAM:
- dc.w Normal_palette_line_4+4
- dc.w Normal_palette_line_4+6
- dc.w Normal_palette_line_4+8
- dc.w Normal_palette_line_4+$A
- dc.w Normal_palette_line_4+$C
- dc.w Normal_palette_line_4+$E
- dc.w Normal_palette_line_4+$1E
- BossGreyBall_PalCycle:
- dc.w $424, $644, $866, $A88, $CAA, $ECC, $222 ; Normal
- dc.w $42, $64, $86, $A8, $CA, $EC, $22 ; Flash
- BossGreyBall_PalCycle2:
- dc.w $2E, $4E, $6E, $8E, $AE, $CE, $2E ; Normal
- dc.w $42, $64, $86, $A8, $CA, $EC, $22 ; Flash
- ; =============== S U B R O U T I N E =======================================
- ObjDat3_BossGreyBall:
- dc.l Map_BossGreyBall
- dc.w $E170
- dc.w $200
- dc.b 64/2
- dc.b 64/2
- dc.b 0
- dc.b $F
- ObjDat3_BossGreyBall_SpikeBall:
- dc.w $280
- dc.b 48/2
- dc.b 48/2
- dc.b 5
- dc.b $81
- ObjDat3_BossGreyBall_SpikeBall_Chain:
- dc.w $300
- dc.b 16/2
- dc.b 16/2
- dc.b 4
- dc.b 0
- ObjDat3_BossGreyBall_Face:
- dc.w $180
- dc.b 48/2
- dc.b 16/2
- dc.b 2
- dc.b 0
- ObjDat3_BossGreyBall_Designator:
- dc.w $100
- dc.b 32/2
- dc.b 32/2
- dc.b $B
- dc.b 0
- ObjDat3_BossGreyBall_Spark:
- dc.w $80
- dc.b 16/2
- dc.b 16/2
- dc.b $A
- dc.b 0
- ChildObjDat_BossGreyBall_IntroClone:
- dc.w 2-1
- dc.l Obj_BossGreyBall_IntroClone
- ChildObjDat_BossGreyBall_Face:
- dc.w 1-1
- dc.l Obj_BossGreyBall_Face
- ChildObjDat_BossGreyBall_Designator:
- dc.w 2-1
- dc.l Obj_BossGreyBall_Designator
- dc.b -32, -50
- dc.l Obj_BossGreyBall_Designator
- dc.b 32, -50
- ChildObjDat_BossGreyBall_SpikeBall_Explosion:
- dc.w 1-1
- dc.l Obj_BossGreyBall_SpikeBall_Explosion
- ChildObjDat_BossGreyBall_SpikeBall:
- dc.w 1-1
- dc.l Obj_BossGreyBall_SpikeBall
- ChildObjDat_BossGreyBall_SpikeBall_Chain:
- dc.w 7-1
- dc.l Obj_BossGreyBall_SpikeBall_Chain
- ChildObjDat_BossGreyBall_Splinter:
- dc.w 4-1
- dc.l Obj_BossGreyBall_Splinter
- ChildObjDat_BossGreyBall_SpikeBall_Fire:
- dc.w 1-1
- dc.l Obj_BossGreyBall_SpikeBall_Fire
- ChildObjDat_BossGreyBall_SpikeBall_Bounced:
- dc.w 1-1
- dc.l Obj_BossGreyBall_SpikeBall_Bounced
- ChildObjDat_BossGreyBall_SpikeBall_Bounced_Chain_Trail:
- dc.w 6-1
- dc.l Obj_BossGreyBall_SpikeBall_Bounced_Chain_Trail
- ChildObjDat_BossGreyBall_SpikeBall_Shot:
- dc.w 1-1
- dc.l Obj_BossGreyBall_SpikeBall_Shot
- ChildObjDat_BossGreyBall_SpikeBall_Shot_Chain_Trail:
- dc.w 8-1
- dc.l Obj_BossGreyBall_SpikeBall_Shot_Chain_Trail
- ChildObjDat_BossGreyBall_Spark:
- dc.w 4-1
- dc.l Obj_BossGreyBall_Spark
- ChildObjDat_DEZRadiusExplosion:
- dc.w 1-1
- dc.l Obj_DEZRadiusExplosion
- ChildObjDat_BossGreyBall_Fire:
- dc.w 1-1
- dc.l Obj_BossGreyBall_Fire
- ChildObjDat_DEZRadiusSuperExplosion:
- dc.w 1-1
- dc.l Obj_DEZRadiusSuperExplosion
- ; ---------------------------------------------------------------------------
- include "Objects/Boss Ball/Object Data/Map - Boss Ball.asm"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement