Advertisement
TheBlad768

Boss Gray Ball

Nov 17th, 2018
452
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ; ---------------------------------------------------------------------------
  2. ; Босс-шар
  3. ; ---------------------------------------------------------------------------
  4.  
  5. ; Hits
  6. BossGreyBall_Hits       = 6
  7.  
  8. ; Attributes
  9. _Setup4             = 8
  10. _Setup5             = $A
  11. _Setup6             = $C
  12. _Setup7             = $E
  13. _Setup8             = $10
  14. _Setup9             = $12
  15.  
  16. ; Dynamic object variables
  17. obBGB_XPos          = $30   ; .w
  18. obBGB_Routine       = $32   ; .b
  19. obBGB_Draw          = $33   ; .b
  20.  
  21. ; =============== S U B R O U T I N E =======================================
  22.  
  23. Obj_BossGreyBall:
  24.         moveq   #0,d0
  25.         move.b  routine(a0),d0
  26.         move.w  BossGreyBall_Index(pc,d0.w),d0
  27.         jsr BossGreyBall_Index(pc,d0.w)
  28.         bsr.w   BossGreyBall_CheckTouch
  29.         moveq   #0,d0
  30.         btst    #0,(V_int_run_count+3).w
  31.         beq.s   +
  32.         addq.b  #1,d0
  33. +       move.b  d0,mapping_frame(a0)
  34.         tst.b   obBGB_Draw(a0)
  35.         bne.w   BossGreyBall_CheckCameraPosition_Return
  36.         jmp (Draw_And_Touch_Sprite).l
  37. ; ---------------------------------------------------------------------------
  38.  
  39. BossGreyBall_Index: offsetTable
  40.         offsetTableEntry.w BossGreyBall_Init        ; 0
  41.         offsetTableEntry.w BossGreyBall_Setup   ; 2
  42.         offsetTableEntry.w BossGreyBall_Setup2  ; 4
  43.         offsetTableEntry.w BossGreyBall_Setup3  ; 6
  44.         offsetTableEntry.w BossGreyBall_Setup4  ; 8
  45.         offsetTableEntry.w BossGreyBall_Setup5  ; A
  46.         offsetTableEntry.w BossGreyBall_Setup6  ; C
  47.         offsetTableEntry.w BossGreyBall_Setup7  ; E
  48.         offsetTableEntry.w BossGreyBall_Setup8  ; 10
  49.         offsetTableEntry.w BossGreyBall_Setup9  ; 12
  50. ; ---------------------------------------------------------------------------
  51.  
  52. BossGreyBall_Init:
  53.         lea ObjDat3_BossGreyBall(pc),a1
  54.         jsr (SetUp_ObjAttributes).l
  55.         st  (Boss_flag).w
  56.         move.b  #62/2,y_radius(a0)
  57.         move.b  #BossGreyBall_Hits,collision_property(a0)
  58.         move.l  #BossGreyBall_Intro,$34(a0)
  59.         lea ChildObjDat_BossGreyBall_Face(pc),a2
  60.         jmp (CreateChild6_Simple).l
  61. ; ---------------------------------------------------------------------------
  62.  
  63. BossGreyBall_Setup2:
  64.         bsr.s   BossGreyBall_CheckCameraPosition
  65.         jsr (Find_SonicTails).l
  66.         addi.w  #$20,d2
  67.         cmpi.w  #$80,d2
  68.         blo.s       BossGreyBall_Setup3
  69.         move.w  #$100,d1
  70.         tst.w   d0
  71.         bne.s   +
  72.         neg.w   d1
  73. +       move.w  d1,x_vel(a0)
  74.  
  75. BossGreyBall_Setup3:
  76.         jsr (Swing_UpAndDown).l
  77.  
  78. BossGreyBall_Setup:
  79.         jsr (MoveSprite2).l
  80.  
  81. BossGreyBall_Setup_2:
  82.         jmp (Obj_Wait).l
  83. ; ---------------------------------------------------------------------------
  84.  
  85. BossGreyBall_Setup5:
  86.         jsr (Swing_LeftAndRight).l
  87.         bra.s   BossGreyBall_Setup
  88. ; ---------------------------------------------------------------------------
  89.  
  90. BossGreyBall_Setup4:
  91.         jsr (MoveSprite).l
  92.         jmp (ObjHitFloor_DoRoutine).l
  93. ; ---------------------------------------------------------------------------
  94.  
  95. BossGreyBall_Setup6:
  96.         bsr.s   BossGreyBall_CheckCameraPosition
  97.         bsr.s   BossGreyBall_CreateFire
  98.         bsr.s   BossGreyBall_CheckFireShield
  99.         jsr (MoveSprite).l
  100.         bra.s   BossGreyBall_Setup_2
  101. ; ---------------------------------------------------------------------------
  102.  
  103. BossGreyBall_Setup7:
  104.         bsr.s   BossGreyBall_CheckCameraPosition
  105.         bsr.s   BossGreyBall_CreateFire
  106.         bsr.s   BossGreyBall_CheckFireShield
  107.         bra.s   BossGreyBall_Setup
  108. ; ---------------------------------------------------------------------------
  109.  
  110. BossGreyBall_Setup8:
  111.         move.w  (Oscillating_Data+2).w,d0
  112.         asr.w   #1,d0
  113.         move.w  d0,x_vel(a0)
  114.         bra.s   BossGreyBall_Setup3
  115. ; ---------------------------------------------------------------------------
  116.  
  117. BossGreyBall_Setup9:
  118.         bsr.w   BossGreyBall_CreateFire
  119.         move.b  (Level_frame_counter+1).w,d0
  120.         andi.w  #7,d0
  121.         bne.s   +
  122.         sfx sfx_BreakBridge,0,0,0
  123. +       bra.s   BossGreyBall_Setup
  124.  
  125. ; =============== S U B R O U T I N E =======================================
  126.  
  127. BossGreyBall_CheckCameraPosition:
  128.         move.w  (Camera_X_pos).w,d0
  129.         addi.w  #$20,d0
  130.         cmp.w   x_pos(a0),d0
  131.         blt.s       +
  132.         neg.w   x_vel(a0)
  133. +       addi.w  #$100,d0
  134.         cmp.w   x_pos(a0),d0
  135.         bgt.s   BossGreyBall_CheckCameraPosition_Return
  136.         neg.w   x_vel(a0)
  137.  
  138. BossGreyBall_CheckCameraPosition_Return:
  139.         rts
  140.  
  141. ; =============== S U B R O U T I N E =======================================
  142.  
  143. BossGreyBall_CheckFireShield:
  144.         lea (Player_1).w,a1
  145.         cmpi.b  #id_SonicDeath,routine(a1)
  146.         bhs.s   BossGreyBall_CheckFireShield_Return
  147.         btst    #Status_FireShield,status_secondary(a1)
  148.         bne.s   BossGreyBall_CheckFireShield_Return
  149.         bsr.w   BossGreyBall_FinalPhase_Intro_CreateFireShield
  150.  
  151. BossGreyBall_CheckFireShield_Return:
  152.         rts
  153. ; =============== S U B R O U T I N E =======================================
  154.  
  155. BossGreyBall_CreateFire:
  156.         btst    #1,(Level_frame_counter+1).w
  157.         beq.s   +
  158.         lea ChildObjDat_BossGreyBall_Fire(pc),a2
  159.         jsr (CreateChild6_Simple).l
  160.         bne.s   +
  161.         move.b  #48/2,$3A(a1)
  162.         move.b  #48/2,$3B(a1)
  163.         move.w  #$100,$3C(a1)
  164. +       rts
  165.  
  166. ; =============== S U B R O U T I N E =======================================
  167.  
  168. BossGreyBall_CreateFire_2:
  169.         btst    #1,(Level_frame_counter+1).w
  170.         beq.s   +
  171.         lea ChildObjDat_BossGreyBall_Fire(pc),a2
  172.         jsr (CreateChild6_Simple).l
  173.         bne.s   +
  174.         move.b  #24/2,$3A(a1)
  175.         move.b  #24/2,$3B(a1)
  176.         move.w  #$80,$3C(a1)
  177. +       rts
  178. ; ---------------------------------------------------------------------------
  179. ; Интро
  180. ; ---------------------------------------------------------------------------
  181.  
  182. ; =============== S U B R O U T I N E =======================================
  183.  
  184. BossGreyBall_Intro:
  185.         sfx sfx_Flash,0,0,0
  186.         move.b  #4,(Hyper_Sonic_flash_timer).w
  187.         move.l  #BossGreyBall_CheckFireShield_Return,$34(a0)
  188.         lea ChildObjDat_BossGreyBall_IntroClone(pc),a2
  189.         jmp (CreateChild6_Simple).l
  190. ; ---------------------------------------------------------------------------
  191.  
  192. BossGreyBall_Intro_MoveSwing:
  193.         move.b  #_Setup8,routine(a0)
  194.         tst.b   (Intro_flag).w
  195.         bne.s   BossGreyBall_Intro_SkipIntro
  196.         st  (Intro_flag).w
  197.         move.l  #BossGreyBall_CheckFireShield_Return,$34(a0)
  198.         lea ChildObjDat_Dialog_Process(pc),a2
  199.         jsr (CreateChild6_Simple).l
  200.         bne.s   +
  201.         move.b  #_GreyBallStart,routine(a1)
  202.         move.l  #DialogGreyBallStart_Process_Index-4,$34(a1)
  203.         move.b  #(DialogGreyBallStart_Process_Index_End-DialogGreyBallStart_Process_Index)/8,$39(a1)
  204. +       bra.w   BossGreyBall_Swing_Setup
  205. ; ---------------------------------------------------------------------------
  206.  
  207. BossGreyBall_Intro_SkipIntro:
  208.         move.w  #$F,$2E(a0)
  209.         move.w  #-$100,y_vel(a0)
  210.         move.b  #_Setup1,routine(a0)
  211.         move.l  #BossGreyBall_Intro_CheckPosition,$34(a0)
  212.         lea ChildObjDat_RobotnikHud(pc),a2
  213.         jsr (CreateChild6_Simple).l
  214.         bne.s   +
  215.         move.w  a0,parent3(a1)
  216. +       sf  (Ctrl_1_locked).w
  217.         jmp (Restore_PlayerControl).l
  218. ; ---------------------------------------------------------------------------
  219.  
  220. BossGreyBall_Intro_CheckPosition:
  221.         move.w  (Camera_Y_pos).w,d0
  222.         addi.w  #$50,d0
  223.         cmp.w   y_pos(a0),d0
  224.         blo.s       BossGreyBall_Intro_CheckPosition_Return
  225.         move.l  #BossGreyBall_SetSubroutine,$34(a0)
  226.         clr.l   x_vel(a0)
  227.         lea ChildObjDat_BossGreyBall_Designator(pc),a2
  228.         jsr (CreateChild1_Normal).l
  229.  
  230. BossGreyBall_Intro_CheckPosition_Return:
  231.         rts
  232.  
  233. ; =============== S U B R O U T I N E =======================================
  234.  
  235. BossGreyBall_SetSubroutine:
  236.         moveq   #0,d0
  237.         move.b  obBGB_Routine(a0),d0
  238.         addq.b  #1,obBGB_Routine(a0)
  239.         move.b  BossGreyBall_SetMovement(pc,d0.w),d0
  240.         bmi.s   +
  241.         move.l  BossGreyBall_Movement(pc,d0.w),$34(a0)
  242.         rts
  243. +       clr.b   obBGB_Routine(a0)
  244.         rts
  245. ; ---------------------------------------------------------------------------
  246.  
  247. BossGreyBall_SetMovement:
  248.         dc.b 0
  249.         dc.b 1<<2
  250.         dc.b 2<<2
  251.         dc.b 1<<2
  252.         dc.b -1 ; Конец
  253.     even
  254. BossGreyBall_Movement:
  255.         dc.l BossGreyBall_MoveSpikeBall_Explosion   ; 0
  256.         dc.l BossGreyBall_MoveSpikeBall_Hand        ; 1
  257.         dc.l BossGreyBall_MoveSpikeBall_Bounced ; 2
  258. ; ---------------------------------------------------------------------------
  259. ; Босс атакует с помощью взрывающихся шипастых шаров
  260. ; ---------------------------------------------------------------------------
  261.  
  262. ; =============== S U B R O U T I N E =======================================
  263.  
  264. BossGreyBall_MoveSpikeBall_Explosion:
  265.         move.b  #_Setup2,routine(a0)
  266.         bsr.w   BossGreyBall_Swing_Setup
  267.         move.b  #6,$39(a0)
  268.         jsr (Find_SonicTails).l
  269.         move.w  #$100,x_vel(a0)
  270.         tst.w   d0
  271.         bne.s   +
  272.         neg.w   x_vel(a0)
  273. +       move.l  #BossGreyBall_MoveSpikeBall_Explosion_Attack,$34(a0)
  274.  
  275. BossGreyBall_MoveSpikeBall_Explosion_Attack:
  276.         move.w  #$6F,$2E(a0)
  277.         lea ChildObjDat_BossGreyBall_SpikeBall_Explosion(pc),a2
  278.         jsr (CreateChild6_Simple).l
  279.         subq.b  #1,$39(a0)
  280.         bne.s   +
  281.         move.l  #BossGreyBall_SetSubroutine,$34(a0)
  282. +       rts
  283. ; ---------------------------------------------------------------------------
  284. ; Босс атакует с помощью шипастой руки
  285. ; ---------------------------------------------------------------------------
  286.  
  287. ; =============== S U B R O U T I N E =======================================
  288.  
  289. BossGreyBall_MoveSpikeBall_Hand:
  290.         move.b  #_Setup3,routine(a0)
  291.         bsr.w   BossGreyBall_Swing_Setup
  292.         move.l  #BossGreyBall_MoveSpikeBall_Hand_CheckPosition,$34(a0)
  293.         jsr (Find_SonicTails).l
  294.         move.w  #$10,d1
  295.         tst.w   d0
  296.         bne.s   +
  297.         move.w  #$130,d1
  298. +       move.w  d1,obBGB_XPos(a0)
  299.  
  300. BossGreyBall_MoveSpikeBall_Hand_CheckPosition:
  301.         move.w  (Camera_X_pos).w,d0
  302.         add.w   obBGB_XPos(a0),d0
  303.         sub.w   x_pos(a0),d0
  304.         bmi.s   +
  305.         cmpi.w  #20,d0
  306.         bhs.s   +++
  307.         bra.s   ++
  308. +       cmpi.w  #-20,d0
  309.         blo.s       ++
  310. +       move.l  #BossGreyBall_MoveSpikeBall_Hand_Bounced,$34(a0)
  311. +       asl.w   #3,d0
  312.         move.w  d0,x_vel(a0)
  313.  
  314. BossGreyBall_MoveSpikeBall_Hand_Wait:
  315.         rts
  316. ; ---------------------------------------------------------------------------
  317.  
  318. BossGreyBall_MoveSpikeBall_Hand_Bounced:
  319.         move.b  #_Setup4,routine(a0)
  320.         move.l  #BossGreyBall_MoveSpikeBall_Hand_CheckBounced,$34(a0)
  321.         clr.w   x_vel(a0)
  322.         rts
  323. ; ---------------------------------------------------------------------------
  324.  
  325. BossGreyBall_MoveSpikeBall_Hand_CheckBounced:
  326.         move.w  y_vel(a0),d0
  327.         bmi.s   BossGreyBall_MoveSpikeBall_Hand_Wait
  328.         cmpi.w  #$180,d0
  329.         blo.s       BossGreyBall_MoveSpikeBall_Hand_SetCreate
  330.         asr.w   d0
  331.         neg.w   d0
  332.         move.w  d0,y_vel(a0)
  333.  
  334. BossGreyBall_MoveSpikeBall_Hand_Shaking:
  335.         move.w  #$14,(Screen_Shaking_Flag).w
  336.         lea ChildObjDat_BossGreyBall_Spark(pc),a2
  337.         jsr (CreateChild6_Simple).l
  338.         moveq   #sfx_Wham,d0
  339.         jmp (Play_Sound_2).l
  340. ; ---------------------------------------------------------------------------
  341.  
  342. BossGreyBall_MoveSpikeBall_Hand_SetCreate:
  343.         move.b  #_Setup1,routine(a0)
  344.         move.w  #$1F,$2E(a0)
  345.         move.l  #BossGreyBall_MoveSpikeBall_Hand_Create,$34(a0)
  346.         clr.w   y_vel(a0)
  347.         rts
  348. ; ---------------------------------------------------------------------------
  349.  
  350. BossGreyBall_MoveSpikeBall_Hand_Create:
  351.         move.l  #BossGreyBall_MoveSpikeBall_Hand_Wait,$34(a0)
  352.         lea ChildObjDat_BossGreyBall_SpikeBall(pc),a2
  353.         jmp (CreateChild6_Simple).l
  354. ; ---------------------------------------------------------------------------
  355.  
  356. BossGreyBall_MoveSpikeBall_Hand_ReturnPosition:
  357.         move.b  #_Setup5,routine(a0)
  358.         move.w  #$2F,$2E(a0)
  359.         move.l  #BossGreyBall_MoveSpikeBall_Hand_Return,$34(a0)
  360.         move.w  #-$200,y_vel(a0)
  361.         bra.w   BossGreyBall_Swing_Setup2
  362. ; ---------------------------------------------------------------------------
  363.  
  364. BossGreyBall_MoveSpikeBall_Hand_Return:
  365.         move.b  #_Setup3,routine(a0)
  366.         move.l  #BossGreyBall_SetSubroutine,$34(a0)
  367.         clr.w   x_vel(a0)
  368.         rts
  369. ; ---------------------------------------------------------------------------
  370. ; Босс атакует с помощью шипастых шаров на цепи
  371. ; ---------------------------------------------------------------------------
  372.  
  373. ; =============== S U B R O U T I N E =======================================
  374.  
  375. BossGreyBall_MoveSpikeBall_Bounced:
  376.         move.b  #_Setup2,routine(a0)
  377.         bsr.w   BossGreyBall_Swing_Setup
  378.         move.b  #4,$39(a0)
  379.         jsr (Find_SonicTails).l
  380.         move.w  #$100,x_vel(a0)
  381.         tst.w   d0
  382.         bne.s   +
  383.         neg.w   x_vel(a0)
  384. +       move.l  #BossGreyBall_MoveSpikeBall_Bounced_Attack,$34(a0)
  385.  
  386. BossGreyBall_MoveSpikeBall_Bounced_Attack:
  387.         move.w  #$EF,$2E(a0)
  388.         lea ChildObjDat_BossGreyBall_SpikeBall_Bounced(pc),a2
  389.         jsr (CreateChild6_Simple).l
  390.         subq.b  #1,$39(a0)
  391.         bne.s   +
  392.         move.l  #BossGreyBall_SetSubroutine,$34(a0)
  393. +       rts
  394. ; ---------------------------------------------------------------------------
  395. ; Интро (последняя фаза)
  396. ; ---------------------------------------------------------------------------
  397.  
  398. ; =============== S U B R O U T I N E =======================================
  399.  
  400. BossGreyBall_FinalPhase_Intro:
  401.         move.b  #_Setup5,routine(a0)
  402.         move.l  #BossGreyBall_FinalPhase_Intro_CheckPosition,$34(a0)
  403.         move.w  #-$200,y_vel(a0)
  404.         move.b  #$67,(Negative_flash_timer).w
  405.         bra.w   BossGreyBall_Swing_Setup2
  406. ; ---------------------------------------------------------------------------
  407.  
  408. BossGreyBall_FinalPhase_Intro_CheckPosition:
  409.         bsr.w   BossGreyBall_CreateFire
  410.         move.b  (Level_frame_counter+1).w,d0
  411.         andi.w  #7,d0
  412.         bne.s   +
  413.         sfx sfx_BreakBridge,0,0,0
  414. +       move.w  (Camera_Y_pos).w,d0
  415.         addi.w  #$40,d0
  416.         cmp.w   y_pos(a0),d0
  417.         blo.s       BossGreyBall_FinalPhase_Intro_Return
  418.         move.b  #_Setup9,routine(a0)
  419.         move.w  #$1F,$2E(a0)
  420.         move.l  #BossGreyBall_FinalPhase_Intro_Fall,$34(a0)
  421.         clr.l   x_vel(a0)
  422.         rts
  423. ; ---------------------------------------------------------------------------
  424.  
  425. BossGreyBall_FinalPhase_Intro_Fall:
  426.         move.b  #_Setup1,routine(a0)
  427.         move.l  #BossGreyBall_MoveJump_Attack,$34(a0)
  428.         clr.l   x_vel(a0)
  429.         lea (Player_1).w,a1
  430.         sfx sfx_FireShield,0,0,0
  431.  
  432. BossGreyBall_FinalPhase_Intro_CreateFireShield:
  433.         andi.b  #$8E,status_secondary(a1)
  434.         bset    #Status_FireShield,status_secondary(a1)
  435.         move.l  #Obj_Fire_Shield,(v_Shield).w
  436.         move.w  a1,(v_Shield+parent).w
  437.  
  438. BossGreyBall_FinalPhase_Intro_Return:
  439.         rts
  440. ; ---------------------------------------------------------------------------
  441. ; Босс атакует с помощью прыжка (последняя фаза)
  442. ; ---------------------------------------------------------------------------
  443.  
  444. ; =============== S U B R O U T I N E =======================================
  445.  
  446. BossGreyBall_MoveJump_Attack:
  447.         move.b  #_Setup6,routine(a0)
  448.         move.l  #BossGreyBall_MoveJump_Floor,$34(a0)
  449.  
  450. BossGreyBall_MoveJump_Wait:
  451.         rts
  452. ; ---------------------------------------------------------------------------
  453.  
  454. BossGreyBall_MoveJump_Floor:
  455.         tst.w   y_vel(a0)
  456.         bmi.s   BossGreyBall_MoveJump_Wait
  457.         jsr (ObjCheckFloorDist).l
  458.         tst.w   d1
  459.         bpl.s   BossGreyBall_MoveJump_Wait
  460.         add.w   d1,y_pos(a0)
  461.         move.l  #BossGreyBall_MoveJump_CheckBounced,$34(a0)
  462.  
  463. BossGreyBall_MoveJump_CheckBounced:
  464.         move.w  y_vel(a0),d0
  465.         bmi.w   BossGreyBall_MoveJump_Wait
  466.         cmpi.w  #$180,d0
  467.         blo.s       BossGreyBall_MoveJump_JumpWait
  468.         asr.w   d0
  469.         neg.w   d0
  470.         move.w  d0,y_vel(a0)
  471.         move.l  #BossGreyBall_MoveJump_Floor,$34(a0)
  472.         bra.w   BossGreyBall_MoveSpikeBall_Hand_Shaking
  473. ; ---------------------------------------------------------------------------
  474.  
  475. BossGreyBall_MoveJump_JumpWait:
  476.         move.b  #_Setup7,routine(a0)
  477.         move.l  #BossGreyBall_MoveJump_StopVelocity,$34(a0)
  478.         clr.w   y_vel(a0)
  479.         rts
  480. ; ---------------------------------------------------------------------------
  481.  
  482. BossGreyBall_MoveJump_StopVelocity:
  483.         move.w  x_vel(a0),d0
  484.         beq.s   BossGreyBall_MoveJump_Return
  485.         cmpi.w  #-1,d0
  486.         beq.s   BossGreyBall_MoveJump_Return
  487.         asr.w   d0
  488.         move.w  d0,x_vel(a0)
  489.         move.w  #$F,$2E(a0)
  490.         rts
  491. ; ---------------------------------------------------------------------------
  492.  
  493. BossGreyBall_MoveJump_Return:
  494.         move.w  #$2F,$2E(a0)
  495.         move.l  #BossGreyBall_MoveJump_Start,$34(a0)
  496.         clr.w   x_vel(a0)
  497.         rts
  498. ; ---------------------------------------------------------------------------
  499.  
  500. BossGreyBall_MoveJump_Start:
  501.         move.l  #BossGreyBall_MoveJump_Attack,$34(a0)
  502.         jsr (Find_SonicTails).l
  503.         move.w  #$200,x_vel(a0)
  504.         tst.w   d0
  505.         bne.s   +
  506.         neg.w   x_vel(a0)
  507. +       move.w  #-$700,y_vel(a0)
  508.         sfx sfx_Jump2,0,0,0
  509.         move.w  #$14,(Screen_Shaking_Flag).w
  510.         lea ChildObjDat_BossGreyBall_SpikeBall_Shot(pc),a2
  511.         jmp (CreateChild6_Simple).l
  512. ; ---------------------------------------------------------------------------
  513. ; Проверка урона
  514. ; ---------------------------------------------------------------------------
  515.  
  516. ; =============== S U B R O U T I N E =======================================
  517.  
  518. BossGreyBall_CheckTouch:
  519.         tst.b   collision_flags(a0)
  520.         bne.s   BossGreyBall_CheckTouch_Return
  521.         move.b  collision_property(a0),d4
  522.         beq.w   BossGreyBall_CheckTouch_WaitExplosive
  523.         tst.b   $1C(a0)
  524.         bne.s   +
  525.         jsr (Find_SonicTails).l
  526.         tst.w   d1
  527.         bne.s   BossGreyBall_CheckTouch_Bounce
  528.         sfx sfx_HitBoss,0,0,0
  529.         move.b  #$60,$1C(a0)
  530.         bset    #6,status(a0)
  531.         cmpi.b  #BossGreyBall_Hits/3,d4
  532.         bne.s   +
  533.         bset    #5,status(a0)
  534.         move.w  #-1,$2E(a0)
  535.         move.b  #-1,$1C(a0)
  536.         move.l  #BossGreyBall_FinalPhase_Intro,$34(a0)
  537. +       moveq   #0,d0
  538.         btst    #0,$1C(a0)
  539.         bne.s   +
  540.         addi.w  #7*2,d0
  541. +       bsr.w   BossGreyBall_PalFlash
  542.         subq.b  #1,$1C(a0)
  543.         bne.s   BossGreyBall_CheckTouch_Return
  544.         bclr    #6,status(a0)
  545.  
  546. BossGreyBall_CheckTouch_Restore:
  547.         move.b  collision_restore_flags(a0),collision_flags(a0)
  548.  
  549. BossGreyBall_CheckTouch_Return:
  550.         rts
  551. ; ---------------------------------------------------------------------------
  552.  
  553. BossGreyBall_CheckTouch_Bounce:
  554.         sfx sfx_Bumper2,0,0,0
  555.         addq.b  #1,collision_property(a0)
  556.         lea (Player_1).w,a1
  557.         move.w  x_pos(a1),d1
  558.         move.w  y_pos(a1),d2
  559.         sub.w   x_pos(a0),d1
  560.         sub.w   y_pos(a0),d2
  561.         jsr (GetArcTan).l
  562.         jsr (GetSineCosine).l
  563.         move.w  #$400,d2
  564.         muls.w  d2,d1
  565.         asr.l   #8,d1
  566.         move.w  d1,x_vel(a1)
  567.         muls.w  d2,d0
  568.         asr.l   #8,d0
  569.         move.w  d0,y_vel(a1)
  570.         bra.s   BossGreyBall_CheckTouch_Restore
  571. ; ---------------------------------------------------------------------------
  572.  
  573. BossGreyBall_CheckTouch_WaitExplosive:
  574.         move.l  #BossGreyBall_CheckTouch_WaitExplosive_Restore,address(a0)
  575.         bset    #7,status(a0)
  576.         clr.w   x_vel(a0)
  577.         move.w  #-$300,y_vel(a0)
  578.         clr.w   $2E(a0)
  579.         move.b  #$4F,(Negative_flash_timer).w
  580.         jmp (BossDefeated_NoTime).l
  581. ; ---------------------------------------------------------------------------
  582.  
  583. BossGreyBall_CheckTouch_WaitExplosive_Restore:
  584.         move.l  #BossGreyBall_CheckTouch_WaitPlayerExplosive,address(a0)
  585.         bclr    #7,status(a0)
  586.         lea ChildObjDat_BossGreyBall_Face(pc),a2
  587.         jsr (CreateChild6_Simple).l
  588.         st  (Screen_Shaking_Flag).w
  589.         st  (NoPause_flag).w
  590.         lea (Pal_DEZ2_Intro).l,a1
  591.         lea (Normal_palette_line_2).w,a2
  592.         moveq   #7,d0
  593. -       move.l  (a1)+,(a2)+
  594.         dbf d0,-
  595.         bra.w   BossGreyBall_CheckTouch_TimeExplosive
  596. ; ---------------------------------------------------------------------------
  597.  
  598. BossGreyBall_CheckTouch_WaitPlayerExplosive:
  599.         bsr.w   BossGreyBall_CheckTouch_TimeExplosive
  600.         move.b  (Level_frame_counter+1).w,d0
  601.         andi.w  #7,d0
  602.         bne.s   +
  603.         sfx sfx_BreakBridge,0,0,0
  604. +       jsr (MoveSprite2).l
  605.         move.w  (Camera_Y_pos).w,d0
  606.         addi.w  #$60,d0
  607.         cmp.w   y_pos(a0),d0
  608.         blo.s       +
  609.         move.l  #BossGreyBall_CheckTouch_PlayerExplosive,address(a0)
  610. +       bra.w   BossGreyBall_CheckTouch_TimeExplosive
  611. ; ---------------------------------------------------------------------------
  612.  
  613. BossGreyBall_CheckTouch_PlayerExplosive:
  614.         lea (Player_1).w,a1
  615.         btst    #Status_InAir,status(a1)
  616.         bne.s   BossGreyBall_CheckTouch_TimeExplosive
  617.         move.l  #BossGreyBall_CheckTouch_TimeExplosive,address(a0)
  618.         clr.w   (Ctrl_1_logical).w
  619.         jsr (Find_SonicTails).l
  620.         move.b  #$81,object_control(a1)
  621.         move.w  #id_LookUp<<8,anim(a1)
  622.         jsr (Stop_Object).l
  623.         bclr    #Status_Facing,status(a1)
  624.         tst.w   d0
  625.         beq.s   +
  626.         bset    #Status_Facing,status(a1)
  627. +       lea ChildObjDat_Dialog_Process(pc),a2
  628.         jsr (CreateChild6_Simple).l
  629.         bne.s   BossGreyBall_CheckTouch_TimeExplosive
  630.         move.b  #_GreyBallEnd,routine(a1)
  631.         move.l  #DialogGreyBallEnd_Process_Index-4,$34(a1)
  632.         move.b  #(DialogGreyBallEnd_Process_Index_End-DialogGreyBallEnd_Process_Index)/8,$39(a1)
  633.  
  634. BossGreyBall_CheckTouch_TimeExplosive:
  635.         bsr.w   BossGreyBall_CreateFire
  636.         moveq   #0,d0
  637.         btst    #0,(V_int_run_count+3).w
  638.         beq.s   +
  639.         addq.b  #1,d0
  640. +       move.b  d0,mapping_frame(a0)
  641.         jmp (Draw_Sprite).l
  642. ; ---------------------------------------------------------------------------
  643.  
  644. BossGreyBall_CheckTouch_SuperExplosive:
  645.         move.b  $40(a0),d0
  646.         add.b   d0,$3C(a0)
  647.         btst    #0,(Level_frame_counter+1).w
  648.         beq.s   +
  649.         lea ChildObjDat_DEZRadiusSuperExplosion(pc),a2
  650.         jsr (CreateChild6_Simple).l
  651.         bne.s   +
  652.         move.b  $3C(a0),$3C(a1)
  653. +       move.b  (Level_frame_counter+1).w,d0
  654.         andi.w  #7,d0
  655.         bne.s   +
  656.         sfx sfx_BreakBridge,0,0,0
  657. +       subq.w  #1,$2E(a0)
  658.         bpl.s   +
  659.         addq.b  #2,(Dynamic_resize_routine).w
  660.         move.l  #Go_Delete_Sprite,address(a0)
  661. +       rts
  662. ; ---------------------------------------------------------------------------
  663. ; Клон (Интро)
  664. ; ---------------------------------------------------------------------------
  665.  
  666. ; =============== S U B R O U T I N E =======================================
  667.  
  668. Obj_BossGreyBall_IntroClone:
  669.         lea ObjDat3_BossGreyBall(pc),a1
  670.         jsr (SetUp_ObjAttributes).l
  671.         move.b  #8,objoff_41(a0)
  672.         move.b  #64,objoff_3C(a0)
  673.         move.b  #128,objoff_3A(a0)
  674.         move.l  #BossGreyBall_IntroClone_Frame2,address(a0)
  675.         tst.b   subtype(a0)
  676.         beq.s   BossGreyBall_IntroClone_Frame2
  677.         neg.b   objoff_3C(a0)
  678.         move.l  #BossGreyBall_IntroClone_Frame1,address(a0)
  679.  
  680. BossGreyBall_IntroClone_Frame1:
  681.         btst    #0,(Level_frame_counter+1).w
  682.         beq.s   BossGreyBall_IntroClone_Draw
  683.  
  684. BossGreyBall_IntroClone_Return:
  685.         rts
  686. ; ---------------------------------------------------------------------------
  687.  
  688. BossGreyBall_IntroClone_Frame2:
  689.         btst    #0,(Level_frame_counter+1).w
  690.         beq.s   BossGreyBall_IntroClone_Return
  691.  
  692. BossGreyBall_IntroClone_Draw:
  693.         subq.b  #2,objoff_3A(a0)
  694.         bmi.s   BossGreyBall_IntroClone_Remove
  695.         move.b  objoff_41(a0),d0
  696.         add.b   d0,objoff_3C(a0)
  697.         jsr (MoveSprite_Circular).l
  698.         jmp (Child_Draw_Sprite).l
  699. ; ---------------------------------------------------------------------------
  700.  
  701. BossGreyBall_IntroClone_Remove:
  702.         move.l  #Go_Delete_Sprite,address(a0)
  703.         tst.b   subtype(a0)
  704.         bne.s   +
  705.         movea.w parent3(a0),a1
  706.         move.l  #BossGreyBall_Intro_MoveSwing,$34(a1)
  707.         sf  obBGB_Draw(a1)
  708. +       rts
  709. ; ---------------------------------------------------------------------------
  710. ; Указатель
  711. ; ---------------------------------------------------------------------------
  712.  
  713. ; =============== S U B R O U T I N E =======================================
  714.  
  715. Obj_BossGreyBall_Designator:
  716.         lea ObjDat3_BossGreyBall_Designator(pc),a1
  717.         jsr (SetUp_ObjAttributes3).l
  718.         move.b  #8,$40(a0)
  719.         move.l  #BossGreyBall_Designator_Frame2,address(a0)
  720.         tst.b   subtype(a0)
  721.         beq.s   BossGreyBall_Designator_Frame2
  722.         neg.b   $40(a0)
  723.         move.l  #BossGreyBall_Designator_Frame1,address(a0)
  724.  
  725. BossGreyBall_Designator_Frame1:
  726.         btst    #0,(Level_frame_counter+1).w
  727.         beq.s   BossGreyBall_Designator_Draw
  728.  
  729. BossGreyBall_Designator_Return:
  730.         rts
  731. ; ---------------------------------------------------------------------------
  732.  
  733. BossGreyBall_Designator_Frame2:
  734.         btst    #0,(Level_frame_counter+1).w
  735.         beq.s   BossGreyBall_Designator_Return
  736.  
  737. BossGreyBall_Designator_Draw:
  738.         jsr (Refresh_ChildPosition).l
  739.         move.b  $40(a0),d0
  740.         add.b   d0,child_dx(a0)
  741.         beq.s   BossGreyBall_Designator_Remove
  742.         jmp (Child_Draw_Sprite).l
  743. ; ---------------------------------------------------------------------------
  744.  
  745. BossGreyBall_Designator_Remove:
  746.         move.l  #Go_Delete_Sprite,address(a0)
  747.         tst.b   subtype(a0)
  748.         bne.s   BossGreyBall_Designator_Return
  749.         move.w  #$3F,$2E(a0)
  750.         move.l  #Go_Delete_Sprite,$34(a0)
  751.         move.l  #BossGreyBall_Designator_Main,address(a0)
  752.  
  753. BossGreyBall_Designator_Main:
  754.         jsr (Refresh_ChildPosition).l
  755.         jsr (Obj_Wait).l
  756.         btst    #1,(Level_frame_counter+1).w
  757.         beq.w   BossGreyBall_SpikeBall_Bounced_Chain_Trail_CheckParent
  758.         jmp (Child_Draw_Sprite).l
  759. ; ---------------------------------------------------------------------------
  760. ; Глаза
  761. ; ---------------------------------------------------------------------------
  762.  
  763. ; =============== S U B R O U T I N E =======================================
  764.  
  765. Obj_BossGreyBall_Face:
  766.         lea ObjDat3_BossGreyBall_Face(pc),a1
  767.         jsr (SetUp_ObjAttributes3).l
  768.         move.l  #BossGreyBall_Face_Main,address(a0)
  769.  
  770. BossGreyBall_Face_Main:
  771.         movea.w parent3(a0),a1
  772.         move.w  y_pos(a1),y_pos(a0)
  773.         move.w  (Player_1+x_pos).w,d0
  774.         move.w  x_pos(a1),d1
  775.         sub.w   d1,d0
  776.         smi d2
  777.         bpl.s   +
  778.         neg.w   d0
  779. +       cmpi.w  #8,d0
  780.         bls.s       +
  781.         moveq   #8,d0
  782. +       tst.b   d2
  783.         beq.s   +
  784.         neg.w   d0
  785. +       add.w   d0,d1
  786.         move.w  d1,x_pos(a0)
  787.         jsr (Find_SonicTails).l
  788.         moveq   #2,d0
  789.         tst.w   d1
  790.         bne.s   +
  791.         addq.b  #1,d0
  792. +       move.b  d0,mapping_frame(a0)
  793.         movea.w parent3(a0),a1
  794.         tst.b   obBGB_Draw(a1)
  795.         bne.w   BossGreyBall_IntroClone_Return
  796.         jmp (Child_Draw_Sprite).l
  797. ; ---------------------------------------------------------------------------
  798. ; Взрывающийся шипастый шар
  799. ; ---------------------------------------------------------------------------
  800.  
  801. ; =============== S U B R O U T I N E =======================================
  802.  
  803. Obj_BossGreyBall_SpikeBall_Explosion:
  804.         lea ObjDat3_BossGreyBall_SpikeBall(pc),a1
  805.         jsr (SetUp_ObjAttributes3).l
  806.         jsr (Find_SonicTails).l
  807.         move.b  #1,objoff_41(a0)
  808.         move.b  #64,objoff_3C(a0)
  809.         tst.w   d0
  810.         bne.s   +
  811.         neg.b   objoff_3C(a0)
  812.         neg.b   objoff_41(a0)
  813. +       move.b  #44/2,y_radius(a0)
  814.         move.l  #BossGreyBall_SpikeBall_Explosion_Radius,address(a0)
  815.  
  816. BossGreyBall_SpikeBall_Explosion_Radius:
  817.         jsr (MoveSprite_Circular).l
  818.         addq.b  #1,objoff_3A(a0)
  819.         cmpi.b  #48,objoff_3A(a0)
  820.         bne.w   BossGreyBall_SpikeBall_Explosion_Draw
  821.         sfx sfx_SpikeBall2,0,0,0
  822.         move.w  #$100,priority(a0)
  823.  
  824. BossGreyBall_SpikeBall_Explosion_Velocity:
  825.         move.w  #$180,x_vel(a0)
  826.         tst.b   objoff_41(a0)
  827.         bpl.s   +
  828.         neg.w   x_vel(a0)
  829. +       move.w  #$F,$2E(a0)
  830.         move.l  #BossGreyBall_SpikeBall_Explosion_Wait,address(a0)
  831.  
  832. BossGreyBall_SpikeBall_Explosion_Wait:
  833.         move.b  objoff_41(a0),d0
  834.         add.b   d0,objoff_3C(a0)
  835.         jsr (MoveSprite_Circular).l
  836.         subq.w  #1,$2E(a0)
  837.         bpl.s   BossGreyBall_SpikeBall_Explosion_Draw
  838.         sfx sfx_Fire2,0,0,0
  839.         move.l  #BossGreyBall_SpikeBall_Explosion_Fall,address(a0)
  840.  
  841. BossGreyBall_SpikeBall_Explosion_Fall:
  842.         btst    #0,(Level_frame_counter+1).w
  843.         bne.s   +
  844.         eori.b  #$60,art_tile(a0)
  845. +       btst    #1,(Level_frame_counter+1).w
  846.         beq.s   +
  847.         lea ChildObjDat_BossGreyBall_SpikeBall_Fire(pc),a2
  848.         jsr (CreateChild6_Simple).l
  849. +       jsr (MoveSprite).l
  850.         tst.w   y_vel(a0)
  851.         bmi.s   BossGreyBall_SpikeBall_Explosion_Draw
  852.         jsr (ObjCheckFloorDist).l
  853.         tst.w   d1
  854.         bpl.s   BossGreyBall_SpikeBall_Explosion_Draw
  855.         add.w   d1,y_pos(a0)
  856.         move.l  #BossGreyBall_SpikeBall_CheckBounced,address(a0)
  857.  
  858. BossGreyBall_SpikeBall_CheckBounced:
  859.         jsr (MoveSprite).l
  860.         move.w  y_vel(a0),d0
  861.         bmi.s   BossGreyBall_SpikeBall_Explosion_Draw
  862.         cmpi.w  #$180,d0
  863.         blo.s       BossGreyBall_SpikeBall_Remove
  864.         asr.w   d0
  865.         neg.w   d0
  866.         move.w  d0,y_vel(a0)
  867.         sfx sfx_SpikeBall,0,0,0
  868.         lea ChildObjDat_BossGreyBall_Spark(pc),a2
  869.         jsr (CreateChild6_Simple).l
  870.         move.l  #BossGreyBall_SpikeBall_Explosion_Fall,address(a0)
  871.  
  872. BossGreyBall_SpikeBall_Explosion_Draw:
  873.         jmp (Child_DrawTouch_Sprite).l
  874. ; ---------------------------------------------------------------------------
  875.  
  876. BossGreyBall_SpikeBall_Remove:
  877.         ori.b   #$60,art_tile(a0)
  878.  
  879. BossGreyBall_SpikeBall_Remove2:
  880.         sfx sfx_BreakBridge,0,0,0
  881.         move.w  #$14,(Screen_Shaking_Flag).w
  882.         move.l  #Go_Delete_Sprite,address(a0)
  883.         lea ChildObjDat_DEZRadiusExplosion(pc),a2
  884.         jsr (CreateChild6_Simple).l
  885.         lea ChildObjDat_BossGreyBall_Splinter(pc),a2
  886.         jmp (CreateChild6_Simple).l
  887. ; ---------------------------------------------------------------------------
  888. ; Куски шипастого шара
  889. ; ---------------------------------------------------------------------------
  890.  
  891. ; =============== S U B R O U T I N E =======================================
  892.  
  893. Obj_BossGreyBall_Splinter:
  894.         lea ObjDat3_BossRobot_Flicker(pc),a1
  895.         jsr (SetUp_ObjAttributes3).l
  896.         move.l  #BossGreyBall_Splinter_Main,address(a0)
  897.         moveq   #0,d0
  898.         move.b  subtype(a0),d0
  899.         move.b  d0,d1
  900.         lsr.b   #1,d0
  901.         addq.b  #6,d0
  902.         move.b  d0,mapping_frame(a0)
  903.         addq.b  #1,d1
  904.         lsl.b   #5,d1
  905.         move.b  d1,d0
  906.         jsr (GetSineCosine).l
  907.         move.w  #$C00,d2
  908.         muls.w  d2,d0
  909.         asr.l   #8,d0
  910.         move.w  d0,x_vel(a0)
  911.         muls.w  d2,d1
  912.         asr.l   #8,d1
  913.         move.w  d1,y_vel(a0)
  914.  
  915. BossGreyBall_Splinter_Main:
  916.         jsr (MoveSprite2).l
  917.         btst    #0,(Level_frame_counter+1).w
  918.         bne.s   BossGreyBall_Splinter_CheckParent
  919.         jmp (Sprite_CheckDeleteXY).l
  920. ; ---------------------------------------------------------------------------
  921.  
  922. BossGreyBall_Splinter_CheckParent:
  923.         jmp (Child_CheckParent).l
  924. ; ---------------------------------------------------------------------------
  925. ; Искры
  926. ; ---------------------------------------------------------------------------
  927.  
  928. ; =============== S U B R O U T I N E =======================================
  929.  
  930. Obj_BossGreyBall_Spark:
  931.         lea ObjDat3_BossGreyBall_Spark(pc),a1
  932.         jsr (SetUp_ObjAttributes3).l
  933.         moveq   #0,d0
  934.         move.b  subtype(a0),d0
  935.         move.w  d0,d1
  936.         addq.w  #7,d0
  937.         move.w  d0,$2E(a0)
  938.         movea.w parent3(a0),a1
  939.         move.w  x_vel(a1),d0
  940.         asl.w   #2,d0
  941.         asl.w   #6,d1
  942.         add.w   d1,d0
  943.         neg.w   d0
  944.         move.w  d0,x_vel(a0)
  945.         jsr (Random_Number).l
  946.         andi.w  #$3FF,d0
  947.         addi.w  #$100,d0
  948.         neg.w   d0
  949.         move.w  d0,y_vel(a0)
  950.         move.l  #Go_Delete_Sprite,$34(a0)
  951.         move.l  #BossGreyBall_Spark_Draw,address(a0)
  952.  
  953. BossGreyBall_Spark_Draw:
  954.         jsr (MoveSprite2).l
  955.         jsr (Obj_Wait).l
  956.         jmp (Sprite_CheckDeleteXY).l
  957. ; ---------------------------------------------------------------------------
  958. ; Атакующий шипастый шар
  959. ; ---------------------------------------------------------------------------
  960.  
  961. ; =============== S U B R O U T I N E =======================================
  962.  
  963. Obj_BossGreyBall_SpikeBall:
  964.         lea ObjDat3_BossGreyBall_SpikeBall(pc),a1
  965.         jsr (SetUp_ObjAttributes3).l
  966.         move.b  #3,$39(a0)
  967.         jsr (Find_SonicTails).l
  968.         move.b  #64,objoff_3C(a0)
  969.         tst.w   d0
  970.         bne.s   +
  971.         neg.b   objoff_3C(a0)
  972. +       move.b  #44/2,y_radius(a0)
  973.         move.l  #BossGreyBall_SpikeBall_Radius,address(a0)
  974.  
  975. BossGreyBall_SpikeBall_Radius:
  976.         jsr (MoveSprite_Circular).l
  977.         addq.b  #2,objoff_3A(a0)
  978.         cmpi.b  #48,objoff_3A(a0)
  979.         bne.w   BossGreyBall_SpikeBall_Draw
  980.         move.w  #$100,priority(a0)
  981.         move.w  #$9F,$2E(a0)
  982.  
  983. BossGreyBall_SpikeBall_AimingStart:
  984.         sfx sfx_LaserStart,0,0,0
  985.         move.l  #BossGreyBall_SpikeBall_Aiming,address(a0)
  986.  
  987. BossGreyBall_SpikeBall_Aiming:
  988.         btst    #0,(Level_frame_counter+1).w
  989.         bne.s   +
  990.         eori.b  #$60,art_tile(a0)
  991. +       lea (Player_1).w,a2
  992.         movea.w parent3(a0),a1
  993.         jsr (CalcObjAngle).l
  994.         move.b  d0,$3C(a0)
  995.         jsr (MoveSprite_Circular).l
  996.         subq.w  #1,$2E(a0)
  997.         bpl.w   BossGreyBall_SpikeBall_Draw
  998.         sfx sfx_SpikeAttack,0,0,0
  999.         ori.b   #$60,art_tile(a0)
  1000.         move.l  #BossGreyBall_SpikeBall_AttackSonic,address(a0)
  1001.         lea (Player_1).w,a1
  1002.         move.w  x_pos(a1),$30(a0)
  1003.         move.w  y_pos(a1),$32(a0)
  1004.         movea.w parent3(a0),a2
  1005.         jsr (CalcObjAngle).l
  1006.         move.b  d0,$3C(a0)
  1007.         lea ChildObjDat_BossGreyBall_SpikeBall_Chain(pc),a2
  1008.         jsr (CreateChild8_TreeListRepeated).l
  1009.  
  1010. BossGreyBall_SpikeBall_AttackSonic:
  1011.         bsr.s   BossGreyBall_SpikeBall_CheckFloor
  1012.         bsr.s   BossGreyBall_SpikeBall_CalcPosition
  1013.         move.w  $30(a0),d0
  1014.         sub.w   x_pos(a0),d0
  1015.         bne.s   +
  1016.         move.l  #BossGreyBall_SpikeBall_AttackReturn,address(a0)
  1017. +       asl.w   #5,d0
  1018.         move.w  d0,x_vel(a0)
  1019.         move.w  $32(a0),d0
  1020.         sub.w   y_pos(a0),d0
  1021.         asl.w   #5,d0
  1022.         move.w  d0,y_vel(a0)
  1023.         bra.w   BossGreyBall_SpikeBall_Draw
  1024. ; ---------------------------------------------------------------------------
  1025.  
  1026. BossGreyBall_SpikeBall_CheckFloor:
  1027.         btst    #2,(Level_frame_counter+1).w
  1028.         bne.s   BossGreyBall_SpikeBall_CalcPosition_Return
  1029.         jsr (ObjCheckFloorDist).l
  1030.         tst.w   d1
  1031.         bpl.s   BossGreyBall_SpikeBall_CalcPosition_Return
  1032.         sfx sfx_SpikeBall,0,0,0
  1033.         move.w  #$14,(Screen_Shaking_Flag).w
  1034.         lea ChildObjDat_BossGreyBall_Spark(pc),a2
  1035.         jmp (CreateChild6_Simple).l
  1036. ; ---------------------------------------------------------------------------
  1037.  
  1038. BossGreyBall_SpikeBall_CalcPosition:
  1039.         movea.w parent3(a0),a1
  1040.         jsr (Find_OtherObject).l
  1041.         add.w   d3,d2           ; X+Ypos
  1042.         lsr.w   #3,d2
  1043.         move.b  d2,objoff_3A(a0)
  1044.         lsr.w   #3,d2
  1045.         tst.w   d0
  1046.         beq.s   +
  1047.         neg.w   d2
  1048. +       move.b  d2,child_dx(a0)
  1049.  
  1050. BossGreyBall_SpikeBall_CalcPosition_Return:
  1051.         rts
  1052. ; ---------------------------------------------------------------------------
  1053.  
  1054. BossGreyBall_SpikeBall_AttackReturn:
  1055.         bsr.s   BossGreyBall_SpikeBall_CalcPosition
  1056.         move.w  x_pos(a1),d0
  1057.         sub.w   x_pos(a0),d0
  1058.         asl.w   #5,d0
  1059.         move.w  d0,x_vel(a0)
  1060.         move.w  y_pos(a1),d0
  1061.         sub.w   y_pos(a0),d0
  1062.         asl.w   #5,d0
  1063.         move.w  d0,y_vel(a0)
  1064.         jsr (Find_OtherObject).l
  1065.         move.w  #48,d1
  1066.         cmp.w   d1,d2
  1067.         bhs.s   BossGreyBall_SpikeBall_Draw
  1068.         cmp.w   d1,d3
  1069.         bhs.s   BossGreyBall_SpikeBall_Draw
  1070.         clr.l   x_vel(a0)
  1071.         move.b  #48,objoff_3A(a0)
  1072.         move.w  #$7F,$2E(a0)
  1073.         movea.w $44(a0),a1
  1074.         move.l  #Go_Delete_Sprite,address(a1)
  1075.         move.l  #BossGreyBall_SpikeBall_AimingStart,address(a0)
  1076.         subq.b  #1,$39(a0)
  1077.         bne.s   BossGreyBall_SpikeBall_Draw
  1078.         movea.w parent3(a0),a1
  1079.         move.l  #BossGreyBall_MoveSpikeBall_Hand_ReturnPosition,$34(a1)
  1080.         jsr (Find_SonicTails).l
  1081.         move.b  #1,objoff_41(a0)
  1082.         move.b  #64,objoff_3C(a0)
  1083.         tst.w   d0
  1084.         bne.s   +
  1085.         neg.b   objoff_3C(a0)
  1086.         neg.b   objoff_41(a0)
  1087. +       move.l  #BossGreyBall_SpikeBall_Explosion_Velocity,address(a0)
  1088.  
  1089. BossGreyBall_SpikeBall_Draw:
  1090.         jsr (MoveSprite2).l
  1091.         movea.w parent3(a0),a1
  1092.         btst    #5,status(a1)
  1093.         bne.w   BossGreyBall_SpikeBall_Remove2
  1094.         jmp (Child_DrawTouch_Sprite).l
  1095. ; ---------------------------------------------------------------------------
  1096. ; Атакующий шипастый шар (цепь)
  1097. ; ---------------------------------------------------------------------------
  1098.  
  1099. ; =============== S U B R O U T I N E =======================================
  1100.  
  1101. Obj_BossGreyBall_SpikeBall_Chain:
  1102.         lea ObjDat3_BossGreyBall_SpikeBall_Chain(pc),a1
  1103.         jsr (SetUp_ObjAttributes3).l
  1104.         movea.w parent3(a0),a1
  1105.         move.l  #BossGreyBall_SpikeBall_Chain_Main,address(a0)
  1106.         cmpi.l  #BossGreyBall_SpikeBall_AttackSonic,address(a1)
  1107.         bne.s   BossGreyBall_SpikeBall_Chain_Main
  1108.         move.w  a0,$44(a1)
  1109.  
  1110. BossGreyBall_SpikeBall_Chain_Main:
  1111.         movea.w parent3(a0),a1
  1112.         move.b  child_dx(a1),child_dx(a0)
  1113.         move.b  objoff_3A(a1),objoff_3A(a0)
  1114.         move.b  objoff_3C(a1),objoff_3C(a0)
  1115.         jsr (MoveSprite_Circular).l
  1116.         btst    #0,(Level_frame_counter+1).w
  1117.         bne.w   BossGreyBall_SpikeBall_Bounced_Chain_Trail_CheckParent
  1118.         jmp (Child_Draw_Sprite).l
  1119. ; ---------------------------------------------------------------------------
  1120. ; Отскакивающий шипастый шар
  1121. ; ---------------------------------------------------------------------------
  1122.  
  1123. ; =============== S U B R O U T I N E =======================================
  1124.  
  1125. Obj_BossGreyBall_SpikeBall_Bounced:
  1126.         lea ObjDat3_BossGreyBall_SpikeBall(pc),a1
  1127.         jsr (SetUp_ObjAttributes3).l
  1128.         jsr (Find_SonicTails).l
  1129.         move.b  #1,objoff_41(a0)
  1130.         move.b  #64,objoff_3C(a0)
  1131.         tst.w   d0
  1132.         bne.s   +
  1133.         neg.b   objoff_3C(a0)
  1134.         neg.b   objoff_41(a0)
  1135. +       move.b  #44/2,y_radius(a0)
  1136.         move.l  #BossGreyBall_SpikeBall_Bounced_Radius,address(a0)
  1137.  
  1138. BossGreyBall_SpikeBall_Bounced_Radius:
  1139.         jsr (MoveSprite_Circular).l
  1140.         addq.b  #1,objoff_3A(a0)
  1141.         cmpi.b  #48,objoff_3A(a0)
  1142.         bne.s   BossGreyBall_SpikeBall_Bounced_Setup
  1143.         sfx sfx_SpikeBall2,0,0,0
  1144.         move.w  #$100,priority(a0)
  1145.         jsr (Find_SonicTails).l
  1146.         move.w  #$200,x_vel(a0)
  1147.         tst.w   d0
  1148.         bne.s   +
  1149.         neg.w   x_vel(a0)
  1150. +       move.w  #$F,$2E(a0)
  1151.         move.l  #BossGreyBall_SpikeBall_Bounced_Wait,address(a0)
  1152.  
  1153. BossGreyBall_SpikeBall_Bounced_Wait:
  1154.         move.b  objoff_41(a0),d0
  1155.         add.b   d0,objoff_3C(a0)
  1156.         jsr (MoveSprite_Circular).l
  1157.         subq.w  #1,$2E(a0)
  1158.         bpl.s   BossGreyBall_SpikeBall_Bounced_Setup
  1159.         move.l  #BossGreyBall_SpikeBall_Bounced_Jump,$34(a0)
  1160.         move.l  #BossGreyBall_SpikeBall_Bounced_Setup2,address(a0)
  1161.         clearRAM3 Pos_objtable_Start, Pos_objtable_End
  1162.         lea ChildObjDat_BossGreyBall_SpikeBall_Bounced_Chain_Trail(pc),a2
  1163.         jsr (CreateChild6_Simple).l
  1164.  
  1165. BossGreyBall_SpikeBall_Bounced_Setup2:
  1166.         jsr (MoveSprite).l
  1167.         jsr (ObjHitFloor_DoRoutine).l
  1168.  
  1169. BossGreyBall_SpikeBall_Bounced_Setup:
  1170.         bsr.w   Obj_ChasingBall_SendPos
  1171.         jmp (Sprite_ChildCheckDeleteTouchXY).l
  1172. ; ---------------------------------------------------------------------------
  1173.  
  1174. BossGreyBall_SpikeBall_Bounced_Jump:
  1175.         move.w  #-$400,y_vel(a0)
  1176.         sfx sfx_SpikeBall,0,0,0
  1177.         move.w  #$14,(Screen_Shaking_Flag).w
  1178.         lea ChildObjDat_BossGreyBall_Spark(pc),a2
  1179.         jmp (CreateChild6_Simple).l
  1180. ; ---------------------------------------------------------------------------
  1181. ; Тень отскакивающего шипастого шара
  1182. ; ---------------------------------------------------------------------------
  1183.  
  1184. ; =============== S U B R O U T I N E =======================================
  1185.  
  1186. Obj_BossGreyBall_SpikeBall_Bounced_Chain_Trail:
  1187.         moveq   #0,d0
  1188.         move.b  subtype(a0),d0
  1189.         lsl.b   #4,d0
  1190.         addi.b  #$24,d0
  1191.         move.b  d0,subtype(a0)
  1192.         lea ObjDat3_BossGreyBall_SpikeBall_Chain(pc),a1
  1193.         jsr (SetUp_ObjAttributes3).l
  1194.         move.l  #+,address(a0)
  1195. +       bsr.w   Obj_ChasingBall_CopyPos
  1196.         btst    #0,(Level_frame_counter+1).w
  1197.         bne.s   BossGreyBall_SpikeBall_Bounced_Chain_Trail_CheckParent
  1198.         jmp (Child_Draw_Sprite).l
  1199. ; ---------------------------------------------------------------------------
  1200.  
  1201. BossGreyBall_SpikeBall_Bounced_Chain_Trail_CheckParent:
  1202.         jmp (Child_CheckParent).l
  1203. ; ---------------------------------------------------------------------------
  1204. ; Выстреливающий шипастый шар
  1205. ; ---------------------------------------------------------------------------
  1206.  
  1207. ; =============== S U B R O U T I N E =======================================
  1208.  
  1209. Obj_BossGreyBall_SpikeBall_Shot:
  1210.         lea ObjDat3_BossGreyBall_SpikeBall(pc),a1
  1211.         jsr (SetUp_ObjAttributes3).l
  1212.         jsr (Find_SonicTails).l
  1213.         move.b  #1,objoff_41(a0)
  1214.         move.b  #64,objoff_3C(a0)
  1215.         tst.w   d0
  1216.         bne.s   +
  1217.         neg.b   objoff_3C(a0)
  1218.         neg.b   objoff_41(a0)
  1219. +       move.b  #44/2,y_radius(a0)
  1220.         move.l  #BossGreyBall_SpikeBall_Shot_Radius,address(a0)
  1221.  
  1222. BossGreyBall_SpikeBall_Shot_Radius:
  1223.         bsr.w   BossGreyBall_CreateFire_2
  1224.         lea (Player_1).w,a2
  1225.         movea.w parent3(a0),a1
  1226.         jsr (CalcObjAngle).l
  1227.         move.b  d0,$3C(a0)
  1228.         jsr (MoveSprite_Circular).l
  1229.         addq.b  #1,objoff_3A(a0)
  1230.         cmpi.b  #48,objoff_3A(a0)
  1231.         bne.w   BossGreyBall_SpikeBall_Shot_Draw
  1232.         sfx sfx_SpikeBall2,0,0,0
  1233.         move.w  #$100,priority(a0)
  1234.         move.l  #BossGreyBall_SpikeBall_Shot_SubtractRadius,address(a0)
  1235.  
  1236. BossGreyBall_SpikeBall_Shot_SubtractRadius:
  1237.         bsr.w   BossGreyBall_CreateFire_2
  1238.         lea (Player_1).w,a2
  1239.         movea.w parent3(a0),a1
  1240.         jsr (CalcObjAngle).l
  1241.         move.b  d0,$3C(a0)
  1242.         jsr (MoveSprite_Circular).l
  1243.         btst    #1,(Level_frame_counter+1).w
  1244.         bne.w   BossGreyBall_SpikeBall_Shot_Draw
  1245.         subq.b  #1,objoff_3A(a0)
  1246.         cmpi.b  #36,objoff_3A(a0)
  1247.         bne.w   BossGreyBall_SpikeBall_Shot_Draw
  1248.         move.w  #$2F,$2E(a0)
  1249.         move.l  #BossGreyBall_SpikeBall_Shot_Warning,address(a0)
  1250.  
  1251. BossGreyBall_SpikeBall_Shot_Warning:
  1252.         bsr.w   BossGreyBall_CreateFire_2
  1253.         lea (Player_1).w,a2
  1254.         movea.w parent3(a0),a1
  1255.         jsr (CalcObjAngle).l
  1256.         move.b  d0,$3C(a0)
  1257.         jsr (MoveSprite_Circular).l
  1258.         subq.w  #1,$2E(a0)
  1259.         bpl.w   BossGreyBall_SpikeBall_Shot_Draw
  1260.         sfx sfx_LaserStart,0,0,0
  1261.         move.w  #$9F,$2E(a0)
  1262.         move.l  #BossGreyBall_SpikeBall_Shot_Wait,address(a0)
  1263.  
  1264. BossGreyBall_SpikeBall_Shot_Wait:
  1265.         btst    #0,(Level_frame_counter+1).w
  1266.         bne.s   +
  1267.         eori.b  #$60,art_tile(a0)
  1268. +       bsr.w   BossGreyBall_CreateFire_2
  1269.         lea (Player_1).w,a2
  1270.         movea.w parent3(a0),a1
  1271.         jsr (CalcObjAngle).l
  1272.         move.b  d0,$3C(a0)
  1273.         jsr (MoveSprite_Circular).l
  1274.         subq.w  #1,$2E(a0)
  1275.         bpl.w   BossGreyBall_SpikeBall_Shot_Draw
  1276.         move.l  #BossGreyBall_SpikeBall_Shot_CheckFloor,address(a0)
  1277.         clearRAM3 Pos_objtable_Start, Pos_objtable_End
  1278.         sfx sfx_Boom,0,0,0
  1279.         ori.b   #$60,art_tile(a0)
  1280.         lea ChildObjDat_BossGreyBall_SpikeBall_Shot_Chain_Trail(pc),a2
  1281.         jsr (CreateChild6_Simple).l
  1282.         lea (Player_1).w,a1
  1283.         move.w  x_pos(a1),d1
  1284.         move.w  y_pos(a1),d2
  1285.         sub.w   x_pos(a0),d1
  1286.         sub.w   y_pos(a0),d2
  1287.         jsr (GetArcTan).l
  1288.         jsr (GetSineCosine).l
  1289.         move.w  #$680,d2
  1290.         muls.w  d2,d1
  1291.         asr.l   #8,d1
  1292.         move.w  d1,x_vel(a0)
  1293.         muls.w  d2,d0
  1294.         asr.l   #8,d0
  1295.         move.w  d0,y_vel(a0)
  1296.  
  1297. BossGreyBall_SpikeBall_Shot_CheckFloor:
  1298.         bsr.w   BossGreyBall_CreateFire_2
  1299.         tst.w   y_vel(a0)
  1300.         bmi.s   BossGreyBall_SpikeBall_Shot_Draw
  1301.         btst    #2,(Level_frame_counter+1).w
  1302.         bne.s   BossGreyBall_SpikeBall_Shot_Draw
  1303.         jsr (ObjCheckFloorDist).l
  1304.         tst.w   d1
  1305.         bpl.s   BossGreyBall_SpikeBall_Shot_Draw
  1306.         add.w   d1,y_pos(a0)
  1307.         neg.w   y_vel(a0)
  1308.         sfx sfx_SpikeBall,0,0,0
  1309.         move.w  #$14,(Screen_Shaking_Flag).w
  1310.         lea ChildObjDat_BossGreyBall_Spark(pc),a2
  1311.         jsr (CreateChild6_Simple).l
  1312.  
  1313. BossGreyBall_SpikeBall_Shot_Draw:
  1314.         jsr (MoveSprite2).l
  1315.         bsr.w   Obj_ChasingBall_SendPos
  1316.         jmp (Sprite_ChildCheckDeleteTouchXY).l
  1317. ; ---------------------------------------------------------------------------
  1318. ; Цепь выстреливающего шипастого шара
  1319. ; ---------------------------------------------------------------------------
  1320.  
  1321. ; =============== S U B R O U T I N E =======================================
  1322.  
  1323. Obj_BossGreyBall_SpikeBall_Shot_Chain_Trail:
  1324.         moveq   #0,d0
  1325.         move.b  subtype(a0),d0
  1326.         lsl.b   #2,d0
  1327.         addi.b  #$14,d0
  1328.         move.b  d0,subtype(a0)
  1329.         lea ObjDat3_BossGreyBall_SpikeBall_Chain(pc),a1
  1330.         jsr (SetUp_ObjAttributes3).l
  1331.         move.l  #+,address(a0)
  1332. +       bsr.w   Obj_ChasingBall_CopyPos
  1333.         movea.w parent3(a0),a1
  1334.         movea.w parent3(a1),a1
  1335.         tst.w   y_vel(a1)
  1336.         bne.w   BossGreyBall_SpikeBall_Bounced_Chain_Trail_CheckParent
  1337.         jmp (Child_Draw_Sprite).l
  1338. ; ---------------------------------------------------------------------------
  1339. ; Дым из босса шара
  1340. ; ---------------------------------------------------------------------------
  1341.  
  1342. ; =============== S U B R O U T I N E =======================================
  1343.  
  1344. Obj_BossGreyBall_Fire:
  1345.         move.w  #1-1,d6
  1346.  
  1347. -       jsr (Create_New_Sprite3).l
  1348.         bne.w   ++
  1349.         move.l  #Obj_BossGreyBall_SpikeBall_Fire_Anim,address(a1)
  1350.         move.l  #Map_BossDEZExplosion,mappings(a1)
  1351.         move.w  #$530,art_tile(a1)
  1352.         move.b  #4,render_flags(a1)
  1353.         move.w  $3C(a0),priority(a1)
  1354.         move.b  #24/2,width_pixels(a1)
  1355.         move.b  #24/2,height_pixels(a1)
  1356.         move.w  x_pos(a0),x_pos(a1)
  1357.         move.w  y_pos(a0),y_pos(a1)
  1358.         jsr (loc_83E90).l
  1359.         jsr (Random_Number).l
  1360.         andi.w  #$FF,d0
  1361.         addi.w  #$200,d0
  1362.         movea.w parent3(a0),a2
  1363.         tst.w   x_vel(a2)
  1364.         bmi.s   +
  1365.         neg.w   d0
  1366. +       move.w  d0,x_vel(a1)
  1367.         jsr (Random_Number).l
  1368.         andi.w  #$FF,d0
  1369.         addi.w  #$200,d0
  1370.         neg.w   d0
  1371.         move.w  d0,y_vel(a1)
  1372.         move.b  #3,anim_frame_timer(a1)
  1373.         dbf d6,-
  1374. +       bra.w   Robotnik_IntroFullExplosion_Delete
  1375. ; ---------------------------------------------------------------------------
  1376. ; Дым из шипастого шара
  1377. ; ---------------------------------------------------------------------------
  1378.  
  1379. ; =============== S U B R O U T I N E =======================================
  1380.  
  1381. Obj_BossGreyBall_SpikeBall_Fire:
  1382.         move.w  #1-1,d6
  1383.  
  1384. -       jsr (Create_New_Sprite3).l
  1385.         bne.s   ++
  1386.         move.l  #Obj_BossGreyBall_SpikeBall_Fire_Anim,address(a1)
  1387.         move.l  #Map_BossDEZExplosion,mappings(a1)
  1388.         move.w  #$8530,art_tile(a1)
  1389.         move.b  #4,render_flags(a1)
  1390.         move.w  #$100,priority(a1)
  1391.         move.b  #24/2,width_pixels(a1)
  1392.         move.b  #24/2,height_pixels(a1)
  1393.         move.w  x_pos(a0),x_pos(a1)
  1394.         move.w  y_pos(a0),y_pos(a1)
  1395.         jsr (Random_Number).l
  1396.         andi.w  #$FF,d0
  1397.         addi.w  #$200,d0
  1398.         movea.w parent3(a0),a2
  1399.         tst.b   objoff_41(a2)
  1400.         bmi.s   +
  1401.         neg.w   d0
  1402. +       move.w  d0,x_vel(a1)
  1403.         jsr (Random_Number).l
  1404.         andi.w  #$FF,d0
  1405.         addi.w  #$200,d0
  1406.         neg.w   d0
  1407.         move.w  d0,y_vel(a1)
  1408.         move.b  #3,anim_frame_timer(a1)
  1409.         dbf d6,-
  1410. +       bra.w   Robotnik_IntroFullExplosion_Delete
  1411. ; ---------------------------------------------------------------------------
  1412.  
  1413. Obj_BossGreyBall_SpikeBall_Fire_Anim:
  1414.         subq.b  #1,anim_frame_timer(a0)
  1415.         bpl.s   +
  1416.         move.b  #3,anim_frame_timer(a0)
  1417.         addq.b  #1,mapping_frame(a0)
  1418.         cmpi.b  #7,mapping_frame(a0)
  1419.         beq.w   Robotnik_IntroFullExplosion_Delete
  1420. +       jsr (MoveSprite2).l
  1421.         jmp (Draw_Sprite).l
  1422. ; ---------------------------------------------------------------------------
  1423. ; Взрыв по радиусу
  1424. ; ---------------------------------------------------------------------------
  1425.  
  1426. ; =============== S U B R O U T I N E =======================================
  1427.  
  1428. Obj_DEZRadiusExplosion:
  1429.         moveq   #0,d2
  1430.         move.w  #8-1,d1
  1431.  
  1432. -       jsr (Create_New_Sprite3).l
  1433.         bne.s   +
  1434.         move.l  #Obj_DEZRadiusExplosion_GetVelocity,(a1)
  1435.         move.l  #Map_BossDEZExplosion,mappings(a1)
  1436.         move.w  #$8530,art_tile(a1)
  1437.         move.b  #4,render_flags(a1)
  1438.         move.w  #$100,priority(a1)
  1439.         move.b  #24/2,width_pixels(a1)
  1440.         move.b  #24/2,height_pixels(a1)
  1441.         move.w  x_pos(a0),x_pos(a1)
  1442.         move.w  y_pos(a0),y_pos(a1)
  1443.         move.b  d2,angle(a1)
  1444.         move.b  #3,anim_frame_timer(a1)
  1445.         addi.w  #$20,d2
  1446.         dbf d1,-
  1447. +       bra.w   Robotnik_IntroFullExplosion_Delete
  1448. ; ---------------------------------------------------------------------------
  1449.  
  1450. Obj_DEZRadiusExplosion_GetVelocity:
  1451.         move.b  angle(a0),d0
  1452.         jsr (GetSineCosine).l
  1453.         move.w  #$600,d2
  1454.         muls.w  d2,d1
  1455.         asr.l   #8,d1
  1456.         move.w  d1,x_vel(a0)
  1457.         muls.w  d2,d0
  1458.         asr.l   #8,d0
  1459.         move.w  d0,y_vel(a0)
  1460.         move.l  #Obj_DEZRadiusExplosion_Anim,address(a0)
  1461.  
  1462. Obj_DEZRadiusExplosion_Anim:
  1463.         subq.b  #1,anim_frame_timer(a0)
  1464.         bpl.s   +
  1465.         move.b  #1,anim_frame_timer(a0)
  1466.         addq.b  #1,mapping_frame(a0)
  1467.         cmpi.b  #7,mapping_frame(a0)
  1468.         beq.w   Robotnik_IntroFullExplosion_Delete
  1469. +       jsr (MoveSprite2).l
  1470.         jmp (Draw_Sprite).l
  1471. ; ---------------------------------------------------------------------------
  1472. ; Супер взрыв по радиусу
  1473. ; ---------------------------------------------------------------------------
  1474.  
  1475. ; =============== S U B R O U T I N E =======================================
  1476.  
  1477. Obj_DEZRadiusSuperExplosion:
  1478.         moveq   #0,d2
  1479.         move.w  #3-1,d1
  1480.  
  1481. -       jsr (Create_New_Sprite3).l
  1482.         bne.s   +
  1483.         move.l  #Obj_DEZRadiusSuperExplosion_GetVelocity,address(a1)
  1484.         move.l  #Map_BossDEZExplosion,mappings(a1)
  1485.         move.w  #$8530,art_tile(a1)
  1486.         move.b  #4,render_flags(a1)
  1487.         move.w  #$100,priority(a1)
  1488.         move.b  #24/2,width_pixels(a1)
  1489.         move.b  #24/2,height_pixels(a1)
  1490.         move.w  x_pos(a0),x_pos(a1)
  1491.         move.w  y_pos(a0),y_pos(a1)
  1492.         move.b  $3C(a0),$3C(a1)
  1493.         move.b  d2,angle(a1)
  1494.         move.w  parent3(a0),parent3(a1)
  1495.         move.b  #$F,anim_frame_timer(a1)
  1496.         addi.w  #$50,d2
  1497.         dbf d1,-
  1498. +       bra.w   Robotnik_IntroFullExplosion_Delete
  1499. ; ---------------------------------------------------------------------------
  1500.  
  1501. Obj_DEZRadiusSuperExplosion_GetVelocity:
  1502.         movea.w parent3(a0),a1
  1503.         move.b  $3C(a1),d0
  1504.         add.b   angle(a0),d0
  1505.         jsr (GetSineCosine).l
  1506.         move.w  #$600,d2
  1507.         muls.w  d2,d1
  1508.         asr.l   #8,d1
  1509.         move.w  d1,x_vel(a0)
  1510.         muls.w  d2,d0
  1511.         asr.l   #8,d0
  1512.         move.w  d0,y_vel(a0)
  1513.         move.l  #Obj_DEZRadiusSuperExplosion_Anim,address(a0)
  1514.  
  1515. Obj_DEZRadiusSuperExplosion_Anim:
  1516.         subq.b  #1,anim_frame_timer(a0)
  1517.         bpl.s   +
  1518.         move.b  #3,anim_frame_timer(a0)
  1519.         addq.b  #1,mapping_frame(a0)
  1520.         cmpi.b  #7,mapping_frame(a0)
  1521.         beq.w   Robotnik_IntroFullExplosion_Delete
  1522. +       jsr (MoveSprite2).l
  1523.         jmp (Draw_Sprite).l
  1524.  
  1525. ; =============== S U B R O U T I N E =======================================
  1526.  
  1527. BossGreyBall_Swing_Setup:
  1528.         move.w  #$100,d0
  1529.         move.w  d0,$3E(a0)
  1530.         move.w  d0,y_vel(a0)
  1531.         move.w  #8,$40(a0)
  1532.         bclr    #0,$38(a0)
  1533.         rts
  1534. ; ---------------------------------------------------------------------------
  1535.  
  1536. BossGreyBall_Swing_Setup2:
  1537.         move.w  #$100,d0
  1538.         move.w  d0,$3A(a0)
  1539.         move.w  d0,x_vel(a0)
  1540.         move.w  #8,$3C(a0)
  1541.         bclr    #3,$38(a0)
  1542.         move.w  (Camera_X_pos).w,d0
  1543.         addi.w  #$A0,d0
  1544.         sub.w   x_pos(a0),d0
  1545.         bgt.s   +
  1546.         neg.w   x_vel(a0)
  1547. +       rts
  1548.  
  1549. ; =============== S U B R O U T I N E =======================================
  1550.  
  1551. BossGreyBall_PalFlash:
  1552.         lea BossGreyBall_PalCycle(pc),a2
  1553.         btst    #5,status(a0)
  1554.         beq.s   +
  1555.         lea BossGreyBall_PalCycle2(pc),a2
  1556. +       lea (a2,d0.w),a2
  1557.         lea BossGreyBall_PalRAM(pc),a1
  1558.         jmp (CopyWordData_7).l
  1559. ; ---------------------------------------------------------------------------
  1560.  
  1561. BossGreyBall_PalRAM:
  1562.         dc.w Normal_palette_line_4+4
  1563.         dc.w Normal_palette_line_4+6
  1564.         dc.w Normal_palette_line_4+8
  1565.         dc.w Normal_palette_line_4+$A
  1566.         dc.w Normal_palette_line_4+$C
  1567.         dc.w Normal_palette_line_4+$E
  1568.         dc.w Normal_palette_line_4+$1E
  1569. BossGreyBall_PalCycle:
  1570.         dc.w $424, $644, $866, $A88, $CAA, $ECC, $222   ; Normal
  1571.         dc.w $42, $64, $86, $A8, $CA, $EC, $22  ; Flash
  1572. BossGreyBall_PalCycle2:
  1573.         dc.w $2E, $4E, $6E, $8E, $AE, $CE, $2E  ; Normal
  1574.         dc.w $42, $64, $86, $A8, $CA, $EC, $22  ; Flash
  1575.  
  1576. ; =============== S U B R O U T I N E =======================================
  1577.  
  1578. ObjDat3_BossGreyBall:
  1579.         dc.l Map_BossGreyBall
  1580.         dc.w $E170
  1581.         dc.w $200
  1582.         dc.b 64/2
  1583.         dc.b 64/2
  1584.         dc.b 0
  1585.         dc.b $F
  1586. ObjDat3_BossGreyBall_SpikeBall:
  1587.         dc.w $280
  1588.         dc.b 48/2
  1589.         dc.b 48/2
  1590.         dc.b 5
  1591.         dc.b $81
  1592. ObjDat3_BossGreyBall_SpikeBall_Chain:
  1593.         dc.w $300
  1594.         dc.b 16/2
  1595.         dc.b 16/2
  1596.         dc.b 4
  1597.         dc.b 0
  1598. ObjDat3_BossGreyBall_Face:
  1599.         dc.w $180
  1600.         dc.b 48/2
  1601.         dc.b 16/2
  1602.         dc.b 2
  1603.         dc.b 0
  1604. ObjDat3_BossGreyBall_Designator:
  1605.         dc.w $100
  1606.         dc.b 32/2
  1607.         dc.b 32/2
  1608.         dc.b $B
  1609.         dc.b 0
  1610. ObjDat3_BossGreyBall_Spark:
  1611.         dc.w $80
  1612.         dc.b 16/2
  1613.         dc.b 16/2
  1614.         dc.b $A
  1615.         dc.b 0
  1616. ChildObjDat_BossGreyBall_IntroClone:
  1617.         dc.w 2-1
  1618.         dc.l Obj_BossGreyBall_IntroClone
  1619. ChildObjDat_BossGreyBall_Face:
  1620.         dc.w 1-1
  1621.         dc.l Obj_BossGreyBall_Face
  1622. ChildObjDat_BossGreyBall_Designator:
  1623.         dc.w 2-1
  1624.         dc.l Obj_BossGreyBall_Designator
  1625.         dc.b -32, -50
  1626.         dc.l Obj_BossGreyBall_Designator
  1627.         dc.b 32, -50
  1628. ChildObjDat_BossGreyBall_SpikeBall_Explosion:
  1629.         dc.w 1-1
  1630.         dc.l Obj_BossGreyBall_SpikeBall_Explosion
  1631. ChildObjDat_BossGreyBall_SpikeBall:
  1632.         dc.w 1-1
  1633.         dc.l Obj_BossGreyBall_SpikeBall
  1634. ChildObjDat_BossGreyBall_SpikeBall_Chain:
  1635.         dc.w 7-1
  1636.         dc.l Obj_BossGreyBall_SpikeBall_Chain
  1637. ChildObjDat_BossGreyBall_Splinter:
  1638.         dc.w 4-1
  1639.         dc.l Obj_BossGreyBall_Splinter
  1640. ChildObjDat_BossGreyBall_SpikeBall_Fire:
  1641.         dc.w 1-1
  1642.         dc.l Obj_BossGreyBall_SpikeBall_Fire
  1643. ChildObjDat_BossGreyBall_SpikeBall_Bounced:
  1644.         dc.w 1-1
  1645.         dc.l Obj_BossGreyBall_SpikeBall_Bounced
  1646. ChildObjDat_BossGreyBall_SpikeBall_Bounced_Chain_Trail:
  1647.         dc.w 6-1
  1648.         dc.l Obj_BossGreyBall_SpikeBall_Bounced_Chain_Trail
  1649. ChildObjDat_BossGreyBall_SpikeBall_Shot:
  1650.         dc.w 1-1
  1651.         dc.l Obj_BossGreyBall_SpikeBall_Shot
  1652. ChildObjDat_BossGreyBall_SpikeBall_Shot_Chain_Trail:
  1653.         dc.w 8-1
  1654.         dc.l Obj_BossGreyBall_SpikeBall_Shot_Chain_Trail
  1655. ChildObjDat_BossGreyBall_Spark:
  1656.         dc.w 4-1
  1657.         dc.l Obj_BossGreyBall_Spark
  1658. ChildObjDat_DEZRadiusExplosion:
  1659.         dc.w 1-1
  1660.         dc.l Obj_DEZRadiusExplosion
  1661. ChildObjDat_BossGreyBall_Fire:
  1662.         dc.w 1-1
  1663.         dc.l Obj_BossGreyBall_Fire
  1664. ChildObjDat_DEZRadiusSuperExplosion:
  1665.         dc.w 1-1
  1666.         dc.l Obj_DEZRadiusSuperExplosion
  1667. ; ---------------------------------------------------------------------------
  1668.  
  1669.         include "Objects/Boss Ball/Object Data/Map - Boss Ball.asm"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement