Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
rubberduckycooly
GitHub Repository: rubberduckycooly/Sonic-CD-2011-Script-Decompilation
Path: blob/main/Scripts/Mission/MissionAreaBL.txt
1319 views
1
//----------Sonic CD Mission Area Bottom Left Script----------//
2
//--------Scripted by Christian Whitehead 'The Taxman'--------//
3
//-------Unpacked By Rubberduckycooly's Script Unpacker-------//
4
5
// Aliases
6
#alias Object.State : Object.SetBounds
7
8
// Priority
9
#alias 1 : PRIORITY_ACTIVE
10
#alias 5 : PRIORITY_INACTIVE
11
12
13
sub ObjectMain
14
15
// If it hasn't been done already, set the Stage's Bottom Left boundaries
16
if Object.SetBounds == false
17
18
// Move the X Bounds to 16 pixels to the left of this Object
19
Stage.NewXBoundary1 = Object.XPos
20
Stage.NewXBoundary1 >>= 16
21
Stage.NewXBoundary1 -= 16
22
23
// And then move the Y Bounds to be right at this Object's position
24
Stage.NewYBoundary2 = Object.YPos
25
Stage.NewYBoundary2 >>= 16
26
27
// Set the flag, as the bounds have been set now
28
Object.SetBounds = true
29
end if
30
31
if Stage.State == STAGE_RUNNING
32
if Player.YPos > Object.YPos
33
CheckEqual(Player.State, Player_State_Death)
34
TempValue0 = CheckResult
35
CheckEqual(Player.State, Player_State_Drown)
36
CheckResult |= TempValue0
37
if CheckResult == false
38
Player.YVelocity = 0
39
Player.Speed = 0
40
Player.YPos = Object.YPos
41
game.forceKillPlayer = true
42
end if
43
44
// Stop the object from running any further
45
Object.Priority = PRIORITY_INACTIVE
46
end if
47
48
if Player.XPos < Object.XPos
49
Player.XVelocity = 0
50
Player.Speed = 0
51
Player.XPos = Object.XPos
52
end if
53
end if
54
55
end sub
56
57
58
sub ObjectStartup
59
60
// Cycle through all objects in the scene, and make all Mission Area markers active
61
ArrayPos0 = 32
62
while ArrayPos0 < 1056
63
if Object[ArrayPos0].Type == TypeName[MissionAreaBL]
64
Object[ArrayPos0].Priority = PRIORITY_ACTIVE
65
end if
66
67
ArrayPos0++
68
loop
69
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("Mission/Objects.gif")
84
SpriteFrame(-16, -16, 32, 32, 1, 34) // #0 - "Bottom Left" Editor Icon
85
86
SetVariableAlias(ALIAS_VAR_PROPVAL, "unused")
87
end sub
88
89