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/CPZ/ChemicalSplash.txt
1480 views
1
// ----------------------------------
2
// RSDK Project: Sonic 2
3
// Script Description: Chemical Splash Object
4
// Script Author: Christian Whitehead/Simon Thomley
5
// Unpacked by Rubberduckycooly's script unpacker
6
// ----------------------------------
7
8
// ========================
9
// Aliases
10
// ========================
11
12
// Path ID Aliases
13
private alias 0 : PATH_A
14
15
16
// ========================
17
// Events
18
// ========================
19
20
event ObjectUpdate
21
object.xpos += object.xvel
22
object.ypos += object.yvel
23
object.yvel += 0x3800
24
25
temp0 = object.xpos
26
temp0 >>= 16
27
temp0 -= camera[0].xpos
28
Abs(temp0)
29
temp0 -= 32
30
31
temp1 = object.ypos
32
temp1 >>= 16
33
temp1 -= camera[0].ypos
34
Abs(temp1)
35
temp1 -= 32
36
37
if temp0 >= screen.xcenter
38
object.type = TypeName[Blank Object]
39
end if
40
41
if temp1 >= screen.ycenter
42
object.type = TypeName[Blank Object]
43
end if
44
45
ObjectTileCollision(CSIDE_FLOOR, 0, 4, PATH_A)
46
if checkResult == true
47
object.type = TypeName[Blank Object]
48
end if
49
end event
50
51
52
event ObjectDraw
53
DrawSpriteFX(0, FX_FLIP, object.xpos, object.ypos)
54
end event
55
56
57
event ObjectStartup
58
// Interestingly, while most objects would just check for their normal zone (Zone02 in this case) and then load MBZ's sheet with an `else`,
59
// this object instead checks for the two zone's folders individually
60
// How strange.
61
62
CheckCurrentStageFolder("Zone02")
63
if checkResult == true
64
LoadSpriteSheet("CPZ/Objects.gif")
65
SpriteFrame(-4, -4, 8, 8, 93, 122)
66
end if
67
68
CheckCurrentStageFolder("ZoneM")
69
if checkResult == true
70
LoadSpriteSheet("MBZ/Objects.gif")
71
SpriteFrame(-4, -4, 8, 8, 104, 155)
72
end if
73
end event
74
75
76
// ========================
77
// Editor Events
78
// ========================
79
80
event RSDKDraw
81
DrawSprite(0)
82
end event
83
84
85
event RSDKLoad
86
CheckCurrentStageFolder("Zone02")
87
if checkResult == true
88
LoadSpriteSheet("CPZ/Objects.gif")
89
SpriteFrame(-4, -4, 8, 8, 93, 122)
90
else
91
// We may as well go with an else here, just in case neither of the two base folders match
92
LoadSpriteSheet("MBZ/Objects.gif")
93
SpriteFrame(-4, -4, 8, 8, 104, 155)
94
end if
95
96
SetVariableAlias(ALIAS_VAR_PROPVAL, "unused")
97
end event
98
99