Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
rubberduckycooly
GitHub Repository: rubberduckycooly/Sonic-CD-2011-Script-Decompilation
Path: blob/main/Scripts/R6/PohBeeBullet.txt
1319 views
1
//---------------Sonic CD PohBee Bullet Script----------------//
2
//--------Scripted by Christian Whitehead 'The Taxman'--------//
3
//-------Unpacked By Rubberduckycooly's Script Unpacker-------//
4
5
// Aliases
6
#alias Object.Value0 : Object.Timer
7
#alias Object.Value1 : Object.XVelocity
8
#alias Object.Value2 : Object.YVelocity
9
10
// States
11
#alias 0 : POHBEEBULLET_BURST
12
#alias 1 : POHBEEBULLET_FIRE
13
#alias 2 : POHBEEBULLET_PROJECTILE
14
15
16
sub ObjectMain
17
switch Object.State
18
case POHBEEBULLET_BURST
19
if Object.Timer < 4
20
Object.Timer++
21
else
22
Object.Timer = 0
23
Object.State++
24
Object.Frame = 1
25
end if
26
break
27
28
case POHBEEBULLET_FIRE
29
Object.XPos += Object.XVelocity
30
Object.YPos += Object.YVelocity
31
if Object.Timer < 12
32
Object.Timer++
33
else
34
Object.Timer = 0
35
Object.State++
36
Object.Frame = 2
37
end if
38
break
39
40
case POHBEEBULLET_PROJECTILE
41
Object.XPos += Object.XVelocity
42
Object.YPos += Object.YVelocity
43
if Object.Timer > 1
44
Object.Frame = 3
45
else
46
Object.Frame = 2
47
end if
48
Object.Timer++
49
Object.Timer &= 3
50
break
51
end switch
52
53
if Object.OutOfBounds == true
54
Object.Type = TypeName[Blank Object]
55
end if
56
end sub
57
58
59
sub ObjectPlayerInteraction
60
if Object.State > POHBEEBULLET_BURST
61
PlayerObjectCollision(C_TOUCH, -6, -6, 6, 6)
62
if CheckResult == true
63
CallFunction(Player_Hit)
64
end if
65
end if
66
end sub
67
68
69
sub ObjectDraw
70
DrawSpriteFX(Object.Frame, FX_FLIP, Object.XPos, Object.YPos)
71
end sub
72
73
74
sub ObjectStartup
75
LoadSpriteSheet("R6/Objects.gif")
76
77
SpriteFrame(-8, -8, 16, 16, 197, 68) // #0 - Firing Animation frame 0
78
SpriteFrame(-8, -8, 16, 16, 69, 117) // #1 - Firing Animation frame 1
79
80
SpriteFrame(-8, -8, 16, 16, 1, 134) // #2 - Bullet Animation frame 0
81
SpriteFrame(-8, -8, 16, 16, 17, 134) // #3 - Bullet Animation frame 1
82
end sub
83
84
85
// ========================
86
// Editor Subs
87
// ========================
88
89
sub RSDKDraw
90
DrawSprite(0)
91
end sub
92
93
94
sub RSDKLoad
95
LoadSpriteSheet("R6/Objects.gif")
96
SpriteFrame(-8, -8, 16, 16, 1, 134) // #0 - Bullet Animation
97
98
SetVariableAlias(ALIAS_VAR_PROPVAL, "unused")
99
end sub
100
101