Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
rubberduckycooly
GitHub Repository: rubberduckycooly/Sonic-CD-2011-Script-Decompilation
Path: blob/main/Scripts/DAGarden/DrEggman.txt
1319 views
1
//-----------------Sonic CD Dr.Eggman Script------------------//
2
//--------Scripted by Christian Whitehead 'The Taxman'--------//
3
//-------Unpacked By Rubberduckycooly's Script Unpacker-------//
4
5
// Aliases
6
#alias Object.Value1 : Object.YOffSet
7
#alias Object.Value2 : Object.Wobble
8
#alias Object.PropertyValue : Object.WobbleIncrease
9
10
// States
11
#alias 0 : EGGMAN_SETUP
12
#alias 1 : EGGMAN_MOVEMENT
13
14
15
sub ObjectMain
16
if Object.Direction == FACING_LEFT
17
Object.XPos += 0x8000
18
else
19
Object.XPos -= 0x8000
20
end if
21
22
switch Object.State
23
case EGGMAN_SETUP
24
Object.YOffSet = Object.YPos
25
Object.State++
26
break
27
28
case EGGMAN_MOVEMENT
29
Object.Wobble += Object.WobbleIncrease
30
Object.Wobble &= 511
31
Sin(Object.YPos, Object.Wobble)
32
Object.YPos <<= 11
33
Object.YPos += Object.YOffSet
34
Object.YOffSet -= 0x4000
35
break
36
37
end switch
38
39
if Object.OutOfBounds == true
40
Object.Type = TypeName[Blank Object]
41
end if
42
end sub
43
44
45
sub ObjectDraw
46
// Smoke
47
TempValue0 = Object.AnimationTimer
48
TempValue0 >>= 1
49
TempValue0 += 2
50
DrawSpriteFX(TempValue0, FX_FLIP, Object.XPos, Object.YPos)
51
Object.AnimationTimer++
52
Object.AnimationTimer %= 12
53
54
// Eggman
55
TempValue0 = Object.AnimationSpeed
56
TempValue0 >>= 5
57
DrawSpriteFX(TempValue0, FX_FLIP, Object.XPos, Object.YPos)
58
Object.AnimationSpeed++
59
Object.AnimationSpeed &= 63
60
end sub
61
62
63
sub ObjectStartup
64
LoadSpriteSheet("DAGarden/Objects.gif")
65
66
SpriteFrame(-24, -20, 48, 40, 267, 705) // #0 - Eggman Frame 0
67
SpriteFrame(-24, -20, 48, 40, 316, 705) // #1 - Eggman Frame 1
68
69
SpriteFrame(8, 0, 24, 24, 265, 746) // #2 - Smoke Frame 0
70
SpriteFrame(8, 0, 24, 24, 290, 746) // #3 - Smoke Frame 1
71
SpriteFrame(8, 0, 24, 24, 315, 746) // #4 - Smoke Frame 2
72
SpriteFrame(8, 0, 24, 24, 340, 746) // #5 - Smoke Frame 3
73
74
// Blank Frames
75
SpriteFrame(8, 0, 0, 0, 265, 746)
76
SpriteFrame(8, 0, 0, 0, 265, 746)
77
end sub
78
79
80
// ========================
81
// Editor Subs
82
// ========================
83
84
sub RSDKDraw
85
DrawSprite(0)
86
end sub
87
88
89
sub RSDKLoad
90
LoadSpriteSheet("DAGarden/Objects.gif")
91
SpriteFrame(-24, -20, 48, 40, 267, 705) // #0 - Eggman Frame 0
92
93
SetVariableAlias(ALIAS_VAR_PROPVAL, "unused")
94
end sub
95
96