Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
rubberduckycooly
GitHub Repository: rubberduckycooly/Sonic-CD-2011-Script-Decompilation
Path: blob/main/Scripts/Secrets/SecretImages2.txt
1319 views
1
//---------------Sonic CD Secret Images 2 Script--------------//
2
//--------Scripted by Christian Whitehead 'The Taxman'--------//
3
//-------Unpacked By Rubberduckycooly's Script Unpacker-------//
4
5
// Aliases
6
#alias Object.Value0 : Object.Timer // Also used for fading
7
8
// States
9
#alias 0 : SECRETIMAGES2_SETUP
10
#alias 1 : SECRETIMAGES2_FADE_IN
11
#alias 2 : SECRETIMAGES2_CONTROL_DELAY
12
#alias 3 : SECRETIMAGES2_CONTROL_CHECK
13
#alias 4 : SECRETIMAGES2_EXIT
14
15
// Presentation Stage
16
#alias 3 : STAGE_P_LEVELSELECT
17
18
// Game Mode Aliases
19
#alias 0 : MODE_NOSAVE
20
21
22
sub ObjectMain
23
switch Object.State
24
case SECRETIMAGES2_SETUP
25
if Object.Timer < 8
26
Object.Timer++
27
else
28
Object.Timer = 288
29
SetActivePalette(1, 0, Screen.YSize)
30
Object.State++
31
end if
32
SetScreenFade(0, 0, 0, 255)
33
break
34
35
case SECRETIMAGES2_FADE_IN
36
if Object.Timer > 0
37
Object.Timer -= 16
38
else
39
PlayMusic(Options.Soundtrack)
40
Object.State++
41
end if
42
SetScreenFade(0, 0, 0, Object.Timer)
43
break
44
45
case SECRETIMAGES2_CONTROL_DELAY
46
if Object.Timer < 60
47
Object.Timer++
48
else
49
Object.Timer = 0
50
Object.State++
51
end if
52
break
53
54
case SECRETIMAGES2_CONTROL_CHECK
55
if KeyPress[0].ButtonA == true
56
Object.State++
57
end if
58
59
if KeyPress[0].ButtonB == true
60
Object.State++
61
end if
62
63
if KeyPress[0].ButtonC == true
64
Object.State++
65
end if
66
67
if KeyPress[0].Start == true
68
Object.State++
69
end if
70
71
CheckTouchRect(0, 0, Screen.XSize, Screen.YSize)
72
if CheckResult > -1
73
Object.State++
74
end if
75
break
76
77
case SECRETIMAGES2_EXIT
78
if Object.Timer < 288
79
Object.Timer += 8
80
Music.Volume -= 5
81
else
82
SetActivePalette(0, 0, Screen.YSize)
83
StopMusic()
84
Options.GameMode = MODE_NOSAVE
85
Stage.ActiveList = PRESENTATION_STAGE
86
Stage.ListPos = STAGE_P_LEVELSELECT
87
LoadStage()
88
end if
89
90
TempValue0 = Object.Timer
91
if TempValue0 > 255
92
TempValue0 = 255
93
end if
94
SetScreenFade(0, 0, 0, TempValue0)
95
break
96
97
end switch
98
end sub
99
100
101
sub ObjectDraw
102
DrawRect(0, 0, Screen.XSize, Screen.YSize, 224, 224, 224, 255)
103
DrawSpriteScreenXY(0, Screen.CenterX, Screen.CenterY)
104
end sub
105
106
107
sub ObjectStartup
108
LoadSpriteSheet("Secrets/DD_R2.gif")
109
SpriteFrame(-160, -120, 320, 240, 0, 0) // #0 - Desert Dazzle
110
LoadPalette("DDZ_Pal.act", 1, 0, 0, 256)
111
end sub
112
113
114
// ========================
115
// Editor Subs
116
// ========================
117
118
sub RSDKDraw
119
DrawSprite(0)
120
end sub
121
122
123
sub RSDKLoad
124
LoadSpriteSheet("Secrets/DD_R2.gif")
125
SpriteFrame(-160, -120, 320, 240, 0, 0) // #0 - Desert Dazzle
126
127
SetVariableAlias(ALIAS_VAR_PROPVAL, "unused")
128
end sub
129
130