Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; ---------------------------------------------------------------------------
- ; Object 60 - Orbinaut enemy (LZ, SLZ, SBZ)
- ; ---------------------------------------------------------------------------
- ; Dynamic object variables
- orb_count = objoff_39
- orb_rotation = objoff_40
- ; =============== S U B R O U T I N E =======================================
- Obj_Orbinaut:
- move.w #-$40,x_vel(a0) ; move orbinaut to the left
- btst #0,status(a0) ; is orbinaut facing left??
- beq.s .rot ; if not, branch
- neg.w x_vel(a0) ; move orbinaut to the right
- .rot
- moveq #1,d0
- btst #0,status(a0) ; is orbinaut facing left?
- beq.s .noflip ; if not, branch
- neg.w d0
- .noflip:
- move.b d0,orb_rotation(a0)
- ; mapping
- lea ObjDat_Orbinaut(pc),a1 ; LZ specific code
- jsr (SetUp_ObjAttributes).w
- clr.b routine(a0)
- ; check level
- cmpi.b #id_SBZ,(Current_zone).w ; check if level is SBZ
- bne.s .notscrap
- move.w #$429,art_tile(a0) ; SBZ specific code
- .notscrap
- cmpi.b #id_SLZ,(Current_zone).w ; check if level is SLZ
- bne.s .notslz
- move.w #$255B,art_tile(a0) ; SLZ specific code
- .notslz
- ; set
- move.l #.chksonic,address(a0)
- tst.b subtype(a0)
- beq.s .load
- move.l #.move,address(a0)
- .load
- lea ChildObjDat6_Orbinaut_Orb(pc),a2
- move.b 1(a2),orb_count(a0) ; set number of orbs
- jmp (CreateChild6_Simple).w
- ; ---------------------------------------------------------------------------
- .chksonic
- jsr (Find_SonicTails).w
- cmpi.w #160,d2 ; is Sonic within $A0 pixels of orbinaut?
- bhs.s .draw ; if not, branch
- cmpi.w #80,d3 ; is Sonic within $50 pixels of orbinaut?
- bhs.s .draw ; if not, branch
- tst.w (Debug_placement_mode).w ; is debug mode on?
- bne.s .draw ; if yes, branch
- addq.b #1,anim(a0) ; use "angry" animation
- move.l #.draw,address(a0)
- bra.s .draw
- ; ---------------------------------------------------------------------------
- .move
- jsr (MoveSprite2).w
- .draw
- lea Ani_Orb(pc),a1
- jsr (AnimateSprite_Reverse).w
- jmp (Sprite_CheckDeleteTouch).w
- ; ---------------------------------------------------------------------------
- ; Orbinaut enemy (Orb)
- ; ---------------------------------------------------------------------------
- ; Dynamic object variables
- orbo_radius = objoff_3A
- orbo_angle = objoff_3C
- ; =============== S U B R O U T I N E =======================================
- Obj_Orbinaut_Orb:
- ; set pos
- moveq #0,d0
- move.b subtype(a0),d0
- lsl.b #5,d0
- move.b d0,orbo_angle(a0)
- ; mapping
- lea ObjDat3_Orbinaut_Orb(pc),a1
- jsr (SetUp_ObjAttributes3).w
- clr.b routine(a0)
- move.b #4,orbo_radius(a0)
- move.l #.main,address(a0)
- .main
- movea.w parent3(a0),a1
- cmpi.b #2,mapping_frame(a1) ; is orbinaut angry?
- bne.s .circle ; if not, branch
- tst.b orbo_angle(a0) ; is spikeorb directly under the orbinaut?
- bne.s .circle ; if not, branch
- move.l #.move,address(a0)
- subq.b #1,orb_count(a1)
- bpl.s .fire
- move.l #Obj_Orbinaut.move,address(a1)
- .fire
- move.w #-$200,x_vel(a0) ; move orb to the left (quickly)
- btst #0,status(a1)
- beq.s .move
- neg.w x_vel(a0)
- .move
- jsr (MoveSprite2).w
- jmp (Sprite_CheckDeleteTouchXY).w
- ; ---------------------------------------------------------------------------
- .circle
- move.b orb_rotation(a1),d0
- sub.b d0,orbo_angle(a0)
- move.b orbo_radius(a0),d2
- jsr (MoveSprite_CircularSimple).w
- jmp (Child_DrawTouch_Sprite).w
- ; =============== S U B R O U T I N E =======================================
- ObjDat_Orbinaut: subObjData Map_Orb, $55B, $200, 24/2, 24/2, 0, $B
- ObjDat3_Orbinaut_Orb: subObjData3 $200, 16/2, 16/2, 3, $18|$80
- ChildObjDat6_Orbinaut_Orb:
- dc.w 4-1
- dc.l Obj_Orbinaut_Orb
- ; ---------------------------------------------------------------------------
- include "Objects/Orbinaut/Object Data/Anim - Orbinaut.asm"
- include "Objects/Orbinaut/Object Data/Map - Orbinaut.asm"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement