Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
rubberduckycooly
GitHub Repository: rubberduckycooly/Sonic-CD-2011-Script-Decompilation
Path: blob/main/Scripts/Global/RingSparkle.txt
1319 views
1
//----------------Sonic CD Ring Sparkle 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
// Value1 is skipped over
8
#alias Object.Value2 : Object.MissionTypeEX
9
10
// Ring Reset Aliases
11
#alias Object.Value0 : Object.TimeCheckpoint
12
13
// Priority Aliases
14
#alias 1 : PRIORITY_ACTIVE
15
16
// Priority Aliases
17
#alias 10 : RULE_RESPAWN_RINGS
18
19
20
sub ObjectMain
21
22
Object.Timer++
23
if Object.Timer == 6
24
25
Object.Timer = 0
26
Object.Frame++
27
28
// There are only 4 Ring Sparkle frames, unload once attempting to progress from the final one
29
if Object.Frame == 4
30
Object.Type = TypeName[Blank Object]
31
Object.Frame = 0
32
33
#platform: Use_Origins
34
if game.playMode == BOOT_PLAYMODE_MISSION
35
// Set during "M079 - Ring Challenge 100"
36
if game.missionFunctionNo == RULE_RESPAWN_RINGS
37
38
// Turn into the Ring Reset object
39
// -> MissionTypeEX is set in the Ring Reset script
40
Object.Type = Object.MissionTypeEX
41
42
// Take the current time + 20 and set it to this object's Time Checkpoint
43
Object.TimeCheckpoint = Stage.Minutes
44
Object.TimeCheckpoint *= 60
45
Object.TimeCheckpoint += Stage.Seconds
46
Object.TimeCheckpoint += 20
47
48
// While as a Ring Reset object, this object should always be updating before turning back into a Ring object
49
Object.Priority = PRIORITY_ACTIVE
50
51
end if
52
end if
53
#endplatform
54
end if
55
end if
56
57
end sub
58
59
60
sub ObjectDraw
61
DrawSprite(Object.Frame)
62
end sub
63
64
65
sub ObjectStartup
66
67
LoadSpriteSheet("Global/Items.gif")
68
69
// 0-3 - Ring Sparkle Frames
70
SpriteFrame(-8, -8, 16, 16, 1, 202)
71
SpriteFrame(-8, -8, 16, 16, 18, 202)
72
SpriteFrame(-8, -8, 16, 16, 1, 219)
73
SpriteFrame(-8, -8, 16, 16, 18, 219)
74
75
end sub
76
77
78
// ========================
79
// Editor Subs
80
// ========================
81
82
sub RSDKDraw
83
DrawSprite(0)
84
end sub
85
86
87
sub RSDKLoad
88
LoadSpriteSheet("Global/Items.gif")
89
SpriteFrame(-8, -8, 16, 16, 1, 202)
90
91
SetVariableAlias(ALIAS_VAR_PROPVAL, "unused")
92
end sub
93
94