Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
rubberduckycooly
GitHub Repository: rubberduckycooly/Sonic-1-Sonic-2-2013-Script-Decompilation
Path: blob/master/Sonic 1/Scripts/Mission/RingReset.txt
1483 views
1
// ----------------------------------
2
// RSDK Project: Sonic 1
3
// Script Description: RingReset Object
4
// Script Author: Christian Whitehead/Simon Thomley
5
// Unpacked by Rubberduckycooly's script unpacker
6
// ----------------------------------
7
8
// This Object is used in Mission "Ring Challenge 50" - M014 - Mission_Zone04
9
10
// ========================
11
// Aliases
12
// ========================
13
14
private alias object.value0 : object.timeCheckpoint
15
16
// Ring/Ring Sparkle Aliases
17
private alias object.value2 : object.missionTypeEX
18
19
private alias 10 : MISSIONNO_RINGCHALLENGE50
20
21
22
// ========================
23
// Events
24
// ========================
25
26
event ObjectUpdate
27
// Make sure the Object is out of the Player's sight before doing anything
28
if object.outOfBounds == true
29
// First, get the total time
30
temp0 = stage.minutes
31
temp0 *= 60
32
temp0 += stage.seconds
33
34
// Then compare it to when this Ring was collected
35
if temp0 >= object.timeCheckpoint
36
// If enough time has lapsed, then turn this Object back into a Ring
37
object.type = TypeName[Ring]
38
39
// Reset the Object's values
40
object.priority = PRIORITY_BOUNDS
41
object.timeCheckpoint = 0
42
end if
43
end if
44
end event
45
46
47
event ObjectStartup
48
// This Object should only be used in Act 1, Act 2 is "The One Ring" Mission where we, of course, don't want respawning rings
49
if stage.actNum == 1
50
game.missionFunctionNo = MISSIONNO_RINGCHALLENGE50
51
52
// Set the RingReset Type ID in all the Ring Objects across the level
53
temp0 = TypeName[RingReset]
54
foreach (TypeName[Ring], arrayPos0, ALL_ENTITIES)
55
object[arrayPos0].missionTypeEX = temp0
56
next
57
end if
58
end event
59
60
61
// ========================
62
// Editor Events
63
// ========================
64
65
event RSDKDraw
66
DrawSprite(0)
67
end event
68
69
70
event RSDKLoad
71
LoadSpriteSheet("Global/Items.gif")
72
SpriteFrame(-8, -8, 16, 16, 1, 1)
73
74
SetVariableAlias(ALIAS_VAR_PROPVAL, "unused")
75
end event
76
77