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/Global/DustPuff.txt
1480 views
1
// ----------------------------------
2
// RSDK Project: Sonic 2
3
// Script Description: Dust Puff 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.propertyValue : object.targetPlayer
13
14
// Player Aliases
15
private alias object.xpos : player.xpos
16
private alias object.ypos : player.ypos
17
private alias object.direction : player.direction
18
private alias object.animation : player.animation
19
private alias object.collisionBottom : player.collisionBottom
20
21
22
// ========================
23
// Events
24
// ========================
25
26
event ObjectUpdate
27
// Update object movement
28
object.xpos += object.xvel
29
object.ypos += object.yvel
30
31
switch object.frame
32
case 0
33
case 1
34
case 2
35
object.animationTimer++
36
if object.animationTimer > 3
37
object.frame++
38
object.animationTimer = 0
39
end if
40
break
41
42
case 3
43
object.animationTimer++
44
if object.animationTimer > 3
45
object.type = TypeName[Blank Object]
46
end if
47
break
48
49
case 4
50
case 5
51
case 6
52
case 7
53
case 8
54
case 9
55
object.animationTimer++
56
if object.animationTimer > 1
57
object.frame++
58
object.animationTimer = 0
59
end if
60
break
61
62
case 10
63
object.animationTimer++
64
if object.animationTimer > 1
65
object.frame = 4
66
object.animationTimer = 0
67
end if
68
break
69
70
end switch
71
72
end event
73
74
75
event ObjectDraw
76
if object.frame > 3
77
// Spindash dust variant
78
79
// Seek into this object's targeted player
80
currentPlayer = object.targetPlayer
81
82
// Make the values match
83
object.direction = player[currentPlayer].direction
84
object.xpos = player[currentPlayer].xpos
85
object.iypos = player[currentPlayer].collisionBottom
86
object.ypos += player[currentPlayer].ypos
87
88
// Erase this object if the player isn't spindashing
89
if player[currentPlayer].animation != ANI_SPINDASH
90
object.type = TypeName[Blank Object]
91
else
92
DrawSpriteFX(object.frame, FX_FLIP, object.xpos, object.ypos)
93
end if
94
else
95
96
// Dust Puff variant (from skidding and etc.)
97
DrawSpriteFX(object.frame, FX_FLIP, object.xpos, object.ypos)
98
99
end if
100
end event
101
102
103
event ObjectStartup
104
105
LoadSpriteSheet("Global/Items.gif")
106
107
// Dust frames
108
SpriteFrame(-7, -11, 13, 14, 85, 143)
109
SpriteFrame(-7, -11, 13, 14, 99, 143)
110
SpriteFrame(-6, -11, 13, 14, 113, 143)
111
SpriteFrame(-7, -11, 13, 14, 127, 143)
112
SpriteFrame(-32, -10, 32, 10, 58, 245)
113
SpriteFrame(-32, -12, 32, 12, 91, 243)
114
SpriteFrame(-32, -16, 32, 16, 124, 239)
115
SpriteFrame(-32, -18, 32, 18, 157, 237)
116
SpriteFrame(-32, -20, 32, 20, 190, 235)
117
SpriteFrame(-32, -21, 32, 21, 223, 210)
118
SpriteFrame(-32, -23, 32, 23, 223, 232)
119
end event
120
121
122
// ========================
123
// Editor Events
124
// ========================
125
126
event RSDKDraw
127
DrawSprite(0)
128
end event
129
130
131
event RSDKLoad
132
LoadSpriteSheet("Global/Items.gif")
133
SpriteFrame(-7, -11, 13, 14, 85, 143)
134
135
SetVariableAlias(ALIAS_VAR_PROPVAL, "unused")
136
end event
137
138