Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
rubberduckycooly
GitHub Repository: rubberduckycooly/Sonic-CD-2011-Script-Decompilation
Path: blob/main/Scripts/R1/EggJetpack.txt
1319 views
1
//---------------Sonic CD Eggman Jetpack Script---------------//
2
//--------Scripted by Christian Whitehead 'The Taxman'--------//
3
//-------Unpacked By Rubberduckycooly's Script Unpacker-------//
4
5
// Aliases
6
#alias Object.Value0 : Object.Timer
7
#alias Object.Value3 : Object.Oscillation
8
#alias Object.Value4 : Object.YOriginPos
9
10
// BossFace Aliases
11
#alias Object[-1].State : BossFace.State
12
#alias Object[-1].Rotation : BossFace.Timer
13
14
// States
15
#alias 0 : R1_EGGMAN_FLY_UP
16
#alias 2 : R1_EGGMAN_ESCAPE
17
18
// Boss Face States
19
#alias 5 : R1_EGGMAN_RESTORE_BOUNDS
20
21
22
sub ObjectMain
23
switch Object.State
24
case R1_EGGMAN_FLY_UP
25
if Object.Timer < 64
26
Object.Timer++
27
if Object.Timer > 27
28
Object.XPos += 0x8000
29
30
Object.YPos -= 0x20000
31
end if
32
else
33
Object.Timer = 0
34
Object.State = R1_EGGMAN_ESCAPE
35
Object.YOriginPos = Object.YPos
36
end if
37
break
38
39
case R1_EGGMAN_ESCAPE
40
Object.Oscillation += 3
41
Object.Oscillation &= 255
42
Sin256(TempValue0, Object.Oscillation)
43
TempValue0 <<= 11
44
45
Object.XPos += 0x28000
46
47
Object.YPos = Object.YOriginPos
48
Object.YPos -= TempValue0
49
50
if Object.OutOfBounds == true
51
Object.Type = TypeName[Blank Object]
52
BossFace.State = R1_EGGMAN_RESTORE_BOUNDS
53
BossFace.Timer = 0
54
end if
55
break
56
end switch
57
end sub
58
59
60
sub ObjectDraw
61
TempValue0 = Object.Frame
62
TempValue0 >>= 2
63
TempValue0 += Object.State
64
65
DrawSprite(TempValue0)
66
67
Object.Frame++
68
Object.Frame &= 7
69
end sub
70
71
72
sub ObjectStartup
73
LoadSpriteSheet("R1/Objects3.gif")
74
75
SpriteFrame(-28, -24, 56, 56, 1, 107) // #0 - Eggman Jetpack Frame 0
76
SpriteFrame(-28, -24, 56, 56, 1, 164) // #1 - Eggman Jetpack Frame 1
77
SpriteFrame(-28, -24, 56, 56, 58, 107) // #2 - Eggman Jetpack Frame 2
78
SpriteFrame(-28, -24, 56, 56, 58, 164) // #3 - Eggman Jetpack Frame 3
79
end sub
80
81
82
// ========================
83
// Editor Subs
84
// ========================
85
86
sub RSDKDraw
87
DrawSprite(0)
88
end sub
89
90
91
sub RSDKLoad
92
LoadSpriteSheet("R1/Objects3.gif")
93
SpriteFrame(-28, -24, 56, 56, 1, 107) // #0 - Eggman Jetpack Frame 0
94
95
SetVariableAlias(ALIAS_VAR_PROPVAL, "unused")
96
end sub
97
98