Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
rubberduckycooly
GitHub Repository: rubberduckycooly/Sonic-CD-2011-Script-Decompilation
Path: blob/main/Scripts/TAttack/SLargeIcon.txt
1319 views
1
//-------------Sonic CD Special Large Icon Script-------------//
2
//--------Scripted by Christian Whitehead 'The Taxman'--------//
3
//-------Unpacked By Rubberduckycooly's Script Unpacker-------//
4
5
// Aliases
6
#alias Object.PropertyValue : Object.Portrait
7
8
// Menu Control Aliases
9
#alias Object[0].Value0 : MenuControl.Timer
10
#alias Object[0].Value5 : MenuControl.SMCurrentButton
11
#alias Object[0].State : MenuControl.State
12
13
// States
14
#alias 0 : SLARGEICON_BLANK
15
#alias 1 : SLARGEICON_ENTER_SCREEN
16
#alias 2 : SLARGEICON_LEAVE_SCREEN
17
18
// Menu Control States
19
// *SM = Sub Menu
20
#alias 7 : MENUCONTROL_SM_CONTROLS
21
#alias 10 : MENUCONTROL_SM_CONFIRMED
22
#alias 11 : MENUCONTROL_SM_LOAD_LEVEL
23
#alias 13 : MENUCONTROL_SM_COMFIRMED_LEAVE
24
25
// Property Values
26
#alias 0 : SPECIAL_STAGE_1_LARGE_ICON
27
#alias 1 : SPECIAL_STAGE_2_LARGE_ICON
28
#alias 2 : SPECIAL_STAGE_3_LARGE_ICON
29
#alias 3 : SPECIAL_STAGE_4_LARGE_ICON
30
#alias 4 : SPECIAL_STAGE_5_LARGE_ICON
31
#alias 5 : SPECIAL_STAGE_6_LARGE_ICON
32
#alias 6 : SPECIAL_STAGE_7_LARGE_ICON
33
34
35
sub ObjectMain
36
switch Object.State
37
case SLARGEICON_BLANK
38
break
39
40
case SLARGEICON_ENTER_SCREEN
41
TempValue0 = Screen.CenterX
42
TempValue0 -= 72
43
TempValue0 <<= 16
44
if Object.XPos < TempValue0
45
Object.XPos += 0x100000
46
if Object.XPos > TempValue0
47
Object.XPos = TempValue0
48
end if
49
else
50
Object.State = SLARGEICON_BLANK
51
end if
52
break
53
54
case SLARGEICON_LEAVE_SCREEN
55
if Object.XPos > -0x480000
56
Object.XPos -= 0x100000
57
if Object.XPos < -0x480000
58
Object.XPos = -0x480000
59
end if
60
else
61
Object.State = SLARGEICON_BLANK
62
end if
63
break
64
65
end switch
66
end sub
67
68
69
sub ObjectDraw
70
DrawSprite(8)
71
DrawSprite(Object.Portrait)
72
TempValue0 = Screen.CenterX
73
TempValue0 -= 72
74
TempValue0 <<= 16
75
TempValue0 -= Object.XPos
76
TempValue0 >>= 16
77
TempValue0 += Screen.CenterX
78
TempValue0 += 20
79
TempValue1 = TempValue0
80
TempValue1 += 68
81
#platform: Mobile
82
switch MenuControl.State
83
default
84
DrawSprite(9)
85
DrawSpriteScreenXY(13, TempValue1, 11)
86
break
87
88
case MENUCONTROL_SM_CONTROLS
89
switch MenuControl.SMCurrentButton
90
default
91
DrawSprite(9)
92
DrawSpriteScreenXY(13, TempValue1, 11)
93
break
94
95
case 0
96
DrawSprite(10)
97
DrawSpriteScreenXY(13, TempValue1, 11)
98
break
99
100
case 1
101
DrawSprite(9)
102
DrawSpriteScreenXY(13, TempValue1, 11)
103
break
104
105
case 2
106
DrawSprite(9)
107
DrawSpriteScreenXY(14, TempValue1, 11)
108
break
109
110
end switch
111
break
112
113
case MENUCONTROL_SM_CONFIRMED
114
TempValue2 = MenuControl.Timer
115
TempValue2 &= 3
116
TempValue2 >>= 1
117
if TempValue2 == 0
118
DrawSpriteScreenXY(14, TempValue1, 11)
119
else
120
DrawSpriteScreenXY(13, TempValue1, 11)
121
end if
122
DrawSprite(9)
123
break
124
125
case MENUCONTROL_SM_LOAD_LEVEL
126
DrawSprite(9)
127
DrawSpriteScreenXY(14, TempValue1, 11)
128
break
129
130
case MENUCONTROL_SM_COMFIRMED_LEAVE
131
TempValue2 = MenuControl.Timer
132
TempValue2 &= 3
133
TempValue2 >>= 1
134
if TempValue2 == 0
135
DrawSprite(10)
136
else
137
DrawSprite(9)
138
end if
139
DrawSpriteScreenXY(13, TempValue1, 11)
140
break
141
142
end switch
143
#endplatform
144
end sub
145
146
147
sub ObjectStartup
148
LoadSpriteSheet("TAttack/TimeAttack.gif")
149
150
SpriteFrame(-64, -72, 128, 144, 0, 288) // #0 - Special Stage 1 Icon
151
SpriteFrame(-64, -72, 128, 144, 128, 288) // #1 - Special Stage 2 Icon
152
SpriteFrame(-64, -72, 128, 144, 256, 288) // #2 - Special Stage 3 Icon
153
SpriteFrame(-64, -72, 128, 144, 384, 288) // #3 - Special Stage 4 Icon
154
SpriteFrame(-64, -72, 128, 144, 0, 432) // #4 - Special Stage 5 Icon
155
SpriteFrame(-64, -72, 128, 144, 128, 432) // #5 - Special Stage 6 Icon
156
SpriteFrame(-64, -72, 128, 144, 256, 432) // #6 - Special Stage 7 Icon
157
SpriteFrame(-64, -72, 128, 144, 384, 432) // #7 - Sonic The Hedgehog CD
158
SpriteFrame(-67, -75, 134, 150, 306, 873) // #8 - Icon Border
159
SpriteFrame(-67, -95, 64, 20, 280, 680) // #9 - Exit
160
SpriteFrame(-67, -95, 64, 20, 135, 617) // #10 - Exit Highlight
161
SpriteFrame(0, 0, 64, 20, 280, 659) // #11 - Next
162
SpriteFrame(0, 0, 64, 20, 200, 617) // #12 - Next Highlight
163
SpriteFrame(0, 0, 64, 20, 345, 659) // #13 - Go
164
SpriteFrame(0, 0, 64, 20, 265, 617) // #14 - Go Highlight
165
end sub
166
167
168
// ========================
169
// Editor Subs
170
// ========================
171
172
sub RSDKEdit
173
if Editor.ReturnVariable == true
174
switch Editor.VariableID
175
case EDIT_VAR_PROPVAL // Property Value
176
CheckResult = Object.PropertyValue
177
break
178
case 0 // frame
179
CheckResult = Object.PropertyValue
180
break
181
end switch
182
else
183
switch Editor.VariableID
184
case EDIT_VAR_PROPVAL // Property Value
185
Object.PropertyValue = Editor.VariableValue
186
break
187
case 0 // frame
188
Object.PropertyValue = Editor.VariableValue
189
break
190
end switch
191
end if
192
end sub
193
194
195
sub RSDKDraw
196
DrawSprite(8)
197
DrawSprite(Object.PropertyValue)
198
end sub
199
200
201
sub RSDKLoad
202
LoadSpriteSheet("TAttack/TimeAttack.gif")
203
SpriteFrame(-64, -72, 128, 144, 0, 288) // #0 - Special Stage 1 Icon
204
SpriteFrame(-64, -72, 128, 144, 128, 288) // #1 - Special Stage 2 Icon
205
SpriteFrame(-64, -72, 128, 144, 256, 288) // #2 - Special Stage 3 Icon
206
SpriteFrame(-64, -72, 128, 144, 384, 288) // #3 - Special Stage 4 Icon
207
SpriteFrame(-64, -72, 128, 144, 0, 432) // #4 - Special Stage 5 Icon
208
SpriteFrame(-64, -72, 128, 144, 128, 432) // #5 - Special Stage 6 Icon
209
SpriteFrame(-64, -72, 128, 144, 256, 432) // #6 - Special Stage 7 Icon
210
SpriteFrame(-64, -72, 128, 144, 384, 432) // #7 - Sonic The Hedgehog CD
211
SpriteFrame(-67, -75, 134, 150, 306, 873) // #8 - Icon Border
212
SpriteFrame(-67, -95, 64, 20, 280, 680) // #9 - Exit
213
SpriteFrame(-67, -95, 64, 20, 135, 617) // #10 - Exit Highlight
214
SpriteFrame(0, 0, 64, 20, 280, 659) // #11 - Next
215
SpriteFrame(0, 0, 64, 20, 200, 617) // #12 - Next Highlight
216
SpriteFrame(0, 0, 64, 20, 345, 659) // #13 - Go
217
SpriteFrame(0, 0, 64, 20, 265, 617) // #14 - Go Highlight
218
219
AddEditorVariable("frame")
220
SetActiveVariable("frame")
221
AddEnumVariable("Special Zone 1", 0)
222
AddEnumVariable("Special Zone 2", 1)
223
AddEnumVariable("Special Zone 3", 2)
224
AddEnumVariable("Special Zone 4", 3)
225
AddEnumVariable("Special Zone 5", 4)
226
AddEnumVariable("Special Zone 6", 5)
227
AddEnumVariable("Special Zone 7", 6)
228
AddEnumVariable("Sonic CD Icon", 7)
229
end sub
230
231