Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
rubberduckycooly
GitHub Repository: rubberduckycooly/Sonic-CD-2011-Script-Decompilation
Path: blob/main/Scripts/R7/KabasiraShot.txt
1319 views
1
//---------------Sonic CD Kabasira Shot Script----------------//
2
//--------Scripted by Christian Whitehead 'The Taxman'--------//
3
//-------Unpacked By Rubberduckycooly's Script Unpacker-------//
4
5
// Aliases
6
// Value0 is skipped over
7
#alias Object.Value1 : Object.XVelocity
8
#alias Object.Value2 : Object.YVelocity
9
10
// Global SFX
11
#alias 22 : SFX_G_EXPLOSION
12
13
#alias 0 : DIRECTION_RIGHT
14
#alias 1 : DIRECTION_LEFT
15
16
17
sub ObjectMain
18
// Update movement
19
Object.XPos += Object.XVelocity
20
Object.YPos += Object.YVelocity
21
22
if Object.OutOfBounds == true
23
Object.Type = TypeName[Blank Object]
24
end if
25
26
end sub
27
28
29
sub ObjectPlayerInteraction
30
PlayerObjectCollision(C_TOUCH, -6, -6, 6, 6)
31
32
if CheckResult == true
33
if Player.Animation == ANI_JUMPING
34
ResetObjectEntity(Object.EntityNo, TypeName[Explosion], 0, Object.XPos, Object.YPos)
35
PlaySfx(SFX_G_EXPLOSION, false)
36
else
37
if Player.Animation == ANI_SPINDASH
38
ResetObjectEntity(Object.EntityNo, TypeName[Explosion], 0, Object.XPos, Object.YPos)
39
PlaySfx(SFX_G_EXPLOSION, false)
40
else
41
// The player's not in an attacking animation, go ahead and hurt them
42
CallFunction(Player_Hit)
43
end if
44
end if
45
end if
46
47
end sub
48
49
50
sub ObjectDraw
51
// Use different sprites based on the shot's direction
52
if Object.PropertyValue == DIRECTION_RIGHT
53
// Going right!
54
55
DrawSpriteFX(0, FX_INK, Object.XPos, Object.YPos)
56
DrawSpriteFX(1, FX_INK, Object.XPos, Object.YPos)
57
else
58
// Heading left!
59
60
DrawSpriteFX(2, FX_INK, Object.XPos, Object.YPos)
61
DrawSpriteFX(3, FX_INK, Object.XPos, Object.YPos)
62
end if
63
64
end sub
65
66
67
sub ObjectStartup
68
69
LoadSpriteSheet("R7/Objects.gif")
70
71
// 0-1 - Going Right Frames
72
SpriteFrame(-8, -8, 16, 16, 133, 100)
73
SpriteFrame(-8, -6, 8, 8, 243, 101)
74
75
// 2-3 - Going Left Frames
76
SpriteFrame(-8, -8, 16, 16, 201, 100)
77
SpriteFrame( 4, -6, 8, 8, 240, 65)
78
79
end sub
80
81
82
// ========================
83
// Editor Subs
84
// ========================
85
86
sub RSDKDraw
87
if Object.PropertyValue == DIRECTION_RIGHT
88
DrawSpriteFX(0, FX_INK, Object.XPos, Object.YPos)
89
DrawSpriteFX(1, FX_INK, Object.XPos, Object.YPos)
90
else
91
DrawSpriteFX(2, FX_INK, Object.XPos, Object.YPos)
92
DrawSpriteFX(3, FX_INK, Object.XPos, Object.YPos)
93
end if
94
end sub
95
96
97
sub RSDKLoad
98
LoadSpriteSheet("R7/Objects.gif")
99
100
SpriteFrame(-8, -8, 16, 16, 133, 100)
101
SpriteFrame(-8, -6, 8, 8, 243, 101)
102
103
SpriteFrame(-8, -8, 16, 16, 201, 100)
104
SpriteFrame( 4, -6, 8, 8, 240, 65)
105
106
// Although used by the object, this object shouldn't even be placed in the scene at all
107
// (i still set up a object preview for it anyway though :)
108
SetVariableAlias(ALIAS_VAR_PROPVAL, "unused")
109
end sub
110
111