Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
rubberduckycooly
GitHub Repository: rubberduckycooly/Sonic-CD-2011-Script-Decompilation
Path: blob/main/Scripts/R7/BoundaryAdjust.txt
1319 views
1
//--------------Sonic CD Boundary Adjust Script---------------//
2
//--------Scripted by Christian Whitehead 'The Taxman'--------//
3
//-------Unpacked By Rubberduckycooly's Script Unpacker-------//
4
5
// Aliases
6
#alias 0 : BOUNDADJUST_TYPE_FROMRIGHT
7
#alias 1 : BOUNDADJUST_TYPE_FROMLEFT
8
9
10
sub ObjectMain
11
// hardcoded Y positions are used here :(
12
13
if Object.PropertyValue == BOUNDADJUST_TYPE_FROMRIGHT
14
if Player.XPos > Object.XPos
15
Stage.NewYBoundary2 = 520
16
else
17
Stage.NewYBoundary2 = 768
18
end if
19
else
20
if Player.XPos < Object.XPos
21
Stage.NewYBoundary2 = 520
22
else
23
Stage.NewYBoundary2 = 768
24
end if
25
end if
26
27
end sub
28
29
30
// ========================
31
// Editor Subs
32
// ========================
33
34
sub RSDKEdit
35
if Editor.ReturnVariable == true
36
switch Editor.VariableID
37
case EDIT_VAR_PROPVAL // Property Value
38
case 0 // Type
39
CheckResult = Object.PropertyValue
40
break
41
end switch
42
else
43
switch Editor.VariableID
44
case EDIT_VAR_PROPVAL // Property Value
45
case 0 // Type
46
Object.PropertyValue = Editor.VariableValue
47
break
48
end switch
49
end if
50
end sub
51
52
53
sub RSDKDraw
54
DrawSprite(0)
55
end sub
56
57
58
sub RSDKLoad
59
LoadSpriteSheet("Global/Display.gif")
60
SpriteFrame(-8, -8, 16, 16, 173, 67) // "T" (rigger) icon
61
62
// Not the best names, but there's not really much else that can be said...
63
AddEditorVariable("type")
64
SetActiveVariable("type")
65
AddEnumVariable("Right", BOUNDADJUST_TYPE_FROMRIGHT)
66
AddEnumVariable("Left", BOUNDADJUST_TYPE_FROMLEFT)
67
end sub
68
69