Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
rubberduckycooly
GitHub Repository: rubberduckycooly/Sonic-CD-2011-Script-Decompilation
Path: blob/main/Scripts/Global/BlueShield.txt
1319 views
1
//----------------Sonic CD Blue Shield 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
// Player Aliases
9
#alias Object[-2].DrawOrder : PlayerObject.DrawOrder
10
11
// Player Aliases
12
#alias 0 : PLAYER_SONIC_A
13
#alias 1 : PLAYER_TAILS_A
14
15
16
sub ObjectMain
17
// Match the Player's Draw Order
18
Object.DrawOrder = PlayerObject.DrawOrder
19
20
// If the Player's dead, then unload
21
22
if Player.State == Player_State_Death
23
Object.Type = TypeName[Blank Object]
24
end if
25
26
if Player.State == Player_State_Drown
27
Object.Type = TypeName[Blank Object]
28
end if
29
30
end sub
31
32
33
sub ObjectDraw
34
Object.Timer++
35
36
if Object.Timer == 2
37
Object.Timer = 0
38
Object.Frame++
39
if Object.Frame > 5
40
Object.Frame = 0
41
end if
42
end if
43
44
if Warp.Timer == 0
45
if Player.Visible == true
46
DrawSpriteFX(Object.Frame, FX_INK, Player.XPos, Player.YPos)
47
end if
48
end if
49
50
end sub
51
52
53
sub ObjectStartup
54
// Load the corresponding sheet for the current Player
55
if Stage.PlayerListPos == PLAYER_SONIC_A
56
LoadSpriteSheet("Global/Items2.gif")
57
end if
58
if Stage.PlayerListPos == PLAYER_TAILS_A
59
LoadSpriteSheet("Global/Items2_t.gif")
60
end if
61
62
#platform: Use_Origins
63
if Stage.PlayerListPos == PLAYER_KNUCKLES
64
LoadSpriteSheet("Global/Items2_k.gif")
65
end if
66
if Stage.PlayerListPos == PLAYER_AMY
67
LoadSpriteSheet("Global/Items2_a.gif")
68
end if
69
#endplatform
70
71
// 0-5 - Blue Shield Frames
72
// Every other frame is blank
73
SpriteFrame(-24, -24, 48, 48, 109, 196)
74
SpriteFrame(0, 0, 0, 0, 109, 196)
75
SpriteFrame(-24, -24, 48, 48, 158, 196)
76
SpriteFrame(0, 0, 0, 0, 109, 196)
77
SpriteFrame(-24, -24, 48, 48, 207, 196)
78
SpriteFrame(0, 0, 0, 0, 109, 196)
79
80
end sub
81
82
83
// ========================
84
// Editor Subs
85
// ========================
86
87
sub RSDKDraw
88
DrawSprite(0)
89
end sub
90
91
92
sub RSDKLoad
93
LoadSpriteSheet("Global/Items2.gif")
94
SpriteFrame(-24, -24, 48, 48, 109, 196) // Blue Shield, first frame
95
96
SetVariableAlias(ALIAS_VAR_PROPVAL, "unused")
97
end sub
98
99