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/HTZ/LavaJump.txt
1478 views
1
// ----------------------------------
2
// RSDK Project: Sonic 2
3
// Script Description: Lava Jump 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
// Path ID Aliases
15
private alias 0 : PATH_A
16
17
18
// ========================
19
// Events
20
// ========================
21
22
event ObjectUpdate
23
object.xpos += object.xvel
24
object.ypos += object.yvel
25
object.yvel += 0x3800
26
27
if object.yvel >= 0
28
// If going downwards, go ahead and Y-flip the sprite
29
object.direction |= FLIP_Y
30
end if
31
32
// Check if the object's hit the floor
33
ObjectTileCollision(CSIDE_FLOOR, 0, 8, PATH_A)
34
if checkResult == true
35
// Create Flames along the Ground upon impact
36
PlaySfx(SfxName[Flame Thrower], false)
37
CreateTempObject(TypeName[Ground Flame], 0, object.xpos, object.ypos)
38
object[tempObjectPos].timer = 3
39
if object.xvel < 0
40
object[tempObjectPos].direction = FACING_RIGHT
41
object[tempObjectPos].xpos -= 0x20000
42
else
43
object[tempObjectPos].direction = FACING_LEFT
44
object[tempObjectPos].xpos += 0x20000
45
end if
46
object.type = TypeName[Blank Object]
47
end if
48
49
// Animate the object
50
object.frame = object.animationTimer
51
object.frame >>= 2
52
object.animationTimer++
53
object.animationTimer &= 7
54
55
if object.outOfBounds == true
56
object.type = TypeName[Blank Object]
57
end if
58
59
foreach (GROUP_PLAYERS, currentPlayer, ACTIVE_ENTITIES)
60
BoxCollisionTest(C_TOUCH, object.entityPos, -8, -8, 8, 8, currentPlayer, C_BOX, C_BOX, C_BOX, C_BOX)
61
62
if checkResult == true
63
CallFunction(Player_FireHit)
64
end if
65
next
66
end event
67
68
69
event ObjectDraw
70
DrawSpriteFX(object.frame, FX_FLIP, object.xpos, object.ypos)
71
end event
72
73
74
event ObjectStartup
75
CheckCurrentStageFolder("Zone05")
76
if checkResult == true
77
LoadSpriteSheet("HTZ/Objects.gif")
78
SpriteFrame(-8, -8, 15, 15, 91, 123)
79
SpriteFrame(-8, -8, 13, 15, 91, 140)
80
else
81
LoadSpriteSheet("MBZ/Objects.gif")
82
83
// Duplicate of HTZ sheet frames, don't quite look right on the MBZ sheet
84
SpriteFrame(-8, -8, 15, 15, 91, 123)
85
SpriteFrame(-8, -8, 13, 15, 91, 140)
86
end if
87
end event
88
89
90
// ========================
91
// Editor Events
92
// ========================
93
94
event RSDKDraw
95
DrawSprite(0)
96
end event
97
98
99
event RSDKLoad
100
CheckCurrentStageFolder("Zone05")
101
if checkResult == true
102
LoadSpriteSheet("HTZ/Objects.gif")
103
SpriteFrame(-8, -8, 15, 15, 91, 123)
104
else
105
LoadSpriteSheet("MBZ/Objects.gif")
106
SpriteFrame(-8, -8, 15, 15, 91, 123)
107
end if
108
109
SetVariableAlias(ALIAS_VAR_PROPVAL, "unused")
110
end event
111
112