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/Enemies/OctusShot.txt
1480 views
1
// ----------------------------------
2
// RSDK Project: Sonic 2
3
// Script Description: Octus Shot Object
4
// Script Author: Christian Whitehead/Simon Thomley
5
// Unpacked by Rubberduckycooly's script unpacker
6
// ----------------------------------
7
8
9
// ========================
10
// Aliases
11
// ========================
12
13
// Player Aliases
14
private alias object.state : player.state
15
16
17
// ========================
18
// Events
19
// ========================
20
21
event ObjectUpdate
22
object.xpos += object.xvel
23
object.ypos += object.yvel
24
25
// Check collision with players
26
foreach (GROUP_PLAYERS, currentPlayer, ACTIVE_ENTITIES)
27
if player[currentPlayer].state != Player_State_Static
28
BoxCollisionTest(C_TOUCH, object.entityPos, -4, -4, 4, 4, currentPlayer, C_BOX, C_BOX, C_BOX, C_BOX)
29
30
if checkResult == true
31
CallFunction(Player_ProjectileHit)
32
end if
33
end if
34
next
35
36
// Animate the object
37
object.frame = object.animationTimer
38
object.frame /= 3
39
object.animationTimer++
40
if object.animationTimer >= 6
41
object.animationTimer = 0
42
end if
43
44
if object.outOfBounds == true
45
object.type = TypeName[Blank Object]
46
end if
47
end event
48
49
50
event ObjectDraw
51
DrawSpriteFX(object.frame, FX_FLIP, object.xpos, object.ypos)
52
end event
53
54
55
event ObjectStartup
56
CheckCurrentStageFolder("Zone07")
57
if checkResult == true
58
LoadSpriteSheet("OOZ/Objects.gif")
59
SpriteFrame(-3, -3, 6, 6, 92, 32)
60
SpriteFrame(-4, -4, 8, 8, 92, 39)
61
else
62
LoadSpriteSheet("MBZ/Objects.gif")
63
SpriteFrame(-3, -3, 6, 6, 910, 332)
64
SpriteFrame(-4, -4, 8, 8, 910, 323)
65
end if
66
end event
67
68
69
// ========================
70
// Editor Events
71
// ========================
72
73
event RSDKDraw
74
DrawSprite(0)
75
end event
76
77
78
event RSDKLoad
79
CheckCurrentStageFolder("Zone07")
80
if checkResult == true
81
LoadSpriteSheet("OOZ/Objects.gif")
82
SpriteFrame(-3, -3, 6, 6, 92, 32)
83
else
84
LoadSpriteSheet("MBZ/Objects.gif")
85
SpriteFrame(-3, -3, 6, 6, 910, 332)
86
end if
87
88
SetVariableAlias(ALIAS_VAR_PROPVAL, "unused")
89
end event
90
91