Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
rubberduckycooly
GitHub Repository: rubberduckycooly/Sonic-Mania-Decompilation
Path: blob/master/SonicMania/Objects/Credits/EncoreGoodEnd.c
338 views
1
// ---------------------------------------------------------------------
2
// RSDK Project: Sonic Mania
3
// Object Description: EncoreGoodEnd Object
4
// Object Author: Christian Whitehead/Simon Thomley/Hunter Bridges
5
// Decompiled by: Rubberduckycooly & RMGRich
6
// ---------------------------------------------------------------------
7
8
#include "Game.h"
9
10
#if MANIA_USE_PLUS
11
ObjectEncoreGoodEnd *EncoreGoodEnd;
12
13
void EncoreGoodEnd_Update(void)
14
{
15
RSDK_THIS(EncoreGoodEnd);
16
17
if (!self->activated) {
18
foreach_active(Player, player)
19
{
20
if (Player_CheckCollisionTouch(player, self, &self->hitbox)) {
21
CutsceneSeq_StartSequence(self, EncoreGoodEnd_Cutscene_MoveToPlace, EncoreGoodEnd_Cutscene_WaitForMovementFinish,
22
EncoreGoodEnd_Cutscene_ClinkGlasses, EncoreGoodEnd_Cutscene_KingAppear,
23
EncoreGoodEnd_Cutscene_ThanksForPlaying, EncoreGoodEnd_Cutscene_FinishCutscene, StateMachine_None);
24
#if MANIA_USE_PLUS
25
CutsceneSeq_SetSkipTypeCallback(EncoreGoodEnd_Cutscene_SkipCB);
26
#endif
27
28
self->activated = true;
29
}
30
}
31
}
32
}
33
34
void EncoreGoodEnd_LateUpdate(void) {}
35
36
void EncoreGoodEnd_StaticUpdate(void) {}
37
38
void EncoreGoodEnd_Draw(void) {}
39
40
void EncoreGoodEnd_Create(void *data)
41
{
42
RSDK_THIS(EncoreGoodEnd);
43
44
if (!SceneInfo->inEditor) {
45
INIT_ENTITY(self);
46
self->active = ACTIVE_NORMAL;
47
CutsceneRules_SetupEntity(self, &self->size, &self->hitbox);
48
49
SceneInfo->timeEnabled = false;
50
EncoreGoodEnd->unused1 = 0;
51
Player->playerCount = 4;
52
53
EncoreGoodEnd_SetupDecorations();
54
}
55
}
56
57
void EncoreGoodEnd_StageLoad(void) { EncoreGoodEnd->sfxSnap = RSDK.GetSfx("SPZ/ShBugSnap.wav"); }
58
59
void EncoreGoodEnd_SetupDecorations(void)
60
{
61
int32 id = 0;
62
foreach_all(Decoration, decor)
63
{
64
if (id >= E_END_COUNT)
65
break;
66
67
if (id == E_END_ICECREAM_CONE)
68
decor->drawFX = FX_NONE;
69
if (id >= E_END_ICECREAM_CONE)
70
decor->visible = false;
71
72
EncoreGoodEnd->decorations[id++] = decor;
73
}
74
}
75
76
void EncoreGoodEnd_SetupPlayer(int32 playerID)
77
{
78
switch (playerID) {
79
default: break;
80
81
case ID_SONIC: EncoreGoodEnd->decorations[E_END_SONIC]->visible = false; break;
82
83
case ID_TAILS:
84
EncoreGoodEnd->decorations[E_END_TAILS]->visible = false;
85
RSDK.SetSpriteAnimation(Decoration->aniFrames, E_END_DECOR_STOOL_STILL, &EncoreGoodEnd->decorations[E_END_STOOLT]->animator, false, 0);
86
break;
87
88
case ID_KNUCKLES:
89
EncoreGoodEnd->decorations[E_END_KNUX]->visible = false;
90
EncoreGoodEnd->decorations[E_END_GLASSK]->visible = false;
91
break;
92
93
case ID_MIGHTY:
94
EncoreGoodEnd->decorations[E_END_MIGHTY]->visible = false;
95
EncoreGoodEnd->decorations[E_END_GLASSM]->visible = false;
96
break;
97
98
case ID_RAY:
99
EncoreGoodEnd->decorations[E_END_RAY]->visible = false;
100
RSDK.SetSpriteAnimation(Decoration->aniFrames, E_END_DECOR_STOOL_STILL, &EncoreGoodEnd->decorations[E_END_STOOLR]->animator, false, 0);
101
break;
102
}
103
}
104
105
void EncoreGoodEnd_StatePlayer_MoveToPos(void)
106
{
107
RSDK_THIS(Player);
108
109
self->velocity.x = 0x18000;
110
self->groundVel = 0x18000;
111
112
int32 playerID = HUD_CharacterIndexFromID(self->characterID);
113
114
if (self->position.x >= EncoreGoodEnd->decorations[playerID + E_END_SONIC]->position.x) {
115
self->position.x = EncoreGoodEnd->decorations[playerID + E_END_SONIC]->position.x;
116
117
self->velocity.x = 0;
118
self->groundVel = 0;
119
120
switch (self->characterID) {
121
case ID_SONIC:
122
self->visible = false;
123
EncoreGoodEnd->decorations[playerID + E_END_SONIC]->visible = true;
124
RSDK.SetSpriteAnimation(Decoration->aniFrames, E_END_DECOR_SONICLAYDOWN,
125
&EncoreGoodEnd->decorations[playerID + E_END_SONIC]->animator, true, 0);
126
self->velocity.x = 0;
127
self->groundVel = 0;
128
self->state = EncoreGoodEnd_StatePlayer_EndingSonic;
129
break;
130
131
case ID_TAILS:
132
case ID_KNUCKLES:
133
case ID_MIGHTY:
134
case ID_RAY:
135
self->jumpPress = true;
136
Player_State_Ground();
137
self->jumpPress = false;
138
self->state = EncoreGoodEnd_StatePlayer_EndingIdle;
139
self->nextAirState = EncoreGoodEnd_StatePlayer_EndingIdle;
140
self->nextGroundState = Player_State_Static;
141
break;
142
143
default: break;
144
}
145
}
146
else {
147
Player_State_Ground();
148
}
149
}
150
151
void EncoreGoodEnd_StatePlayer_EndingIdle(void)
152
{
153
RSDK_THIS(Player);
154
155
Player_State_Air();
156
157
if (self->velocity.y > 0) {
158
int32 playerID = HUD_CharacterIndexFromID(self->characterID);
159
160
if (self->position.y >= (EncoreGoodEnd->decorations[playerID + E_END_SONIC]->position.y - 0x80000)) {
161
self->position.y = (EncoreGoodEnd->decorations[playerID + E_END_SONIC]->position.y - 0x80000);
162
self->velocity.y = 0;
163
self->visible = false;
164
165
EncoreGoodEnd->decorations[playerID + E_END_SONIC]->visible = true;
166
switch (self->characterID) {
167
default:
168
case ID_SONIC: self->state = Player_State_Static; break;
169
170
case ID_TAILS:
171
RSDK.SetSpriteAnimation(Decoration->aniFrames, E_END_DECOR_TAILSSPIN,
172
&EncoreGoodEnd->decorations[playerID + E_END_SONIC]->animator, true, 0);
173
RSDK.SetSpriteAnimation(Decoration->aniFrames, E_END_DECOR_STOOL, &EncoreGoodEnd->decorations[E_END_STOOLT]->animator, true, 0);
174
self->state = Player_State_Static;
175
break;
176
177
case ID_KNUCKLES:
178
RSDK.SetSpriteAnimation(Decoration->aniFrames, E_END_DECOR_KNUXSITDOWN,
179
&EncoreGoodEnd->decorations[playerID + E_END_SONIC]->animator, true, 0);
180
EncoreGoodEnd->decorations[E_END_GLASSK]->visible = true;
181
RSDK.SetSpriteAnimation(Decoration->aniFrames, E_END_DECOR_KNUXSITDOWNG, &EncoreGoodEnd->decorations[E_END_GLASSK]->animator,
182
true, 0);
183
EncoreGoodEnd->decorations[E_END_GLASSK]->animator.speed = 0;
184
self->state = Player_State_Static;
185
break;
186
187
case ID_MIGHTY:
188
RSDK.SetSpriteAnimation(Decoration->aniFrames, E_END_DECOR_MIGHTYSITDOWN,
189
&EncoreGoodEnd->decorations[playerID + E_END_SONIC]->animator, true, 0);
190
EncoreGoodEnd->decorations[E_END_GLASSM]->visible = true;
191
RSDK.SetSpriteAnimation(Decoration->aniFrames, E_END_DECOR_MIGHTYSITDOWNG, &EncoreGoodEnd->decorations[E_END_GLASSM]->animator,
192
true, 0);
193
EncoreGoodEnd->decorations[E_END_GLASSM]->animator.speed = 0;
194
self->state = Player_State_Static;
195
break;
196
197
case ID_RAY:
198
RSDK.SetSpriteAnimation(Decoration->aniFrames, E_END_DECOR_RAYSPIN, &EncoreGoodEnd->decorations[playerID + E_END_SONIC]->animator,
199
true, 0);
200
RSDK.SetSpriteAnimation(Decoration->aniFrames, E_END_DECOR_STOOL, &EncoreGoodEnd->decorations[E_END_STOOLR]->animator, true, 0);
201
self->state = Player_State_Static;
202
break;
203
}
204
}
205
}
206
}
207
208
void EncoreGoodEnd_StatePlayer_EndingSonic(void)
209
{
210
RSDK_THIS(Player);
211
212
EntityDecoration *playerDecor = EncoreGoodEnd->decorations[E_END_SONIC];
213
214
switch (self->abilityValues[0]) {
215
case 0:
216
if (EncoreGoodEnd->decorations[E_END_SONIC]->animator.frameID == 8) {
217
self->abilityValues[0] = 1;
218
EncoreGoodEnd->decorations[E_END_ICECREAM_CONE]->visible = true;
219
EncoreGoodEnd->decorations[E_END_ICECREAM_CONE]->velocity.y = -0x40000;
220
self->abilityValues[1] = 0;
221
}
222
break;
223
224
case 1:
225
if (++self->abilityValues[1] >= 15) {
226
self->abilityValues[1] = 0;
227
self->abilityValues[0] = 2;
228
EncoreGoodEnd->decorations[E_END_ICECREAM_PINK]->visible = true;
229
EncoreGoodEnd->decorations[E_END_ICECREAM_PINK]->velocity.y = -0x40000;
230
}
231
break;
232
233
case 2:
234
if (++self->abilityValues[1] >= 15) {
235
self->abilityValues[1] = 0;
236
self->abilityValues[0] = 3;
237
EncoreGoodEnd->decorations[E_END_ICECREAM_GREEN]->visible = true;
238
EncoreGoodEnd->decorations[E_END_ICECREAM_GREEN]->velocity.y = -0x40000;
239
}
240
break;
241
242
case 3:
243
if (++self->abilityValues[1] >= 15) {
244
self->abilityValues[1] = 0;
245
self->abilityValues[0] = 4;
246
EncoreGoodEnd->decorations[E_END_ICECREAM_PINK2]->visible = true;
247
EncoreGoodEnd->decorations[E_END_ICECREAM_PINK2]->velocity.y = -0x40000;
248
}
249
break;
250
251
case 4:
252
if (EncoreGoodEnd->decorations[E_END_SONIC]->animator.frameID >= 22)
253
self->state = Player_State_Static;
254
break;
255
256
default: break;
257
}
258
259
int32 anim = playerDecor->animator.frameID;
260
if (anim == ANI_RUN || anim == ANI_SKID || anim == ANI_DROPDASH)
261
playerDecor->animator.speed = 0;
262
263
// Sonic's Ice creams
264
if (EncoreGoodEnd->decorations[E_END_ICECREAM_CONE]->visible) {
265
if (EncoreGoodEnd->decorations[E_END_ICECREAM_CONE]->velocity.y < 0) {
266
self->direction = FLIP_Y;
267
}
268
else {
269
EncoreGoodEnd->decorations[E_END_ICECREAM_CONE]->drawGroup = Zone->playerDrawGroup[1];
270
self->direction = FLIP_NONE;
271
}
272
273
EncoreGoodEnd->decorations[E_END_ICECREAM_CONE]->position.y += EncoreGoodEnd->decorations[E_END_ICECREAM_CONE]->velocity.y;
274
EncoreGoodEnd->decorations[E_END_ICECREAM_CONE]->velocity.y += 0x3800;
275
276
if (EncoreGoodEnd->decorations[E_END_ICECREAM_CONE]->position.y >= playerDecor->position.y) {
277
EncoreGoodEnd->decorations[E_END_ICECREAM_CONE]->visible = false;
278
279
++playerDecor->animator.frameID;
280
playerDecor->animator.speed = 1;
281
}
282
}
283
284
if (EncoreGoodEnd->decorations[E_END_ICECREAM_PINK]->visible) {
285
if (EncoreGoodEnd->decorations[E_END_ICECREAM_PINK]->velocity.y < 0) {
286
self->direction = FLIP_Y;
287
}
288
else {
289
EncoreGoodEnd->decorations[E_END_ICECREAM_PINK]->drawGroup = Zone->playerDrawGroup[1];
290
self->direction = FLIP_NONE;
291
}
292
293
EncoreGoodEnd->decorations[E_END_ICECREAM_PINK]->position.y += EncoreGoodEnd->decorations[E_END_ICECREAM_PINK]->velocity.y;
294
EncoreGoodEnd->decorations[E_END_ICECREAM_PINK]->velocity.y += 0x3800;
295
296
if (EncoreGoodEnd->decorations[E_END_ICECREAM_PINK]->position.y >= playerDecor->position.y) {
297
EncoreGoodEnd->decorations[E_END_ICECREAM_PINK]->visible = false;
298
299
++playerDecor->animator.frameID;
300
playerDecor->animator.speed = 1;
301
}
302
}
303
304
if (EncoreGoodEnd->decorations[E_END_ICECREAM_GREEN]->visible) {
305
if (EncoreGoodEnd->decorations[E_END_ICECREAM_GREEN]->velocity.y < 0) {
306
self->direction = FLIP_Y;
307
}
308
else {
309
EncoreGoodEnd->decorations[E_END_ICECREAM_GREEN]->drawGroup = Zone->playerDrawGroup[1];
310
self->direction = FLIP_NONE;
311
}
312
313
EncoreGoodEnd->decorations[E_END_ICECREAM_GREEN]->position.y += EncoreGoodEnd->decorations[E_END_ICECREAM_GREEN]->velocity.y;
314
EncoreGoodEnd->decorations[E_END_ICECREAM_GREEN]->velocity.y += 0x3800;
315
316
if (EncoreGoodEnd->decorations[E_END_ICECREAM_GREEN]->position.y >= playerDecor->position.y - 0x40000) {
317
EncoreGoodEnd->decorations[E_END_ICECREAM_GREEN]->visible = false;
318
319
++playerDecor->animator.frameID;
320
playerDecor->animator.speed = 1;
321
}
322
}
323
324
if (EncoreGoodEnd->decorations[E_END_ICECREAM_PINK2]->visible == 1) {
325
if (EncoreGoodEnd->decorations[E_END_ICECREAM_PINK2]->velocity.y < 0) {
326
self->direction = FLIP_Y;
327
}
328
else {
329
EncoreGoodEnd->decorations[E_END_ICECREAM_PINK2]->drawGroup = Zone->playerDrawGroup[1];
330
self->direction = FLIP_NONE;
331
}
332
333
EncoreGoodEnd->decorations[E_END_ICECREAM_PINK2]->position.y += EncoreGoodEnd->decorations[E_END_ICECREAM_PINK2]->velocity.y;
334
EncoreGoodEnd->decorations[E_END_ICECREAM_PINK2]->velocity.y += 0x3800;
335
336
if (EncoreGoodEnd->decorations[E_END_ICECREAM_PINK2]->position.y >= playerDecor->position.y - 0x80000) {
337
EncoreGoodEnd->decorations[E_END_ICECREAM_PINK2]->visible = false;
338
339
++playerDecor->animator.frameID;
340
playerDecor->animator.speed = 1;
341
}
342
}
343
}
344
345
bool32 EncoreGoodEnd_Cutscene_MoveToPlace(EntityCutsceneSeq *host)
346
{
347
RSDK_THIS(EncoreGoodEnd);
348
MANIA_GET_PLAYER(player1, player2, camera);
349
350
if (!host->timer) {
351
player1->state = Player_State_Static;
352
player1->stateInput = StateMachine_None;
353
354
CutsceneSeq_LockAllPlayerControl();
355
EncoreGoodEnd_SetupPlayer(player1->characterID);
356
EncoreGoodEnd_SetupPlayer(player2->characterID);
357
358
camera->target = (Entity *)EncoreGoodEnd->decorations[E_END_SONIC];
359
self->position.y = EncoreGoodEnd->decorations[E_END_KING]->position.y;
360
361
EncoreGoodEnd->decorations[E_END_KING]->position.y += 0x500000;
362
RSDK.SetSpriteAnimation(Decoration->aniFrames, E_END_DECOR_SONICLAYDOWN, &EncoreGoodEnd->decorations[E_END_SONIC]->animator, true, 21);
363
364
foreach_all(UICreditsText, label) { label->active = ACTIVE_NEVER; }
365
}
366
else if (host->timer == 120) {
367
player1->position.x = 0x300000;
368
player1->velocity.x = 0x30000;
369
player1->groundVel = 0x30000;
370
player1->drawGroup = Zone->playerDrawGroup[1];
371
player1->state = Player_State_Ground;
372
373
if (player2->classID == Player->classID) {
374
player2->position.x = -0x800000;
375
player2->velocity.x = 0x30000;
376
player2->groundVel = 0x30000;
377
player2->drawGroup = Zone->playerDrawGroup[1];
378
player2->state = Player_State_Ground;
379
player2->stateInput = StateMachine_None;
380
}
381
}
382
else if (host->timer > 120 && player1->groundVel <= 0x18000) {
383
player1->state = EncoreGoodEnd_StatePlayer_MoveToPos;
384
if (player2->classID == Player->classID)
385
player2->state = EncoreGoodEnd_StatePlayer_MoveToPos;
386
387
return true;
388
}
389
return false;
390
}
391
392
bool32 EncoreGoodEnd_Cutscene_WaitForMovementFinish(EntityCutsceneSeq *host)
393
{
394
EntityPlayer *player1 = RSDK_GET_ENTITY(SLOT_PLAYER1, Player);
395
EntityPlayer *player2 = RSDK_GET_ENTITY(SLOT_PLAYER2, Player);
396
397
return player1->state == Player_State_Static && (player2->state == Player_State_Static || player2->classID != Player->classID);
398
}
399
400
bool32 EncoreGoodEnd_Cutscene_ClinkGlasses(EntityCutsceneSeq *host)
401
{
402
if (host->timer == 60) {
403
RSDK.SetSpriteAnimation(Decoration->aniFrames, E_END_DECOR_KNUXCLINK, &EncoreGoodEnd->decorations[E_END_KNUX]->animator, true, 0);
404
RSDK.SetSpriteAnimation(Decoration->aniFrames, E_END_DECOR_KNUXCLINKG, &EncoreGoodEnd->decorations[E_END_GLASSK]->animator, true, 0);
405
RSDK.SetSpriteAnimation(Decoration->aniFrames, E_END_DECOR_MIGHTYCLINK, &EncoreGoodEnd->decorations[E_END_MIGHTY]->animator, true, 0);
406
RSDK.SetSpriteAnimation(Decoration->aniFrames, E_END_DECOR_MIGHTYCLINKG, &EncoreGoodEnd->decorations[E_END_GLASSM]->animator, true, 0);
407
}
408
else if (host->timer == 120) {
409
RSDK.SetSpriteAnimation(Decoration->aniFrames, E_END_DECOR_KNUXBREATHE, &EncoreGoodEnd->decorations[E_END_KNUX]->animator, true, 0);
410
RSDK.SetSpriteAnimation(Decoration->aniFrames, E_END_DECOR_KNUXSITDOWNG, &EncoreGoodEnd->decorations[E_END_GLASSK]->animator, true, 0);
411
RSDK.SetSpriteAnimation(Decoration->aniFrames, E_END_DECOR_MIGHTYBREATHE, &EncoreGoodEnd->decorations[E_END_MIGHTY]->animator, true, 0);
412
RSDK.SetSpriteAnimation(Decoration->aniFrames, E_END_DECOR_MIGHTYSITDOWNG, &EncoreGoodEnd->decorations[E_END_GLASSM]->animator, true, 0);
413
}
414
else if (host->timer == 180) {
415
EncoreGoodEnd->decorations[E_END_KING]->velocity.y = -0x60000;
416
return true;
417
}
418
419
return false;
420
}
421
422
bool32 EncoreGoodEnd_Cutscene_KingAppear(EntityCutsceneSeq *host)
423
{
424
RSDK_THIS(EncoreGoodEnd);
425
426
EntityDecoration *decor = EncoreGoodEnd->decorations[E_END_KING];
427
decor->position.y += decor->velocity.y;
428
decor->velocity.y += 0x3800;
429
430
if (decor->velocity.y > 0) {
431
if (decor->position.y >= self->position.y) {
432
decor->position.y = self->position.y;
433
434
RSDK.SetSpriteAnimation(Decoration->aniFrames, E_END_DECOR_SONICSHOCKED, &EncoreGoodEnd->decorations[E_END_SONIC]->animator, true, 0);
435
RSDK.SetSpriteAnimation(Decoration->aniFrames, E_END_DECOR_TAILSSHOCKED, &EncoreGoodEnd->decorations[E_END_TAILS]->animator, true, 0);
436
RSDK.SetSpriteAnimation(Decoration->aniFrames, E_END_DECOR_KNUXSHOCKED, &EncoreGoodEnd->decorations[E_END_KNUX]->animator, true, 0);
437
RSDK.SetSpriteAnimation(Decoration->aniFrames, E_END_DECOR_MIGHTYSHOCKED, &EncoreGoodEnd->decorations[E_END_MIGHTY]->animator, true, 0);
438
439
EncoreGoodEnd->decorations[E_END_RAY]->direction = FLIP_NONE;
440
RSDK.SetSpriteAnimation(Decoration->aniFrames, E_END_DECOR_RAYSHOCKED, &EncoreGoodEnd->decorations[E_END_RAY]->animator, true, 0);
441
RSDK.SetSpriteAnimation(Decoration->aniFrames, E_END_DECOR_STOOL_STILL, &EncoreGoodEnd->decorations[E_END_STOOLT]->animator, false, 0);
442
RSDK.SetSpriteAnimation(Decoration->aniFrames, E_END_DECOR_STOOL_STILL, &EncoreGoodEnd->decorations[E_END_STOOLR]->animator, false, 0);
443
RSDK.SetSpriteAnimation(Decoration->aniFrames, E_END_DECOR_KNUXICECREAMSHOCK, &EncoreGoodEnd->decorations[E_END_GLASSK]->animator, true,
444
0);
445
446
EncoreGoodEnd->decorations[E_END_GLASSK]->drawFX |= FX_SCALE;
447
EncoreGoodEnd->decorations[E_END_GLASSK]->position.x += 0x80000;
448
EncoreGoodEnd->decorations[E_END_GLASSK]->rotation = -32;
449
450
RSDK.SetSpriteAnimation(Decoration->aniFrames, E_END_DECOR_MIGHTYICECREAMSHOCK, &EncoreGoodEnd->decorations[E_END_GLASSM]->animator, true,
451
0);
452
EncoreGoodEnd->decorations[E_END_GLASSM]->drawFX |= FX_SCALE;
453
EncoreGoodEnd->decorations[E_END_GLASSM]->position.x -= 0x80000;
454
EncoreGoodEnd->decorations[E_END_GLASSM]->rotation = 32;
455
456
foreach_all(UICreditsText, label)
457
{
458
label->active = ACTIVE_NORMAL;
459
label->state = UICreditsText_State_SetupCharPos;
460
label->drawGroup = Zone->hudDrawGroup;
461
}
462
463
EntityFXFade *fxFade = CREATE_ENTITY(FXFade, INT_TO_VOID(0xF0F0F0), self->position.x, self->position.y);
464
fxFade->speedIn = 256;
465
fxFade->speedOut = 64;
466
fxFade->drawGroup = Zone->objectDrawGroup[1];
467
RSDK.PlaySfx(EncoreGoodEnd->sfxSnap, false, 255);
468
return true;
469
}
470
}
471
472
return false;
473
}
474
475
bool32 EncoreGoodEnd_Cutscene_ThanksForPlaying(EntityCutsceneSeq *host)
476
{
477
RSDK_THIS(EncoreGoodEnd);
478
479
if (host->timer < 22) {
480
foreach_active(Decoration, decor)
481
{
482
if (decor->type >= 25) {
483
decor->drawGroup = Zone->objectDrawGroup[1] + 1;
484
485
if (decor->position.y >= self->position.y)
486
decor->position.y -= 0x20000;
487
else
488
decor->position.y += 0x20000;
489
}
490
}
491
492
RSDK.SetActivePalette(0, 0, ScreenInfo->size.y);
493
RSDK.SetActivePalette(1, 2 * host->timer, ScreenInfo->size.y - 2 * host->timer);
494
}
495
496
return host->timer == 240;
497
}
498
499
bool32 EncoreGoodEnd_Cutscene_FinishCutscene(EntityCutsceneSeq *host)
500
{
501
if (API.CheckDLC(DLC_PLUS))
502
RSDK.SetScene("Presentation", "Encore Summary");
503
else
504
RSDK.SetScene("Presentation", "Menu");
505
506
Zone_StartFadeOut(10, 0x000000);
507
Music_FadeOut(0.025);
508
509
return true;
510
}
511
512
void EncoreGoodEnd_Cutscene_SkipCB(void) { EncoreGoodEnd_Cutscene_FinishCutscene(NULL); }
513
514
#if GAME_INCLUDE_EDITOR
515
void EncoreGoodEnd_EditorDraw(void) {}
516
517
void EncoreGoodEnd_EditorLoad(void)
518
{
519
RSDK_ACTIVE_VAR(Decoration, type);
520
RSDK_ENUM_VAR("Stool", E_END_DECOR_STOOL);
521
RSDK_ENUM_VAR("Ice Cream (Pink)", E_END_DECOR_ICECREAM_PINK);
522
RSDK_ENUM_VAR("Ice Cream (Green)", E_END_DECOR_ICECREAM_GREEN);
523
RSDK_ENUM_VAR("Ice Cream (Cone)", E_END_DECOR_ICECREAM_CONE);
524
RSDK_ENUM_VAR("King", E_END_DECOR_KING);
525
RSDK_ENUM_VAR("Ray Spin", E_END_DECOR_RAYSPIN);
526
RSDK_ENUM_VAR("Ray Shocked", E_END_DECOR_RAYSHOCKED);
527
RSDK_ENUM_VAR("Sonic Lay Down", E_END_DECOR_SONICLAYDOWN);
528
RSDK_ENUM_VAR("Sonic Shocked", E_END_DECOR_SONICSHOCKED);
529
RSDK_ENUM_VAR("Knux Breathe", E_END_DECOR_KNUXBREATHE);
530
RSDK_ENUM_VAR("Knux Clink", E_END_DECOR_KNUXCLINK);
531
RSDK_ENUM_VAR("Knux Clink (Glass)", E_END_DECOR_KNUXCLINKG);
532
RSDK_ENUM_VAR("Knux Shocked", E_END_DECOR_KNUXSHOCKED);
533
RSDK_ENUM_VAR("Knux Sit Down", E_END_DECOR_KNUXSITDOWN);
534
RSDK_ENUM_VAR("Knux Sit Down (Glass)", E_END_DECOR_KNUXSITDOWNG);
535
RSDK_ENUM_VAR("Mighty Breathe", E_END_DECOR_MIGHTYBREATHE);
536
RSDK_ENUM_VAR("Mighty Clink", E_END_DECOR_MIGHTYCLINK);
537
RSDK_ENUM_VAR("Mighty Clink (Glass)", E_END_DECOR_MIGHTYCLINKG);
538
RSDK_ENUM_VAR("Mighty Sit Down", E_END_DECOR_MIGHTYSITDOWN);
539
RSDK_ENUM_VAR("Mighty Sit Down (Glass)", E_END_DECOR_MIGHTYSITDOWNG);
540
RSDK_ENUM_VAR("Mighty Shocked", E_END_DECOR_MIGHTYSHOCKED);
541
RSDK_ENUM_VAR("Tails Shocked", E_END_DECOR_TAILSSHOCKED);
542
RSDK_ENUM_VAR("Tails Spin", E_END_DECOR_TAILSSPIN);
543
RSDK_ENUM_VAR("Stool (Still)", E_END_DECOR_STOOL_STILL);
544
RSDK_ENUM_VAR("Knux Cream Shock", E_END_DECOR_KNUXICECREAMSHOCK);
545
RSDK_ENUM_VAR("Mighty Cream Shock", E_END_DECOR_MIGHTYICECREAMSHOCK);
546
RSDK_ENUM_VAR("Letterbox 1", E_END_DECOR_LETTERBOX1);
547
RSDK_ENUM_VAR("Letterbox 2", E_END_DECOR_LETTERBOX2);
548
}
549
#endif
550
551
void EncoreGoodEnd_Serialize(void) { RSDK_EDITABLE_VAR(EncoreGoodEnd, VAR_VECTOR2, size); }
552
#endif
553
554