Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
rubberduckycooly
GitHub Repository: rubberduckycooly/Sonic-CD-2011-Script-Decompilation
Path: blob/main/Scripts/Secrets/TailsUnlock.txt
1319 views
1
//----------------Sonic CD Tails Unlock 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 : TAILSUNLOCK_SETUP
10
#alias 1 : TAILSUNLOCK_FADE_IN
11
#alias 2 : TAILSUNLOCK_CONTROL_DELAY
12
#alias 3 : TAILSUNLOCK_CONTROL_CHECK
13
#alias 4 : TAILSUNLOCK_EXIT
14
15
// Stage SFX
16
#alias 41 : SFX_S_EVENT
17
18
// Presentation Stage
19
#alias 1 : STAGE_P_MENU
20
21
// Engine callbacks
22
#alias 1 : ENGINE_MAINGAME
23
#alias 8 : ENGINE_WAIT
24
25
26
sub ObjectMain
27
switch Object.State
28
case TAILSUNLOCK_SETUP
29
if Object.Timer < 16
30
// Yield on the black screen for a few moments
31
Object.Timer++
32
else
33
if Stage.DebugMode == false
34
// Set the All Stages Clear Achievement
35
SetAchievement(7, 100)
36
end if
37
38
Object.Timer = 288
39
Object.State++
40
end if
41
42
// Solid Black screen
43
SetScreenFade(0, 0, 0, 255)
44
break
45
46
case TAILSUNLOCK_FADE_IN
47
if Object.Timer > 0
48
Object.Timer -= 8
49
else
50
// Fully faded in now, play the special SFX
51
PlayStageSfx(SFX_S_EVENT, false)
52
53
Object.State++
54
end if
55
56
SetScreenFade(0, 0, 0, Object.Timer)
57
break
58
59
case TAILSUNLOCK_CONTROL_DELAY
60
if Object.Timer < 60
61
Object.Timer++
62
else
63
Object.Timer = 0
64
Object.State++
65
end if
66
break
67
68
case TAILSUNLOCK_CONTROL_CHECK
69
if KeyPress[0].ButtonA == true
70
Object.State++
71
end if
72
73
if KeyPress[0].ButtonB == true
74
Object.State++
75
end if
76
77
if KeyPress[0].ButtonC == true
78
Object.State++
79
end if
80
81
if KeyPress[0].Start == true
82
Object.State++
83
end if
84
85
CheckTouchRect(0, 0, Screen.XSize, Screen.YSize)
86
if CheckResult > -1
87
Object.State++
88
end if
89
90
if Object.Timer < 300
91
Object.Timer++
92
else
93
Object.Timer = 0
94
Object.State = TAILSUNLOCK_EXIT
95
end if
96
break
97
98
case TAILSUNLOCK_EXIT
99
if Object.Timer < 288
100
// Fade the screen out
101
Object.Timer += 8
102
else
103
#platform: Use_Origins
104
Engine.State = ENGINE_WAIT
105
#endplatform
106
107
#platform: Use_Decomp
108
// Actually can we not softlock the game thanks
109
if Engine.State == ENGINE_WAIT
110
Engine.State = ENGINE_MAINGAME
111
Stage.ActiveList = PRESENTATION_STAGE
112
Stage.ListPos = STAGE_P_MENU
113
LoadStage()
114
end if
115
#endplatform
116
117
#platform: Use_Standalone
118
// The Player's looked enough at the screen by now, send them back to the Menu
119
Stage.ActiveList = PRESENTATION_STAGE
120
Stage.ListPos = STAGE_P_MENU
121
LoadStage()
122
#endplatform
123
end if
124
125
TempValue0 = Object.Timer
126
if TempValue0 > 255
127
TempValue0 = 255
128
end if
129
SetScreenFade(0, 0, 0, TempValue0)
130
break
131
132
end switch
133
end sub
134
135
136
sub ObjectDraw
137
138
// The scene doesn't have a background, so draw a black rectangle one here
139
DrawRect(0, 0, Screen.XSize, Screen.YSize, 0, 0, 0, 255)
140
141
// And then draw the actual See You Next Game sprite
142
DrawSpriteScreenXY(0, Screen.CenterX, Screen.CenterY)
143
144
end sub
145
146
147
sub ObjectStartup
148
LoadSpriteSheet("Secrets/SecretImages.gif")
149
150
SpriteFrame(-117, -36, 234, 64, 0, 900) // #0 - See You Next Game
151
end sub
152
153
154
// ========================
155
// Editor Subs
156
// ========================
157
158
sub RSDKDraw
159
DrawSprite(0)
160
end sub
161
162
163
sub RSDKLoad
164
LoadSpriteSheet("Secrets/SecretImages.gif")
165
SpriteFrame(-117, -36, 234, 64, 0, 900) // #0 - See You Next Game
166
167
SetVariableAlias(ALIAS_VAR_PROPVAL, "unused")
168
end sub
169
170