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