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/MCZ/BossRock.txt
1480 views
1
// ----------------------------------
2
// RSDK Project: Sonic 2
3
// Script Description: Boss Rock 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 0 : BOSSROCK_TYPE_PEBBLE
13
private alias 1 : BOSSROCK_TYPE_STALACTITE
14
15
16
// ========================
17
// Events
18
// ========================
19
20
event ObjectUpdate
21
if object.propertyValue == BOSSROCK_TYPE_STALACTITE
22
// Object is one of the sharp stalactites, so check for collision with players
23
foreach (GROUP_PLAYERS, currentPlayer, ACTIVE_ENTITIES)
24
BoxCollisionTest(C_TOUCH, object.entityPos, -4, -12, 4, 12, currentPlayer, C_BOX, C_BOX, C_BOX, C_BOX)
25
26
if checkResult == true
27
CallFunction(Player_ProjectileHit)
28
end if
29
next
30
end if
31
32
object.ypos += object.yvel
33
object.yvel += 0x1800
34
35
if object.outOfBounds == true
36
object.type = TypeName[Blank Object]
37
end if
38
end event
39
40
41
event ObjectDraw
42
DrawSprite(object.propertyValue)
43
end event
44
45
46
event ObjectStartup
47
CheckCurrentStageFolder("Zone06") // In Mystic Cave Zone?
48
if checkResult == true
49
// Load the Mystic Cave sprites
50
LoadSpriteSheet("MCZ/Objects.gif")
51
SpriteFrame(-8, -8, 16, 16, 184, 115) // 0 - Pebble Frame
52
SpriteFrame(-4, -16, 8, 32, 131, 164) // 1 - Stalactite Frame
53
else
54
// In Egg Gauntlet Zone, load the EGZ/"MBZ" sprites
55
LoadSpriteSheet("MBZ/Objects.gif")
56
SpriteFrame(-8, -8, 16, 16, 100, 174)
57
SpriteFrame(-4, -16, 8, 32, 34, 191)
58
end if
59
end event
60
61
62
// ========================
63
// Editor Events
64
// ========================
65
66
event RSDKDraw
67
DrawSprite(object.propertyValue)
68
end event
69
70
71
event RSDKLoad
72
CheckCurrentStageFolder("Zone06") // In Mystic Cave Zone?
73
if checkResult == true
74
// Load the Mystic Cave sprites
75
LoadSpriteSheet("MCZ/Objects.gif")
76
SpriteFrame(-8, -8, 16, 16, 184, 115) // 0 - Pebble Frame
77
SpriteFrame(-4, -16, 8, 32, 131, 164) // 1 - Stalactite Frame
78
else
79
// In Egg Gauntlet Zone, load the EGZ sprites
80
LoadSpriteSheet("MBZ/Objects.gif")
81
SpriteFrame(-8, -8, 16, 16, 100, 174)
82
SpriteFrame(-4, -16, 8, 32, 34, 191)
83
end if
84
85
// although used by the object, this object shouldn't be placed in a scene at all
86
SetVariableAlias(ALIAS_VAR_PROPVAL, "unused")
87
end event
88
89