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/ARZ/Arrow.txt
1480 views
1
// ----------------------------------
2
// RSDK Project: Sonic 2
3
// Script Description: Arrow 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
private alias object.value1 : object.drawIndex
14
private alias object.value2 : object.drawPos.x
15
16
// Path ID Aliases
17
private alias 0 : PATH_A
18
19
20
// ========================
21
// Events
22
// ========================
23
24
event ObjectUpdate
25
if object.timer > 0
26
object.timer--
27
if object.timer == 15
28
PlaySfx(SfxName[Small Fireball], false)
29
end if
30
end if
31
32
if object.timer < 16
33
object.xpos += object.xvel
34
end if
35
36
if object.timer < 12
37
if object.drawIndex == 2
38
if object.direction == FLIP_NONE
39
ObjectTileCollision(CSIDE_LWALL, -16, 0, PATH_A)
40
else
41
ObjectTileCollision(CSIDE_RWALL, 16, 0, PATH_A)
42
end if
43
44
if checkResult == true
45
object.type = TypeName[Blank Object]
46
end if
47
else
48
if object.direction == FLIP_NONE
49
ObjectTileCollision(CSIDE_LWALL, 16, 0, PATH_A)
50
else
51
ObjectTileCollision(CSIDE_RWALL, -16, 0, PATH_A)
52
end if
53
54
if checkResult == true
55
object.drawIndex = 2
56
object.drawOrder = 1
57
end if
58
end if
59
end if
60
61
foreach (GROUP_PLAYERS, currentPlayer, ACTIVE_ENTITIES)
62
BoxCollisionTest(C_TOUCH, object.entityPos, -8, -4, 8, 4, currentPlayer, C_BOX, C_BOX, C_BOX, C_BOX)
63
if checkResult == true
64
CallFunction(Player_Hit)
65
end if
66
next
67
68
if object.outOfBounds == true
69
object.type = TypeName[Blank Object]
70
end if
71
end event
72
73
74
event ObjectDraw
75
if object.drawIndex == 2
76
DrawSpriteFX(0, FX_FLIP, object.xpos, object.ypos)
77
else
78
if object.drawIndex == 0
79
AddDrawListEntityRef(2, object.entityPos)
80
else
81
if object.timer > 0
82
DrawSpriteFX(1, FX_FLIP, object.drawPos.x, object.ypos)
83
end if
84
85
if object.timer < 16
86
DrawSpriteFX(0, FX_FLIP, object.xpos, object.ypos)
87
end if
88
end if
89
90
object.drawIndex ^= 1
91
end if
92
end event
93
94
95
event ObjectStartup
96
LoadSpriteSheet("ARZ/Objects.gif")
97
98
// Arrow frames
99
SpriteFrame(-16, -4, 32, 7, 1, 69)
100
SpriteFrame(11, -8, 5, 16, 53, 65)
101
end event
102
103
104
// ========================
105
// Editor Events
106
// ========================
107
108
event RSDKDraw
109
DrawSprite(0)
110
end event
111
112
113
event RSDKLoad
114
LoadSpriteSheet("ARZ/Objects.gif")
115
SpriteFrame(-16, -4, 32, 7, 1, 69)
116
117
SetVariableAlias(ALIAS_VAR_PROPVAL, "unused")
118
end event
119
120