Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
rubberduckycooly
GitHub Repository: rubberduckycooly/Sonic-CD-2011-Script-Decompilation
Path: blob/main/Scripts/R6/AngelRing.txt
1319 views
1
//-----------------Sonic CD Angel Ring Script-----------------//
2
//--------Scripted by Christian Whitehead 'The Taxman'--------//
3
//-------Unpacked By Rubberduckycooly's Script Unpacker-------//
4
5
// Aliases
6
#alias Object.Value3 : Object.Timer
7
#alias Object.Value2 : Object.RingTimer
8
9
// Lose Ring Aliases
10
#alias Object.Value0 : Object.XVelocity
11
#alias Object.Value1 : Object.YVelocity
12
13
// States
14
#alias 0 : ANGELRING_INACTIVE
15
#alias 1 : ANGELRING_RING_SHOWER
16
17
// Players
18
#alias 0 : PLAYER_SONIC_A
19
20
// Priority
21
#alias 0 : PRIORITY_BOUNDS
22
#alias 1 : PRIORITY_ACTIVE
23
24
25
sub ObjectMain
26
if Object.OutOfBounds == true
27
Object.State = ANGELRING_INACTIVE
28
Object.Timer = 0
29
Object.RingTimer = 0
30
Object.Priority = PRIORITY_BOUNDS
31
end if
32
33
if Object.Timer > 0
34
if Object.RingTimer < 12
35
Object.RingTimer++
36
else
37
Object.RingTimer = 0
38
CreateTempObject(TypeName[Lose Ring], 0, Object.XPos, Object.YPos)
39
Rand(Object[TempObjectPos].XVelocity, 8)
40
Object[TempObjectPos].XVelocity <<= 15
41
Object[TempObjectPos].XVelocity -= 0x14000
42
43
Object[TempObjectPos].YVelocity = -0x20000
44
45
Object[TempObjectPos].AnimationSpeed = 256
46
Object.Timer--
47
end if
48
end if
49
end sub
50
51
52
sub ObjectPlayerInteraction
53
if Object.State == ANGELRING_INACTIVE
54
PlayerObjectCollision(C_TOUCH, -64, -64, -12, 96)
55
if CheckResult == true
56
Object.State = ANGELRING_RING_SHOWER
57
Object.Timer = 60
58
Object.Priority = PRIORITY_ACTIVE
59
Object.RingTimer = 0
60
61
// Statue Saviour
62
if Stage.PlayerListPos == PLAYER_SONIC_A // PLAYER_SONIC in origins
63
if Stage.DebugMode == false
64
SetAchievement(5, 100)
65
end if
66
end if
67
end if
68
end if
69
end sub
70
71
72
// ========================
73
// Editor Subs
74
// ========================
75
76
sub RSDKDraw
77
DrawSprite(0)
78
end sub
79
80
81
sub RSDKLoad
82
LoadSpriteSheet("Global/Display.gif")
83
SpriteFrame(-16, -16, 32, 32, 1, 143) // #0 - "Script" Icon
84
85
SetVariableAlias(ALIAS_VAR_PROPVAL, "unused")
86
end sub
87
88