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/Fireball.txt
1480 views
1
// ----------------------------------
2
// RSDK Project: Sonic 2
3
// Script Description: Fireball Object
4
// Script Author: Christian Whitehead/Simon Thomley
5
// Unpacked by Rubberduckycooly's script unpacker
6
// ----------------------------------
7
8
// ========================
9
// Function Declarations
10
// ========================
11
12
reserve function Fireball_DebugDraw
13
reserve function Fireball_DebugSpawn
14
15
16
// ========================
17
// Function Definitions
18
// ========================
19
20
private function Fireball_DebugDraw
21
DrawSprite(0)
22
end function
23
24
25
private function Fireball_DebugSpawn
26
CreateTempObject(TypeName[Fireball], 0, object.xpos, object.ypos)
27
end function
28
29
30
// ========================
31
// Events
32
// ========================
33
34
event ObjectUpdate
35
object.drawOrder = 5
36
37
object.animationTimer++
38
if object.animationTimer >= 12
39
object.animationTimer = 0
40
end if
41
object.frame = object.animationTimer
42
object.frame >>= 2
43
GetBit(object.direction, object.animationTimer, 1)
44
45
foreach (GROUP_PLAYERS, currentPlayer, ACTIVE_ENTITIES)
46
BoxCollisionTest(C_TOUCH, object.entityPos, -8, -8, 8, 8, currentPlayer, C_BOX, C_BOX, C_BOX, C_BOX)
47
if checkResult == true
48
CallFunction(Player_FireHit)
49
end if
50
next
51
end event
52
53
54
event ObjectDraw
55
DrawSpriteFX(object.frame, FX_FLIP, object.xpos, object.ypos)
56
end event
57
58
59
event ObjectStartup
60
LoadSpriteSheet("CPZ/Objects.gif")
61
SpriteFrame(-6, -23, 12, 28, 5, 161)
62
SpriteFrame(-6, -26, 13, 31, 18, 158)
63
SpriteFrame(-5, -27, 14, 32, 32, 157)
64
65
SetTableValue(TypeName[Fireball], DebugMode_ObjCount, DebugMode_TypesTable)
66
SetTableValue(Fireball_DebugDraw, DebugMode_ObjCount, DebugMode_DrawTable)
67
SetTableValue(Fireball_DebugSpawn, DebugMode_ObjCount, DebugMode_SpawnTable)
68
DebugMode_ObjCount++
69
end event
70
71
72
// ========================
73
// Editor Events
74
// ========================
75
76
event RSDKDraw
77
DrawSprite(0)
78
end event
79
80
81
event RSDKLoad
82
LoadSpriteSheet("CPZ/Objects.gif")
83
SpriteFrame(-6, -23, 12, 28, 5, 161)
84
85
SetVariableAlias(ALIAS_VAR_PROPVAL, "unused")
86
end event
87
88