Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
rubberduckycooly
GitHub Repository: rubberduckycooly/Sonic-CD-2011-Script-Decompilation
Path: blob/main/Scripts/R6/EggmanEscape.txt
1319 views
1
//---------------Sonic CD Eggman Escape 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.Value1 : Object.XVelocity
8
9
// Destroyed Egg Mobile Alias
10
#alias Object[-1].XPos : DestroyedMobile.XPos
11
12
// States
13
#alias 0 : EGG_ESCAPE_FADE_IN
14
#alias 1 : EGG_ESCAPE_FLEE
15
16
// Priority
17
#alias 1 : PRIORITY_ACTIVE
18
19
20
sub ObjectMain
21
switch Object.State
22
case EGG_ESCAPE_FADE_IN
23
Player.XPos = DestroyedMobile.XPos
24
Player.Speed = 0
25
if Object.Timer < 120
26
Object.Timer++
27
else
28
Player.Score += 1000
29
Object.Timer = 0
30
Object.Priority = PRIORITY_ACTIVE
31
Object.XVelocity = 0x8000
32
Object.State++
33
end if
34
break
35
36
case EGG_ESCAPE_FLEE
37
Object.XVelocity += 0xC00
38
Object.XPos += Object.XVelocity
39
if Object.OutOfBounds == true
40
ResetObjectEntity(Object.EntityNo, TypeName[Blank Object], 0, 0, 0)
41
end if
42
break
43
end switch
44
end sub
45
46
47
sub ObjectDraw
48
TempValue0 = Object.Frame
49
TempValue0 /= 6
50
DrawSprite(TempValue0)
51
52
Object.Frame++
53
Object.Frame %= 24
54
55
TempValue0 = Object.AnimationTimer
56
TempValue0 /= 6
57
TempValue0 += 4
58
59
TempValue1 = Object.AnimationTimer
60
TempValue1 %= 6
61
if TempValue1 < 3
62
DrawSprite(TempValue0)
63
end if
64
65
Object.AnimationTimer++
66
Object.AnimationTimer %= 12
67
end sub
68
69
70
sub ObjectStartup
71
LoadSpriteSheet("R6/Objects2.gif")
72
73
SpriteFrame(-32, -25, 64, 48, 1, 170) // #0 - Eggman Running Frame 0
74
SpriteFrame(-32, -23, 48, 56, 66, 131) // #1 - Eggman Running Frame 1
75
SpriteFrame(-32, -21, 56, 56, 66, 199) // #2 - Eggman Running Frame 2
76
SpriteFrame(-32, -23, 48, 56, 66, 131) // #3 - Eggman Running Frame 3
77
78
SpriteFrame(-32, -36, 16, 16, 237, 1) // #4 - Sweat Frame 0
79
SpriteFrame(-32, -36, 16, 16, 181, 207) // #5 - Sweat Frame 1
80
end sub
81
82
83
// ========================
84
// Editor Subs
85
// ========================
86
87
sub RSDKDraw
88
DrawSprite(0)
89
end sub
90
91
92
sub RSDKLoad
93
LoadSpriteSheet("R6/Objects2.gif")
94
95
SpriteFrame(-32, -25, 64, 48, 1, 170) // #0 - Eggman Running Frame 0
96
97
SetVariableAlias(ALIAS_VAR_PROPVAL, "unused")
98
end sub
99
100