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/SetRingCount.txt
1483 views
1
// ----------------------------------
2
// RSDK Project: Sonic 1
3
// Script Description: SetRingCount Object
4
// Script Author: Christian Whitehead/Simon Thomley
5
// Unpacked by Rubberduckycooly's script unpacker
6
// ----------------------------------
7
8
// ========================
9
// Aliases
10
// ========================
11
12
private alias object.value0 : object.ringCount
13
14
// Player Aliases
15
private alias object.value0 : player.rings
16
17
18
// ========================
19
// Events
20
// ========================
21
22
event ObjectStartup
23
temp0 = 0
24
25
// Find all SetRingCount objects in the level, look at their held Ring Count
26
foreach (TypeName[SetRingCount], arrayPos0, ALL_ENTITIES)
27
if temp0 == 0
28
temp0 = object[arrayPos0].ringCount
29
end if
30
next
31
32
// And then give the Player as much rings as the Object demands
33
if temp0 != 0
34
player[0].rings = temp0
35
end if
36
end event
37
38
39
// ========================
40
// Editor Events
41
// ========================
42
43
event RSDKDraw
44
DrawSprite(0)
45
end event
46
47
48
event RSDKLoad
49
LoadSpriteSheet("Global/Items.gif")
50
SpriteFrame(-8, -8, 16, 16, 1, 1)
51
52
SetVariableAlias(ALIAS_VAR_VAL0, "ringCount")
53
end event
54
55