Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
rubberduckycooly
GitHub Repository: rubberduckycooly/Sonic-CD-2011-Script-Decompilation
Path: blob/main/Scripts/Mission/RingReset.txt
1319 views
1
//-----------------Sonic CD Ring Reset Script-----------------//
2
//--------Scripted by Christian Whitehead 'The Taxman'--------//
3
//-------Unpacked By Rubberduckycooly's Script Unpacker-------//
4
//--------Used on Mission "M095 - Ring Challenge 100"---------//
5
6
// Aliases
7
#alias Object.Value0 : Object.TimeCheckpoint
8
9
// This Value's used for by Rings, more specifically by the Ring Sparkle they turn into
10
#alias Object.Value2 : Object.MissionTypeEX
11
12
// Priority Aliases
13
#alias 0 : PRIORITY_BOUNDS
14
15
// Mission Function
16
#alias 10 : RULE_RESPAWN_RINGS
17
18
19
sub ObjectMain
20
21
// Note - this object may never be placed directly into a Scene,
22
// but rings from the "Ring Challenge 100" mission will turn into this object in place of unloading
23
24
// Make sure the Object's out of bounds right now, we don't want any visible appearing in front of the player
25
// -> Do note, this object has a priority of PRIORITY_ACTIVE, which is why this works
26
if Object.OutOfBounds == true
27
28
// Get the total current stage time
29
TempValue0 = Stage.Minutes
30
TempValue0 *= 60
31
TempValue0 += Stage.Seconds
32
33
// See if it's greater than (or equal to) the time this Ring holds
34
// (The value the Ring holds will be 20 seconds after the time it was collected)
35
if TempValue0 >= Object.TimeCheckpoint
36
37
// Turn this object back into a ring, and give it normal Priority again
38
Object.Type = TypeName[Ring]
39
Object.Priority = PRIORITY_BOUNDS
40
41
// And reset the time Value too, of course
42
Object.TimeCheckpoint = 0
43
44
end if
45
46
end if
47
48
end sub
49
50
51
sub ObjectStartup
52
53
// Sets the special rule for this mission
54
game.missionFunctionNo = RULE_RESPAWN_RINGS
55
56
// Cycle through all rings and set their their special type to that of the Ring Reset object
57
58
TempValue0 = TypeName[Ring Reset]
59
60
ArrayPos0 = 32
61
while ArrayPos0 < 1056
62
if Object[ArrayPos0].Type == TypeName[Ring]
63
Object[ArrayPos0].MissionTypeEX = TempValue0
64
end if
65
66
ArrayPos0++
67
loop
68
69
end sub
70
71
72
// ========================
73
// Editor Subs
74
// ========================
75
76
sub RSDKDraw
77
Object.InkEffect = 1
78
DrawSpriteFX(0, FX_INK, Object.XPos, Object.YPos)
79
end sub
80
81
82
sub RSDKLoad
83
LoadSpriteSheet("Global/Items.gif")
84
SpriteFrame(-8, -8, 16, 16, 1, 1)
85
86
SetVariableAlias(ALIAS_VAR_PROPVAL, "unused")
87
end sub
88
89
90
91