Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
rubberduckycooly
GitHub Repository: rubberduckycooly/Sonic-CD-2011-Script-Decompilation
Path: blob/main/Scripts/R3/Fireball.txt
1319 views
1
//-----------------Sonic CD Fireball Script-------------------//
2
//--------Scripted by Christian Whitehead 'The Taxman'--------//
3
//-------Unpacked By Rubberduckycooly's Script Unpacker-------//
4
5
// Aliases
6
#alias Object.Value0 : Object.Fade
7
#alias Object.Value1 : Object.XVelocity
8
9
10
sub ObjectMain
11
Object.XPos += Object.XVelocity
12
if Object.XVelocity > 0
13
Object.XVelocity += 0x1000
14
else
15
Object.XVelocity -= 0x1000
16
end if
17
18
if Object.OutOfBounds == true
19
Object.Type = TypeName[Blank Object]
20
else
21
TempValue0 = Screen.YOffset
22
TempValue0 -= 8
23
TempValue0 <<= 16
24
if Object.YPos < TempValue0
25
Object.Type = TypeName[Blank Object]
26
end if
27
end if
28
29
if Object.Fade > 0
30
Object.Fade--
31
if Object.Fade < 32
32
Object.Alpha = Object.Fade
33
Object.Alpha <<= 3
34
end if
35
else
36
Object.Type = TypeName[Blank Object]
37
end if
38
end sub
39
40
41
sub ObjectPlayerInteraction
42
PlayerObjectCollision(C_TOUCH, -8, -6, 8, 6)
43
if CheckResult == true
44
CallFunction(Player_Hit)
45
end if
46
end sub
47
48
49
sub ObjectDraw
50
DrawSpriteFX(Object.Frame, FX_INK, Object.XPos, Object.YPos)
51
end sub
52
53
54
sub ObjectStartup
55
LoadSpriteSheet("R3/Objects.gif")
56
57
SpriteFrame(-8, -8, 16, 16, 230, 1) // #0 - Fireball facing left
58
SpriteFrame(-8, -8, 16, 16, 230, 18) // #1 - Fireball facing right
59
end sub
60
61
62
// ========================
63
// Editor Subs
64
// ========================
65
66
sub RSDKDraw
67
DrawSprite(object.PropertyValue)
68
end sub
69
70
71
sub RSDKLoad
72
LoadSpriteSheet("R3/Objects.gif")
73
74
SpriteFrame(-8, -8, 16, 16, 230, 1) // #0 - Fireball facing left
75
SpriteFrame(-8, -8, 16, 16, 230, 18) // #1 - Fireball facing right
76
77
SetVariableAlias(ALIAS_VAR_PROPVAL, "direction")
78
end sub
79
80