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/EggmanFireball2.txt
1482 views
1
// ----------------------------------
2
// RSDK Project: Sonic 2
3
// Script Description: Eggman Fireball2 Object
4
// Script Author: Christian Whitehead/Simon Thomley
5
// Unpacked by Rubberduckycooly's script unpacker
6
// ----------------------------------
7
8
// ========================
9
// Aliases
10
// ========================
11
12
// GroundFlame Aliases
13
private alias object.value0 : groundFlame.timer
14
15
// Path ID Aliases
16
private alias 0 : PATH_A
17
18
19
// ========================
20
// Events
21
// ========================
22
23
event ObjectUpdate
24
object.xpos += object.xvel
25
object.ypos += object.yvel
26
object.yvel += 0x3800
27
28
// Check if the object's touched the ground
29
ObjectTileCollision(CSIDE_FLOOR, 0, 8, PATH_A)
30
if checkResult == true
31
// Create ground flames along the floor
32
PlaySfx(SfxName[Flame Thrower], false)
33
CreateTempObject(TypeName[Ground Flame], 0, object.xpos, object.ypos)
34
groundFlame[tempObjectPos].timer = 3
35
if object.xvel < 0
36
object[tempObjectPos].direction = FLIP_NONE
37
object[tempObjectPos].xpos -= 0x20000
38
else
39
object[tempObjectPos].direction = FLIP_X
40
object[tempObjectPos].xpos += 0x20000
41
end if
42
object.type = TypeName[Blank Object]
43
end if
44
45
// Animate the object
46
object.frame = object.animationTimer
47
object.frame >>= 2
48
object.animationTimer++
49
object.animationTimer &= 7
50
51
if object.outOfBounds == true
52
object.type = TypeName[Blank Object]
53
end if
54
55
foreach (GROUP_PLAYERS, currentPlayer, ACTIVE_ENTITIES)
56
BoxCollisionTest(C_TOUCH, object.entityPos, -8, -8, 8, 8, currentPlayer, C_BOX, C_BOX, C_BOX, C_BOX)
57
if checkResult == true
58
CallFunction(Player_FireHit)
59
end if
60
next
61
end event
62
63
64
event ObjectDraw
65
DrawSprite(object.frame)
66
end event
67
68
69
event ObjectStartup
70
CheckCurrentStageFolder("Zone05")
71
if checkResult == true
72
LoadSpriteSheet("HTZ/Objects.gif")
73
SpriteFrame(-8, -8, 16, 16, 191, 94)
74
SpriteFrame(-8, -8, 16, 16, 191, 110)
75
else
76
LoadSpriteSheet("MBZ/Objects.gif")
77
SpriteFrame(-8, -8, 16, 16, 1008, 1)
78
SpriteFrame(-8, -8, 16, 16, 1008, 17)
79
end if
80
end event
81
82
83
event RSDKDraw
84
DrawSprite(0)
85
end event
86
87
88
event RSDKLoad
89
CheckCurrentStageFolder("Zone05")
90
if checkResult == true
91
LoadSpriteSheet("HTZ/Objects.gif")
92
SpriteFrame(-8, -8, 16, 16, 191, 94)
93
else
94
LoadSpriteSheet("MBZ/Objects.gif")
95
SpriteFrame(-8, -8, 16, 16, 1008, 1)
96
end if
97
98
SetVariableAlias(ALIAS_VAR_PROPVAL, "unused")
99
end event
100
101