Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
rubberduckycooly
GitHub Repository: rubberduckycooly/Sonic-CD-2011-Script-Decompilation
Path: blob/main/Scripts/R8/Amy.txt
1319 views
1
//----------------Sonic CD Amy Rose 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
// Value1 is unused, likely just XVelocity
8
#alias Object.Value2 : Object.YVelocity
9
10
// Boss Curtain alias
11
#alias Object[-1].XPos : BossCurtain.XPos
12
13
// States
14
#alias 0 : AMY_ENTER_SCREEN
15
#alias 1 : AMY_JUMP_1
16
#alias 2 : AMY_JUMP_2
17
#alias 3 : AMY_TRIGGER_FADE
18
#alias 4 : AMY_FADE_WALK
19
20
// Players
21
#alias 0 : PLAYER_SONIC_A
22
23
// Collision Sides
24
#alias 0 : CSIDE_FLOOR
25
26
27
sub ObjectMain
28
switch Object.State
29
case AMY_ENTER_SCREEN
30
Object.Frame = Object.Timer
31
Object.Frame >>= 2
32
33
Object.Timer++
34
Object.Timer %= 24
35
36
Object.XPos += 0x14000
37
ObjectTileGrip(CSIDE_FLOOR, 0, 19, 0)
38
39
TempValue0 = BossCurtain.XPos
40
TempValue0 -= 0x600000
41
if Object.XPos > TempValue0
42
Object.Frame = 6
43
44
Object.XPos = TempValue0
45
Object.YVelocity = -0x30000
46
47
Object.State++
48
end if
49
break
50
51
case AMY_JUMP_1
52
Object.YVelocity += 0x4000
53
Object.YPos += Object.YVelocity
54
ObjectTileCollision(CSIDE_FLOOR, 0, 19, 0)
55
if Object.YVelocity > 0
56
Object.Frame = 7
57
end if
58
59
if CheckResult == true
60
Object.Frame = 6
61
Object.YVelocity = -0x30000
62
Object.State++
63
end if
64
break
65
66
case AMY_JUMP_2
67
Object.YVelocity += 0x4000
68
Object.YPos += Object.YVelocity
69
ObjectTileCollision(CSIDE_FLOOR, 0, 19, 0)
70
if Object.YVelocity > 0
71
Object.Frame = 7
72
end if
73
74
if CheckResult == true
75
Object.YVelocity = 0
76
Object.State++
77
end if
78
break
79
80
case AMY_TRIGGER_FADE
81
Object.Frame = Object.Timer
82
Object.Frame >>= 2
83
84
Object.Timer++
85
Object.Timer %= 24
86
87
Object.XPos += 0x14000
88
ObjectTileGrip(CSIDE_FLOOR, 0, 19, 0)
89
90
TempValue0 = BossCurtain.XPos
91
TempValue0 -= 0x100000
92
if Object.XPos > TempValue0
93
Object[+1].Type = TypeName[FadeScreen]
94
Object.State++
95
end if
96
break
97
98
case AMY_FADE_WALK
99
Object.Frame = Object.Timer
100
Object.Frame >>= 2
101
102
Object.Timer++
103
Object.Timer %= 24
104
105
Object.XPos += 0x14000
106
ObjectTileGrip(CSIDE_FLOOR, 0, 19, 0)
107
break
108
109
end switch
110
111
end sub
112
113
114
sub ObjectDraw
115
if Stage.PlayerListPos == PLAYER_SONIC_A // PLAYER_SONIC in origins
116
DrawSpriteFX(Object.Frame, FX_FLIP, Object.XPos, Object.YPos)
117
end if
118
end sub
119
120
121
sub ObjectStartup
122
123
LoadSpriteSheet("R8/Objects3.gif")
124
125
// Amy Frames
126
127
// 0-5 - Walking Frames
128
SpriteFrame(-16, -20, 32, 40, 124, 174)
129
SpriteFrame(-16, -20, 32, 40, 157, 174)
130
SpriteFrame(-16, -20, 32, 40, 190, 174)
131
SpriteFrame(-16, -20, 32, 40, 223, 174)
132
SpriteFrame(-16, -20, 32, 40, 138, 215)
133
SpriteFrame(-16, -20, 32, 40, 171, 215)
134
135
// 6 - Airborne Frame
136
SpriteFrame(-13, -20, 26, 40, 204, 215)
137
138
// 7 - Hugging Frame
139
SpriteFrame(-12, -20, 24, 40, 231, 215)
140
141
end sub
142
143
144
// ========================
145
// Editor Subs
146
// ========================
147
148
sub RSDKDraw
149
DrawSprite(0)
150
end sub
151
152
153
sub RSDKLoad
154
LoadSpriteSheet("R8/Objects3.gif")
155
SpriteFrame(-16, -20, 32, 40, 124, 174)
156
157
SetVariableAlias(ALIAS_VAR_PROPVAL, "unused")
158
end sub
159
160