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/MPZ/LavaBubble.txt
1480 views
1
// ----------------------------------
2
// RSDK Project: Sonic 2
3
// Script Description: Lava Bubble 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.timer
13
14
// States
15
private alias 0 : LAVABUBBLE_BUBBLING
16
private alias 1 : LAVABUBBLE_POPPED
17
18
19
// ========================
20
// Function Declarations
21
// ========================
22
23
reserve function LavaBubble_DebugDraw
24
reserve function LavaBubble_DebugSpawn
25
26
27
// ========================
28
// Function Definitions
29
// ========================
30
31
private function LavaBubble_DebugDraw
32
DrawSprite(0)
33
end function
34
35
36
private function LavaBubble_DebugSpawn
37
CreateTempObject(TypeName[Lava Bubble], object.direction, object.xpos, object.ypos)
38
object[tempObjectPos].drawOrder = 4
39
end function
40
41
42
// ========================
43
// Events
44
// ========================
45
46
event ObjectUpdate
47
if object.state == LAVABUBBLE_BUBBLING
48
object.animationTimer++
49
if object.animationTimer == 12
50
object.animationTimer = 0
51
object.frame++
52
if object.frame >= 6
53
object.timer = 128
54
object.state = LAVABUBBLE_POPPED
55
end if
56
end if
57
else
58
object.timer--
59
if object.timer == 0
60
object.frame = 0
61
object.state = LAVABUBBLE_BUBBLING
62
end if
63
end if
64
end event
65
66
67
event ObjectDraw
68
DrawSprite(object.frame)
69
end event
70
71
72
event ObjectStartup
73
LoadSpriteSheet("MPZ/Objects.gif")
74
SpriteFrame(-7, 2, 14, 8, 1, 1)
75
SpriteFrame(-7, 0, 14, 8, 1, 1)
76
SpriteFrame(-7, -2, 14, 8, 1, 1)
77
SpriteFrame(-7, -4, 14, 8, 1, 1)
78
SpriteFrame(-11, -4, 22, 8, 1, 10)
79
SpriteFrame(-14, -4, 27, 8, 1, 19)
80
SpriteFrame(0, 0, 1, 1, 1, 1)
81
82
foreach (TypeName[Lava Bubble], arrayPos0, ALL_ENTITIES)
83
object[arrayPos0].drawOrder = 4
84
next
85
86
SetTableValue(TypeName[Lava Bubble], DebugMode_ObjCount, DebugMode_TypesTable)
87
SetTableValue(LavaBubble_DebugDraw, DebugMode_ObjCount, DebugMode_DrawTable)
88
SetTableValue(LavaBubble_DebugSpawn, DebugMode_ObjCount, DebugMode_SpawnTable)
89
DebugMode_ObjCount++
90
end event
91
92
93
// ========================
94
// Editor Events
95
// ========================
96
97
event RSDKDraw
98
DrawSprite(0)
99
end event
100
101
102
event RSDKLoad
103
LoadSpriteSheet("MPZ/Objects.gif")
104
SpriteFrame(-7, 2, 14, 8, 1, 1)
105
106
// set to 34 in the scene, doesn't mean anything though
107
SetVariableAlias(ALIAS_VAR_PROPVAL, "unused")
108
end event
109
110