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/Laser.txt
1480 views
1
// ----------------------------------
2
// RSDK Project: Sonic 2
3
// Script Description: Laser Object
4
// Script Author: Christian Whitehead/Simon Thomley
5
// Unpacked by Rubberduckycooly's script unpacker
6
// ----------------------------------
7
8
// ========================
9
// Aliases
10
// ========================
11
12
// States
13
private alias 0 : LASER_WAITING
14
private alias 1 : LASER_FIRED
15
16
// Player Aliases
17
private alias object.xpos : player.xpos
18
19
20
// ========================
21
// Events
22
// ========================
23
24
event ObjectUpdate
25
if object.state == LASER_WAITING
26
temp0 = object.xpos
27
temp0 -= 0xE80000
28
if player[0].xpos >= temp0
29
if player[0].xpos < object.xpos
30
PlaySfx(SfxName[Medium Laser], false)
31
end if
32
33
object.state++
34
end if
35
else
36
if object.alpha < 0x100
37
object.alpha += 0x10
38
end if
39
40
object.xpos -= 0x100000
41
if object.outOfBounds == true
42
object.type = TypeName[Blank Object]
43
end if
44
end if
45
end event
46
47
48
event ObjectDraw
49
if object.state == LASER_FIRED
50
DrawSpriteFX(0, FX_INK, object.xpos, object.ypos)
51
end if
52
end event
53
54
55
event ObjectStartup
56
LoadSpriteSheet("SCZ/Objects.gif")
57
SpriteFrame(-72, -8, 144, 16, 81, 198)
58
59
foreach (TypeName[Laser], arrayPos0, ALL_ENTITIES)
60
object[arrayPos0].drawOrder = 5
61
object[arrayPos0].inkEffect = INK_ALPHA
62
object[arrayPos0].priority = PRIORITY_ACTIVE
63
next
64
end event
65
66
67
// ========================
68
// Editor Events
69
// ========================
70
71
event RSDKDraw
72
DrawSprite(0)
73
end event
74
75
76
event RSDKLoad
77
LoadSpriteSheet("SCZ/Objects.gif")
78
SpriteFrame(-72, -8, 144, 16, 81, 198)
79
80
// Normally set to 118 in the scene for some reason, that value's unused though
81
SetVariableAlias(ALIAS_VAR_PROPVAL, "unused")
82
end event
83
84