Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
rubberduckycooly
GitHub Repository: rubberduckycooly/Sonic-CD-2011-Script-Decompilation
Path: blob/main/Scripts/Mission/Boss_Bumper2.txt
1319 views
1
//----------------Sonic CD Boss Bumper 2 Script---------------//
2
//--------Scripted by Christian Whitehead 'The Taxman'--------//
3
//-------Unpacked By Rubberduckycooly's Script Unpacker-------//
4
//---------Used on Mission "M099 - Eggman: Speed Up"----------//
5
6
// Aliases
7
#alias Object.Value0 : Object.ArmEntity
8
#alias Object.Value2 : Object.XOffSet
9
#alias Object.Value5 : Object.YOffSet
10
11
// Arm Aliases
12
#alias Object.Frame : Arm.Frame
13
#alias Object.XPos : Arm.XPos
14
#alias Object.YPos : Arm.YPos
15
16
// States
17
#alias 0 : BOSSBUMPER2_SETUP
18
#alias 1 : BOSSBUMPER2_IDLE
19
#alias 2 : BOSSBUMPER2_DESTROYED
20
21
// Global SFX
22
#alias 11 : SFX_G_SPRING
23
24
// Priority
25
#alias 0 : PRIORITY_BOUNDS
26
27
28
sub ObjectMain
29
switch Object.State
30
case BOSSBUMPER2_SETUP
31
Object.State = BOSSBUMPER2_IDLE
32
// Fall-Through
33
case BOSSBUMPER2_IDLE
34
ArrayPos0 = Object.ArmEntity
35
Object.XPos = Arm[ArrayPos0].XPos
36
Object.XPos -= 0x130000
37
Object.YPos = Arm[ArrayPos0].YPos
38
if Arm[ArrayPos0].Frame != 0
39
if Arm[ArrayPos0].Frame == 1
40
Object.XPos += 0x80000
41
else
42
Object.XPos += 0x100000
43
end if
44
end if
45
break
46
47
case BOSSBUMPER2_DESTROYED
48
Object.XOffSet -= 0x500
49
Object.XPos += Object.XOffSet
50
51
Object.YOffSet += 0x1800
52
Object.YPos += Object.YOffSet
53
54
if Object.OutOfBounds == true
55
Object.Type = TypeName[Blank Object]
56
Object.Priority = PRIORITY_BOUNDS
57
end if
58
break
59
end switch
60
end sub
61
62
63
sub ObjectPlayerInteraction
64
if Object.State < BOSSBUMPER2_DESTROYED
65
if Player.Animation != ANI_HURT
66
ArrayPos0 = Object.ArmEntity
67
68
if Arm[ArrayPos0].Frame == 0
69
PlayerObjectCollision(C_TOUCH, -10, -16, 14, 16)
70
if CheckResult == true
71
72
Player.Speed = -0x40000
73
Player.XVelocity = -0x40000
74
75
if Object.Frame == 0
76
PlaySfx(SFX_G_SPRING, false)
77
end if
78
Object.Frame = 2
79
80
end if
81
end if
82
end if
83
end if
84
end sub
85
86
87
sub ObjectDraw
88
DrawSprite(Object.Frame)
89
90
if Object.Frame > 0
91
Object.Frame--
92
end if
93
end sub
94
95
96
sub ObjectStartup
97
LoadSpriteSheet("R1/Objects3.gif")
98
99
SpriteFrame(-14, -16, 24, 32, 99, 26) // #0 - EGG-HVC-001 Bumper
100
SpriteFrame(-18, -16, 24, 32, 99, 26) // #1 - EGG-HVC-001 Bumper (different offset)
101
SpriteFrame(-18, -16, 24, 32, 99, 26) // #2 - EGG-HVC-001 Bumper (same offset as frame 1, here to pad out animation length)
102
end sub
103
104
105
// ========================
106
// Editor Subs
107
// ========================
108
109
sub RSDKDraw
110
DrawSprite(0)
111
end sub
112
113
114
sub RSDKLoad
115
LoadSpriteSheet("R1/Objects3.gif")
116
SpriteFrame(-14, -16, 24, 32, 99, 26) // #0 - EGG-HVC-001 Bumper
117
118
SetVariableAlias(ALIAS_VAR_PROPVAL, "unused")
119
end sub
120
121
122
123