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/WFZ/LargeLaser.txt
1479 views
1
// ----------------------------------
2
// RSDK Project: Sonic 2
3
// Script Description: Large Laser 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 LargeLaser_DebugDraw
13
reserve function LargeLaser_DebugSpawn
14
15
16
// ========================
17
// Function Definitions
18
// ========================
19
20
private function LargeLaser_DebugDraw
21
DrawSprite(0)
22
end function
23
24
25
private function LargeLaser_DebugSpawn
26
CreateTempObject(TypeName[Large Laser], 0, object.xpos, object.ypos)
27
object[tempObjectPos].inkEffect = INK_ALPHA
28
object[tempObjectPos].alpha = 0xC0
29
end function
30
31
32
// ========================
33
// Events
34
// ========================
35
36
event ObjectUpdate
37
object.animationTimer++
38
if object.animationTimer == 1
39
PlaySfx(SfxName[Thruster], false)
40
end if
41
42
if object.animationTimer >= 64
43
object.type = TypeName[Blank Object]
44
end if
45
46
foreach (GROUP_PLAYERS, currentPlayer, ACTIVE_ENTITIES)
47
BoxCollisionTest(C_TOUCH, object.entityPos, -24, -112, 24, 112, currentPlayer, C_BOX, C_BOX, C_BOX, C_BOX)
48
if checkResult == true
49
CallFunction(Player_Hit)
50
end if
51
next
52
end event
53
54
55
event ObjectDraw
56
DrawSpriteFX(0, FX_INK, object.xpos, object.ypos)
57
end event
58
59
60
event ObjectStartup
61
LoadSpriteSheet("SCZ/Objects.gif")
62
SpriteFrame(-24, -112, 48, 256, 464, 0)
63
64
foreach (TypeName[Large Laser], arrayPos0, ALL_ENTITIES)
65
object[arrayPos0].inkEffect = INK_ALPHA
66
object[arrayPos0].alpha = 0xC0
67
next
68
69
SetTableValue(TypeName[Large Laser], DebugMode_ObjCount, DebugMode_TypesTable)
70
SetTableValue(LargeLaser_DebugDraw, DebugMode_ObjCount, DebugMode_DrawTable)
71
SetTableValue(LargeLaser_DebugSpawn, DebugMode_ObjCount, DebugMode_SpawnTable)
72
DebugMode_ObjCount++
73
end event
74
75
76
// ========================
77
// Editor Events
78
// ========================
79
80
event RSDKDraw
81
DrawSprite(0)
82
end event
83
84
85
event RSDKLoad
86
LoadSpriteSheet("SCZ/Objects.gif")
87
SpriteFrame(-24, -112, 48, 256, 464, 0)
88
89
SetVariableAlias(ALIAS_VAR_PROPVAL, "unused")
90
end event
91
92