Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
rubberduckycooly
GitHub Repository: rubberduckycooly/Sonic-CD-2011-Script-Decompilation
Path: blob/main/Scripts/R3/FPlatform.txt
1319 views
1
//--------------Sonic CD Floating Platform Script-------------//
2
//--------Scripted by Christian Whitehead 'The Taxman'--------//
3
//-------Unpacked By Rubberduckycooly's Script Unpacker-------//
4
5
// Aliases
6
#alias Object.Value0 : Object.OnObject
7
#alias Object.Value1 : Object.Timer
8
#alias Object.Value2 : Object.YPlayerFloor
9
#alias Object.Value3 : Object.YOriginPos
10
11
12
sub ObjectMain
13
if Object.OnObject == true
14
if Object.Timer < 16
15
Object.Timer++
16
17
TempValue0 = Object.Timer
18
TempValue0 &= 3
19
20
if TempValue0 == 3
21
Object.YPlayerFloor = 0x10000
22
else
23
Object.YPlayerFloor = 0
24
end if
25
else
26
Object.YPlayerFloor = 0
27
end if
28
else
29
if Object.Timer > 0
30
Object.Timer--
31
32
TempValue0 = Object.Timer
33
TempValue0 &= 3
34
35
if TempValue0 == 3
36
Object.YPlayerFloor = -0x10000
37
else
38
Object.YPlayerFloor = 0
39
end if
40
else
41
Object.YPlayerFloor = 0
42
Object.YPos = Object.YOriginPos
43
end if
44
end if
45
46
Object.OnObject = false
47
end sub
48
49
50
sub ObjectPlayerInteraction
51
PlayerObjectCollision(C_PLATFORM, -32, -17, 32, 12)
52
if CheckResult == true
53
Object.OnObject = true
54
Player.YPos += Object.YPlayerFloor
55
Player.YPos += 0x10000
56
end if
57
end sub
58
59
60
sub ObjectDraw
61
Object.YPos += Object.YPlayerFloor
62
DrawSprite(0)
63
end sub
64
65
66
sub ObjectStartup
67
LoadSpriteSheet("R3/Objects.gif")
68
69
SpriteFrame(-32, -16, 64, 32, 100, 1) // #0 - Floating Platform
70
71
ArrayPos0 = 32
72
while ArrayPos0 < 1056
73
if Object[ArrayPos0].Type == TypeName[F Platform]
74
Object[ArrayPos0].YOriginPos = Object[ArrayPos0].YPos
75
end if
76
ArrayPos0++
77
loop
78
end sub
79
80
81
// ========================
82
// Editor Subs
83
// ========================
84
85
86
sub RSDKDraw
87
DrawSprite(0)
88
end sub
89
90
91
sub RSDKLoad
92
LoadSpriteSheet("R3/Objects.gif")
93
94
SpriteFrame(-32, -16, 64, 32, 100, 1) // #0 - Floating Platform
95
96
SetVariableAlias(ALIAS_VAR_PROPVAL, "unused")
97
end sub
98
99