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/EHZ/BurningLog.txt
1483 views
1
// ----------------------------------
2
// RSDK Project: Sonic 2
3
// Script Description: Burning Log 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 : BURNINGLOG_BURN
16
private alias 1 : BURNINGLOG_FALL
17
18
// Player Aliases
19
private alias object.value40 : player.hitboxLeft
20
private alias object.value38 : player.hitboxTop
21
private alias object.value41 : player.hitboxRight
22
private alias object.value39 : player.hitboxBottom
23
24
25
// ========================
26
// Events
27
// ========================
28
29
event ObjectUpdate
30
switch object.state
31
case BURNINGLOG_BURN
32
object.timer--
33
if object.timer <= 0
34
object.state = BURNINGLOG_FALL
35
end if
36
break
37
38
case BURNINGLOG_FALL
39
object.ypos += object.yvel
40
object.yvel += 0x3800
41
42
if object.outOfBounds == true
43
object.type = TypeName[Blank Object]
44
end if
45
break
46
47
end switch
48
49
foreach (GROUP_PLAYERS, currentPlayer, ACTIVE_ENTITIES)
50
// i can see why they did it, but it's kinda weird to use the hitbox values for platform collision..
51
BoxCollisionTest(C_PLATFORM, object.entityPos, -8, -8, 8, 8, currentPlayer, player[currentPlayer].hitboxLeft, player[currentPlayer].hitboxTop, player[currentPlayer].hitboxRight, player[currentPlayer].hitboxBottom)
52
if object.timer <= 15
53
BoxCollisionTest(C_TOUCH, object.entityPos, -8, -16, 8, 8, currentPlayer, player[currentPlayer].hitboxLeft, player[currentPlayer].hitboxTop, player[currentPlayer].hitboxRight, player[currentPlayer].hitboxBottom)
54
if checkResult == true
55
CallFunction(Player_FireHit)
56
end if
57
end if
58
next
59
60
object.frame = object.animationTimer
61
object.frame /= 3
62
object.frame += 3
63
object.animationTimer++
64
if object.animationTimer >= 6
65
object.animationTimer = 0
66
end if
67
end event
68
69
70
event ObjectDraw
71
DrawSprite(0)
72
73
if object.timer <= 15
74
GetBit(object.direction, oscillation, 2)
75
DrawSpriteFX(1, FX_FLIP, object.xpos, object.ypos)
76
end if
77
end event
78
79
80
event ObjectStartup
81
CheckCurrentStageFolder("Zone01")
82
if checkResult == true
83
LoadSpriteSheet("EHZ/Objects.gif")
84
SpriteFrame(-8, -8, 16, 16, 82, 78)
85
SpriteFrame(-8, -16, 16, 24, 110, 19)
86
else
87
LoadSpriteSheet("MBZ/Objects.gif")
88
SpriteFrame(-8, -8, 16, 16, 137, 313)
89
SpriteFrame(-8, -16, 16, 24, 110, 19)
90
end if
91
end event
92
93
94
// ========================
95
// Editor Events
96
// ========================
97
98
event RSDKDraw
99
DrawSprite(0)
100
end event
101
102
103
event RSDKLoad
104
CheckCurrentStageFolder("Zone01")
105
if checkResult == true
106
LoadSpriteSheet("EHZ/Objects.gif")
107
SpriteFrame(-8, -8, 16, 16, 82, 78)
108
else
109
LoadSpriteSheet("MBZ/Objects.gif")
110
SpriteFrame(-8, -8, 16, 16, 137, 313)
111
end if
112
113
SetVariableAlias(ALIAS_VAR_PROPVAL, "unused")
114
end event
115
116