Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
rubberduckycooly
GitHub Repository: rubberduckycooly/Sonic-CD-2011-Script-Decompilation
Path: blob/main/Scripts/Secrets/SecretImages.txt
1319 views
1
//---------------Sonic CD Secret Images Script----------------//
2
//--------Scripted by Christian Whitehead 'The Taxman'--------//
3
//-------Unpacked By Rubberduckycooly's Script Unpacker-------//
4
5
// Aliases
6
#alias Object.Value0 : Object.Timer
7
8
// States
9
#alias 0 : SECRETIMAGES_SETUP
10
#alias 1 : SECRETIMAGES_FADE_IN
11
#alias 2 : SECRETIMAGES_CONTROL_DELAY
12
#alias 3 : SECRETIMAGES_CONTROL_CHECK
13
#alias 4 : SECRETIMAGES_EXIT
14
15
// Presentation Stages
16
#alias 1 : STAGE_P_MENU
17
18
// Game Mode Aliases
19
#alias 0 : MODE_NOSAVE
20
21
22
sub ObjectMain
23
switch Object.State
24
case SECRETIMAGES_SETUP
25
if Object.Timer < 8
26
// Yield on the black screen for a moment
27
28
Object.Timer++
29
else
30
// Transition to the next state now!
31
32
Object.Timer = 288
33
Object.State++
34
end if
35
36
SetScreenFade(0, 0, 0, 255)
37
break
38
39
case SECRETIMAGES_FADE_IN
40
if Object.Timer > 0
41
Object.Timer -= 16
42
else
43
PlayMusic(Options.Soundtrack)
44
Object.State++
45
end if
46
47
SetScreenFade(0, 0, 0, Object.Timer)
48
break
49
50
case SECRETIMAGES_CONTROL_DELAY
51
if Object.Timer < 60
52
Object.Timer++
53
else
54
Object.Timer = 0
55
Object.State++
56
end if
57
break
58
59
case SECRETIMAGES_CONTROL_CHECK
60
if KeyPress[0].ButtonA == true
61
Object.State++
62
end if
63
64
if KeyPress[0].ButtonB == true
65
Object.State++
66
end if
67
68
if KeyPress[0].ButtonC == true
69
Object.State++
70
end if
71
72
if KeyPress[0].Start == true
73
Object.State++
74
end if
75
76
CheckTouchRect(0, 0, Screen.XSize, Screen.YSize)
77
if CheckResult > -1
78
Object.State++
79
end if
80
break
81
82
case SECRETIMAGES_EXIT
83
if Object.Timer < 288
84
Object.Timer += 8
85
Music.Volume -= 5
86
else
87
StopMusic()
88
Options.GameMode = MODE_NOSAVE
89
Stage.ActiveList = PRESENTATION_STAGE
90
Stage.ListPos = STAGE_P_MENU
91
LoadStage()
92
end if
93
94
TempValue0 = Object.Timer
95
if TempValue0 > 255
96
TempValue0 = 255
97
end if
98
SetScreenFade(0, 0, 0, TempValue0)
99
break
100
end switch
101
end sub
102
103
104
sub ObjectDraw
105
switch Object.PropertyValue
106
case 0 // Batman Parody
107
DrawRect(0, 0, Screen.XSize, Screen.YSize, 0, 0, 0, 255)
108
DrawSpriteScreenXY(0, Screen.CenterX, Screen.CenterY)
109
break
110
111
case 1 // Fun is Infinite
112
DrawRect(0, 0, Screen.XSize, Screen.YSize, 0, 0, 0, 255)
113
DrawSpriteScreenXY(1, Screen.CenterX, Screen.CenterY)
114
break
115
116
case 2 // You Are Cool
117
DrawRect(0, 0, Screen.XSize, Screen.YSize, 238, 238, 204, 255)
118
DrawSpriteScreenXY(2, Screen.CenterX, Screen.CenterY)
119
break
120
121
case 3 // Fastest DJ Alive
122
DrawRect(0, 0, Screen.XSize, Screen.YSize, 0, 0, 0, 255)
123
DrawSpriteScreenXY(3, Screen.CenterX, Screen.CenterY)
124
break
125
126
case 4 // See You Next Game
127
DrawRect(0, 0, Screen.CenterX, Screen.YSize, 0, 34, 221, 255)
128
DrawRect(Screen.CenterX, 0, Screen.CenterX, Screen.YSize, 0, 34, 204, 255)
129
DrawSpriteScreenXY(4, Screen.CenterX, Screen.CenterY)
130
DrawSpriteScreenXY(5, Screen.CenterX, Screen.CenterY)
131
break
132
end switch
133
end sub
134
135
136
sub ObjectStartup
137
LoadSpriteSheet("Secrets/SecretImages.gif")
138
139
SpriteFrame(-160, -112, 320, 224, 0, 0) // #0 - Batman Parody
140
SpriteFrame(-160, -112, 320, 224, 0, 225) // #1 - Fun is Infinite
141
SpriteFrame(-160, -112, 320, 224, 0, 450) // #2 - You Are Cool
142
SpriteFrame(-160, -112, 320, 224, 0, 675) // #3 - Fastest DJ Alive
143
SpriteFrame(-160, -112, 160, 224, 321, 0) // #4 - See You Next Game first half
144
SpriteFrame(0, -112, 160, 224, 321, 225) // #5 - See You Next Game second half
145
end sub
146
147
148
// ========================
149
// Editor Subs
150
// ========================
151
152
sub RSDKEdit
153
if Editor.ReturnVariable == true
154
switch Editor.VariableID
155
case EDIT_VAR_PROPVAL // Property Value
156
CheckResult = Object.PropertyValue
157
break
158
case 0 // type
159
CheckResult = Object.PropertyValue
160
break
161
end switch
162
else
163
switch Editor.VariableID
164
case EDIT_VAR_PROPVAL // Property Value
165
Object.PropertyValue = Editor.VariableValue
166
break
167
case 0 // type
168
Object.PropertyValue = Editor.VariableValue
169
break
170
end switch
171
end if
172
end sub
173
174
175
sub RSDKDraw
176
switch Object.PropertyValue
177
case 4
178
DrawSprite(5)
179
default
180
DrawSprite(Object.PropertyValue)
181
break
182
end switch
183
end sub
184
185
186
sub RSDKLoad
187
LoadSpriteSheet("Secrets/SecretImages.gif")
188
SpriteFrame(-160, -112, 320, 224, 0, 0) // #0 - Batman Parody
189
SpriteFrame(-160, -112, 320, 224, 0, 225) // #1 - Fun is Infinite
190
SpriteFrame(-160, -112, 320, 224, 0, 450) // #2 - You Are Cool
191
SpriteFrame(-160, -112, 320, 224, 0, 675) // #3 - Fastest DJ Alive
192
SpriteFrame(-160, -112, 160, 224, 321, 0) // #4 - See You Next Game first half
193
SpriteFrame(0, -112, 160, 224, 321, 225) // #5 - See You Next Game second half
194
195
// note - this object isn't normally placed in a scene normally, it's spawned via the Sound Test object when needed instead
196
AddEditorVariable("frame")
197
SetActiveVariable("frame")
198
AddEnumVariable("Batman Parody", 0)
199
AddEnumVariable("Fun is Infinite", 1)
200
AddEnumVariable("You Are Cool", 2)
201
AddEnumVariable("Fastest DJ Alive", 3)
202
AddEnumVariable("See You Next Game", 4)
203
end sub
204
205