Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
rubberduckycooly
GitHub Repository: rubberduckycooly/Sonic-CD-2011-Script-Decompilation
Path: blob/main/Scripts/Global/FadeMusic.txt
1319 views
1
//----------------Sonic CD Fade Music Script------------------//
2
//--------Scripted by Christian Whitehead 'The Taxman'--------//
3
//-------Unpacked By Rubberduckycooly's Script Unpacker-------//
4
5
// Aliases
6
#alias Object.Value0 : Object.Timer
7
8
// Property Values
9
#alias 0 : FADEMUSIC_TO_BOSS
10
#alias 1 : FADEMUSIC_TO_LEVEL
11
#alias 2 : FADEMUSIC_SSZEGGMAN
12
#alias 3 : FADEMUSIC_SSZAMY
13
14
// Priority
15
#alias 1 : PRIORITY_ACTIVE
16
17
18
sub ObjectMain
19
20
#platform: Use_Origins
21
// Take some values and print them?
22
// they left debug stuff in lol
23
game.callbackParam0 = 100 // Max timer value?
24
game.callbackParam1 = Object.PropertyValue // Get Fade Type
25
game.callbackParam2 = Object.Timer // Get current music timer
26
EngineCallback(NOTIFY_DEBUGPRINT)
27
#endplatform
28
29
switch Object.PropertyValue
30
case FADEMUSIC_TO_BOSS
31
if Object.Timer < 100
32
Object.Timer++
33
Music.Volume--
34
else
35
PlayMusic(4)
36
Object.Type = TypeName[Blank Object]
37
end if
38
break
39
40
case FADEMUSIC_TO_LEVEL
41
if Object.Timer < 100
42
Object.Timer++
43
Music.Volume--
44
else
45
PlayMusic(0)
46
Object.Type = TypeName[Blank Object]
47
end if
48
break
49
50
case FADEMUSIC_SSZEGGMAN
51
if Object.Timer < 50
52
Object.Timer++
53
Music.Volume -= 2
54
else
55
PlayMusic(0)
56
Object.Type = TypeName[Blank Object]
57
end if
58
break
59
60
case FADEMUSIC_SSZAMY
61
if Object.Timer < 100
62
Object.Timer++
63
Music.Volume--
64
else
65
66
#platform: Use_Origins
67
if game.playMode != BOOT_PLAYMODE_BOSSRUSH
68
PlayMusic(1)
69
end if
70
#endplatform
71
72
#platform: Use_Standalone
73
PlayMusic(1)
74
#endplatform
75
76
Object.Type = TypeName[Blank Object]
77
78
Object[30].Type = TypeName[ActFinish]
79
Object[30].DrawOrder = 6
80
Object[30].Priority = PRIORITY_ACTIVE
81
end if
82
break
83
84
end switch
85
end sub
86
87
88
// ========================
89
// Editor Subs
90
// ========================
91
92
sub RSDKDraw
93
DrawSprite(0)
94
end sub
95
96
97
sub RSDKLoad
98
LoadSpriteSheet("Global/Display.gif")
99
SpriteFrame(-16, -16, 32, 32, 1, 143) // #0 - "Script" Icon
100
101
// Although used by the object, it's not to be set from the editor
102
SetVariableAlias(ALIAS_VAR_PROPVAL, "unused")
103
end sub
104
105