Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
rubberduckycooly
GitHub Repository: rubberduckycooly/Sonic-CD-2011-Script-Decompilation
Path: blob/main/Scripts/R6/BossBarrier2.txt
1319 views
1
//---------------Sonic CD Boss Barrier 2 Script---------------//
2
//--------Scripted by Christian Whitehead 'The Taxman'--------//
3
//-------Unpacked By Rubberduckycooly's Script Unpacker-------//
4
5
// Aliases
6
#alias Object.Value0 : Object.BarrierHeight
7
8
// States
9
#alias 0 : BOSSBARRIER2_IDLE
10
#alias 1 : BOSSBARRIER2_UNUSED
11
#alias 2 : BOSSBARRIER2_OPEN
12
13
14
sub ObjectMain
15
switch Object.State
16
case BOSSBARRIER2_IDLE
17
break
18
19
case BOSSBARRIER2_UNUSED
20
if Object.BarrierHeight < 0x600000
21
Object.BarrierHeight += 0x20000
22
Object.YPos -= 0x20000
23
end if
24
TempValue0 = Player.XPos
25
TempValue0 -= Object.XPos
26
break
27
28
case BOSSBARRIER2_OPEN
29
if Object.BarrierHeight < 0x600000
30
Object.BarrierHeight += 0x20000
31
Object.YPos -= 0x20000
32
else
33
Object.State = BOSSBARRIER2_IDLE
34
end if
35
break
36
end switch
37
end sub
38
39
40
sub ObjectPlayerInteraction
41
if Object.BarrierHeight < 1
42
PlayerObjectCollision(C_BOX, -16, -48, 16, 64)
43
else
44
PlayerObjectCollision(C_BOX, -16, -48, 16, 48)
45
end if
46
end sub
47
48
49
sub ObjectDraw
50
DrawSprite(0)
51
DrawSprite(1)
52
DrawSprite(2)
53
DrawSprite(3)
54
end sub
55
56
57
sub ObjectStartup
58
LoadSpriteSheet("R6/Objects2.gif")
59
60
SpriteFrame(-16, -48, 32, 32, 173, 223) // #0 - Barrier Top
61
SpriteFrame(-16, -16, 32, 32, 173, 223) // #1 - Barrier Middle
62
SpriteFrame(-16, 16, 32, 32, 173, 223) // #2 - Barrier Bottom
63
64
SpriteFrame(-32, 10, 16, 32, 239, 216) // #3 - Boss Electrode
65
end sub
66
67
68
// ========================
69
// Editor Subs
70
// ========================
71
72
sub RSDKDraw
73
DrawSprite(0)
74
DrawSprite(1)
75
DrawSprite(2)
76
DrawSprite(3)
77
end sub
78
79
80
sub RSDKLoad
81
LoadSpriteSheet("R6/Objects2.gif")
82
83
SpriteFrame(-16, -48, 32, 32, 173, 223) // #0 - Barrier Top
84
SpriteFrame(-16, -16, 32, 32, 173, 223) // #1 - Barrier Middle
85
SpriteFrame(-16, 16, 32, 32, 173, 223) // #2 - Barrier Bottom
86
87
SpriteFrame(-32, 10, 16, 32, 239, 216) // #3 - Boss Electrode
88
89
SetVariableAlias(ALIAS_VAR_PROPVAL, "unused")
90
end sub
91
92