Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
rubberduckycooly
GitHub Repository: rubberduckycooly/Sonic-CD-2011-Script-Decompilation
Path: blob/main/Scripts/R6/Bomb.txt
1319 views
1
//---------------Sonic CD Semi Bomb 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.YVelocity
8
9
// States
10
#alias 0 : BOMB_FALLING
11
#alias 1 : BOMB_TICKING
12
13
// Collision Sides
14
#alias 0 : CSIDE_FLOOR
15
16
// Global SFX
17
#alias 22 : SFX_G_EXPLOSION
18
19
20
sub ObjectMain
21
if Object.State == BOMB_FALLING
22
Object.YPos += Object.YVelocity
23
Object.YVelocity += 0x2000
24
25
ObjectTileCollision(CSIDE_FLOOR, 0, 8, 0)
26
if CheckResult == true
27
Object.State = BOMB_TICKING
28
end if
29
else
30
if Object.Timer < 240
31
Object.Timer++
32
else
33
Object.Type = TypeName[Blank Object]
34
CreateTempObject(TypeName[Explosion], 0, Object.XPos, Object.YPos)
35
PlaySfx(SFX_G_EXPLOSION, false)
36
end if
37
38
if Object.Timer > 120
39
Object.Frame = Object.Timer
40
Object.Frame &= 3
41
Object.Frame >>= 1
42
end if
43
end if
44
45
if Object.OutOfBounds == true
46
Object.Type = TypeName[Blank Object]
47
end if
48
end sub
49
50
51
sub ObjectPlayerInteraction
52
PlayerObjectCollision(C_TOUCH, -8, -8, 8, 8)
53
if CheckResult == true
54
CallFunction(Player_Hit)
55
end if
56
end sub
57
58
59
sub ObjectDraw
60
DrawSprite(Object.Frame)
61
end sub
62
63
64
sub ObjectStartup
65
LoadSpriteSheet("R6/Objects.gif")
66
67
SpriteFrame(-8, -8, 16, 16, 43, 67) // #0 - Bomb
68
SpriteFrame(-8, -8, 16, 16, 60, 67) // #1 - Flashing Bomb
69
end sub
70
71
72
// ========================
73
// Editor Subs
74
// ========================
75
76
sub RSDKDraw
77
DrawSprite(0)
78
end sub
79
80
81
sub RSDKLoad
82
LoadSpriteSheet("R6/Objects.gif")
83
84
SpriteFrame(-8, -8, 16, 16, 43, 67) // #0 - Bomb
85
86
SetVariableAlias(ALIAS_VAR_PROPVAL, "unused")
87
end sub
88
89