Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
rubberduckycooly
GitHub Repository: rubberduckycooly/Sonic-1-Sonic-2-2013-Script-Decompilation
Path: blob/master/Sonic 2/Scripts/Mission/SetRingCount.txt
1478 views
1
// ----------------------------------
2
// RSDK Project: Sonic 2
3
// Script Description: SetRingCount Object
4
// Script Author: Christian Whitehead/Simon Thomley
5
// Unpacked by Rubberduckycooly's script unpacker
6
// ----------------------------------
7
8
// This Object is used in Mission "Super Sonic Finish" - M036 - Mission_Zone09
9
// This Object is also used in its follow-up DLC Mission, "Extreme! Super Sonic Finish" - M104 - DLC_Zone06
10
11
// This is normally paired with the SuperSonic Object to make the Player start Super with a certain amount of rings,
12
// though it can work alone if needed (As S1 does in its LZ Mission)
13
14
// ========================
15
// Aliases
16
// ========================
17
18
// To be set from the Editor
19
private alias object.value0 : object.ringCount
20
21
// Player Aliases
22
private alias object.value0 : player.rings
23
24
25
// ========================
26
// Events
27
// ========================
28
29
event ObjectStartup
30
temp0 = 0
31
foreach (TypeName[SetRingCount], arrayPos0, ALL_ENTITIES)
32
if temp0 == 0
33
temp0 = object[arrayPos0].ringCount
34
end if
35
next
36
37
if temp0 != 0
38
player[0].rings = temp0
39
end if
40
end event
41
42
43
// ========================
44
// Editor Events
45
// ========================
46
47
event RSDKDraw
48
DrawSprite(0)
49
end event
50
51
52
event RSDKLoad
53
LoadSpriteSheet("Global/Items.gif")
54
SpriteFrame(-8, -8, 16, 16, 1, 1)
55
56
SetVariableAlias(ALIAS_VAR_PROPVAL, "unused")
57
SetVariableAlias(ALIAS_VAR_VAL0, "ringCount")
58
end event
59
60