Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
rubberduckycooly
GitHub Repository: rubberduckycooly/Sonic-Mania-Decompilation
Path: blob/master/SonicMania/Objects/FBZ/BigSqueeze.c
338 views
1
// ---------------------------------------------------------------------
2
// RSDK Project: Sonic Mania
3
// Object Description: BigSqueeze Object
4
// Object Author: Christian Whitehead/Simon Thomley/Hunter Bridges
5
// Decompiled by: Rubberduckycooly & RMGRich
6
// ---------------------------------------------------------------------
7
8
#include "Game.h"
9
10
ObjectBigSqueeze *BigSqueeze;
11
12
void BigSqueeze_Update(void)
13
{
14
RSDK_THIS(BigSqueeze);
15
16
StateMachine_Run(self->state);
17
}
18
19
void BigSqueeze_LateUpdate(void) {}
20
21
void BigSqueeze_StaticUpdate(void) {}
22
23
void BigSqueeze_Draw(void)
24
{
25
RSDK_THIS(BigSqueeze);
26
27
if (self->stateDraw) {
28
StateMachine_Run(self->stateDraw);
29
}
30
else {
31
RSDK.DrawSprite(&self->animator, NULL, false);
32
}
33
}
34
35
void BigSqueeze_Create(void *data)
36
{
37
RSDK_THIS(BigSqueeze);
38
39
if (!SceneInfo->inEditor) {
40
if (globals->gameMode < MODE_TIMEATTACK) {
41
self->active = ACTIVE_BOUNDS;
42
43
switch (self->type) {
44
case BIGSQUEEZE_MANAGER:
45
self->updateRange.x = 0x800000;
46
self->updateRange.y = 0x800000;
47
self->visible = false;
48
49
self->hitbox.left = -256;
50
self->hitbox.top = 0;
51
self->hitbox.right = 256;
52
self->hitbox.bottom = 32;
53
54
self->state = BigSqueeze_StateManager_SetupIntro;
55
break;
56
57
case BIGSQUEEZE_BOSS:
58
self->updateRange.x = 0x8000000;
59
self->updateRange.y = 0x1000000;
60
self->visible = true;
61
self->drawGroup = Zone->objectDrawGroup[1];
62
63
self->hitbox.left = -32;
64
self->hitbox.top = -16;
65
self->hitbox.right = 32;
66
self->hitbox.bottom = 16;
67
68
self->timer = 6;
69
RSDK.SetSpriteAnimation(BigSqueeze->aniFrames, 1, &self->animator, true, 0);
70
RSDK.SetSpriteAnimation(BigSqueeze->aniFrames, 2, &self->domeAnimator, true, 0);
71
RSDK.SetSpriteAnimation(BigSqueeze->aniFrames, 3, &self->prongsAnimator, true, 0);
72
RSDK.SetSpriteAnimation(BigSqueeze->aniFrames, 4, &self->wheelAnimator, true, 0);
73
74
self->stateDraw = BigSqueeze_Draw_Boss;
75
break;
76
77
case BIGSQUEEZE_CRUSHER_L:
78
case BIGSQUEEZE_CRUSHER_R:
79
if (self->type == BIGSQUEEZE_CRUSHER_R) {
80
self->direction = FLIP_X;
81
self->drawFX = FX_FLIP;
82
}
83
self->updateRange.x = 0x8000000;
84
self->updateRange.y = 0x1000000;
85
self->visible = true;
86
self->drawGroup = Zone->objectDrawGroup[1];
87
88
RSDK.SetSpriteAnimation(BigSqueeze->aniFrames, 0, &self->animator, true, 0);
89
90
self->hitbox.left = -24;
91
self->hitbox.top = -120;
92
self->hitbox.right = 24;
93
self->hitbox.bottom = 120;
94
95
self->stateDraw = BigSqueeze_Draw_Crusher;
96
break;
97
98
default: break;
99
}
100
}
101
else {
102
destroyEntity(self);
103
}
104
}
105
}
106
107
void BigSqueeze_StageLoad(void)
108
{
109
BigSqueeze->active = ACTIVE_ALWAYS;
110
111
BigSqueeze->aniFrames = RSDK.LoadSpriteAnimation("FBZ/BigSqueeze.bin", SCOPE_STAGE);
112
113
BigSqueeze->sfxBossHit = RSDK.GetSfx("Stage/BossHit.wav");
114
BigSqueeze->sfxExplosion2 = RSDK.GetSfx("Stage/Explosion2.wav");
115
BigSqueeze->sfxMagnet = RSDK.GetSfx("FBZ/Magnet.wav");
116
BigSqueeze->sfxOrbinaut = RSDK.GetSfx("FBZ/Orbinaut.wav");
117
118
BigSqueeze->crushTimer = 0;
119
BigSqueeze->isCrushing = false;
120
121
Soundboard_LoadSfx("Stage/Rumble.wav", true, BigSqueeze_SfxCheck_Rumble, StateMachine_None);
122
}
123
124
bool32 BigSqueeze_SfxCheck_Rumble(void) { return BigSqueeze->isCrushing && SceneInfo->state == ENGINESTATE_REGULAR; }
125
126
void BigSqueeze_HandleWallCollisions(void)
127
{
128
RSDK_THIS(BigSqueeze);
129
130
foreach_active(Player, player)
131
{
132
int32 side = Player_CheckCollisionBox(player, self, &self->hitbox);
133
134
if (side == C_RIGHT)
135
player->collisionFlagH |= 2;
136
else if (side == C_LEFT)
137
player->collisionFlagH |= 1;
138
}
139
140
foreach_active(SignPost, signPost)
141
{
142
if (signPost->state == SignPost_State_Falling) {
143
if (signPost->velocity.x >= 0) {
144
if (signPost->position.x > self->position.x + ((self->hitbox.left - 24) << 16) && signPost->position.x < self->position.x)
145
signPost->velocity.x = -signPost->velocity.x;
146
}
147
else {
148
if (signPost->position.x < self->position.x + ((self->hitbox.right + 24) << 16) && signPost->position.x > self->position.x)
149
signPost->velocity.x = -signPost->velocity.x;
150
}
151
}
152
}
153
}
154
155
void BigSqueeze_CheckPlayerCollisions_Vulnerable(void)
156
{
157
RSDK_THIS(BigSqueeze);
158
159
if (!self->invincible) {
160
if (self->invincibilityTimer > 0)
161
self->invincibilityTimer--;
162
163
foreach_active(Player, player)
164
{
165
if (!self->invincibilityTimer && Player_CheckBadnikTouch(player, self, &self->hitbox) && Player_CheckBossHit(player, self))
166
BigSqueeze_Hit();
167
}
168
}
169
}
170
171
void BigSqueeze_CheckPlayerCollisions_Electrified(void)
172
{
173
RSDK_THIS(BigSqueeze);
174
175
if (!self->invincible) {
176
if (self->invincibilityTimer > 0)
177
self->invincibilityTimer--;
178
179
foreach_active(Player, player)
180
{
181
if (!self->invincibilityTimer && Player_CheckBadnikTouch(player, self, &self->hitbox)) {
182
if (player->invincibleTimer || player->blinkTimer > 0 || player->shield == SHIELD_LIGHTNING) {
183
if (Player_CheckBossHit(player, self))
184
BigSqueeze_Hit();
185
}
186
else {
187
Player_Hurt(player, self);
188
}
189
}
190
}
191
}
192
}
193
194
void BigSqueeze_Hit(void)
195
{
196
RSDK_THIS(BigSqueeze);
197
198
if (--self->timer <= 0) {
199
foreach_active(BigSqueeze, boss)
200
{
201
if (boss->type == BIGSQUEEZE_CRUSHER_L || boss->type == BIGSQUEEZE_CRUSHER_R)
202
boss->state = BigSqueeze_HandleWallCollisions;
203
}
204
205
RSDK.SetSpriteAnimation(-1, 0, &self->electricAnimator, true, 0);
206
207
self->state = BigSqueeze_StateBoss_Destroyed;
208
self->setupTimer = 0;
209
SceneInfo->timeEnabled = false;
210
EntityPlayer *player = RSDK_GET_ENTITY(SLOT_PLAYER1, Player);
211
Player_GiveScore(player, 1000);
212
}
213
else {
214
self->invincibilityTimer = 48;
215
RSDK.PlaySfx(BigSqueeze->sfxBossHit, false, 255);
216
}
217
}
218
219
void BigSqueeze_Explode(void)
220
{
221
RSDK_THIS(BigSqueeze);
222
223
if (!(Zone->timer % 3)) {
224
RSDK.PlaySfx(BigSqueeze->sfxExplosion2, false, 0xFF);
225
226
if (Zone->timer & 4) {
227
int32 x = (RSDK.Rand(self->hitbox.left, self->hitbox.right) << 16) + self->position.x;
228
int32 y = (RSDK.Rand(self->hitbox.top, self->hitbox.bottom) << 16) + self->position.y;
229
CREATE_ENTITY(Explosion, INT_TO_VOID((RSDK.Rand(0, 256) > 192) + EXPLOSION_BOSS), x, y)->drawGroup = Zone->objectDrawGroup[1];
230
}
231
}
232
}
233
234
void BigSqueeze_HandleBossMovement(void)
235
{
236
RSDK_THIS(BigSqueeze);
237
238
if (BigSqueeze->crushTimer < 10)
239
self->position.x += self->velocity.x;
240
241
foreach_active(BigSqueeze, boss)
242
{
243
if (boss->type == BIGSQUEEZE_CRUSHER_L) {
244
if (self->position.x < boss->position.x + 0x340000 && self->velocity.x < 0)
245
self->velocity.x = -self->velocity.x;
246
}
247
else if (boss->type == BIGSQUEEZE_CRUSHER_R) {
248
if (self->position.x > boss->position.x - 0x340000 && self->velocity.x > 0)
249
self->velocity.x = -self->velocity.x;
250
}
251
}
252
253
RSDK.ProcessAnimation(&self->wheelAnimator);
254
}
255
256
// debrisInfo format:
257
// - count
258
// <for count entries>
259
// - frameID
260
// - velocityX
261
// - velocityY
262
263
void BigSqueeze_SpawnDebris(int32 *debrisInfo)
264
{
265
RSDK_THIS(BigSqueeze);
266
if (debrisInfo) {
267
int32 count = debrisInfo[0];
268
debrisInfo++;
269
270
for (int32 i = 0; i < count; ++i) {
271
EntityDebris *debris = CREATE_ENTITY(Debris, Debris_State_FallAndFlicker, self->position.x, self->position.y);
272
273
RSDK.SetSpriteAnimation(BigSqueeze->aniFrames, 6, &debris->animator, true, debrisInfo[0]);
274
debris->velocity.x = debrisInfo[1];
275
debris->velocity.y = debrisInfo[2];
276
debris->gravityStrength = 0x3800;
277
debris->drawGroup = Zone->objectDrawGroup[1];
278
debris->updateRange.x = 0x800000;
279
debris->updateRange.y = 0x800000;
280
281
debrisInfo += 3;
282
}
283
}
284
}
285
286
void BigSqueeze_Draw_Boss(void)
287
{
288
RSDK_THIS(BigSqueeze);
289
Vector2 drawPos;
290
291
if (self->invincibilityTimer & 1) {
292
RSDK.SetPaletteEntry(0, 156, 0xE0E0E0);
293
RSDK.SetPaletteEntry(0, 33, 0xE0E0E0);
294
}
295
296
RSDK.DrawSprite(&self->animator, NULL, false);
297
RSDK.DrawSprite(&self->domeAnimator, NULL, false);
298
RSDK.DrawSprite(&self->prongsAnimator, NULL, false);
299
RSDK.DrawSprite(&self->electricAnimator, NULL, false);
300
301
RSDK.SetPaletteEntry(0, 156, 0x202020);
302
RSDK.SetPaletteEntry(0, 33, 0x303840);
303
drawPos.x = self->position.x;
304
drawPos.y = self->position.y;
305
306
drawPos.x -= 0x140000;
307
RSDK.DrawSprite(&self->wheelAnimator, &drawPos, false);
308
309
drawPos.x += 0x280000;
310
RSDK.DrawSprite(&self->wheelAnimator, &drawPos, false);
311
}
312
313
void BigSqueeze_Draw_Crusher(void)
314
{
315
RSDK_THIS(BigSqueeze);
316
317
self->animator.frameID = 0;
318
RSDK.DrawSprite(&self->animator, NULL, false);
319
320
self->animator.frameID = 1;
321
RSDK.DrawSprite(&self->animator, NULL, false);
322
323
self->animator.frameID = 2;
324
RSDK.DrawSprite(&self->animator, NULL, false);
325
}
326
327
void BigSqueeze_StateManager_SetupIntro(void)
328
{
329
RSDK_THIS(BigSqueeze);
330
331
if (++self->setupTimer >= 8) {
332
self->setupTimer = 0;
333
foreach_all(CollapsingPlatform, platform)
334
{
335
platform->collapseDelay = 1;
336
platform->active = ACTIVE_NEVER;
337
}
338
339
foreach_active(Eggman, eggman) { eggman->direction = FLIP_X; }
340
341
Zone->playerBoundActiveL[0] = true;
342
Zone->playerBoundActiveR[0] = true;
343
Zone->cameraBoundsL[0] = (self->position.x >> 16) - WIDE_SCR_XCENTER;
344
Zone->cameraBoundsR[0] = (self->position.x >> 16) + 308;
345
self->state = BigSqueeze_StateManager_SetupEggman;
346
}
347
}
348
349
void BigSqueeze_StateManager_SetupEggman(void)
350
{
351
RSDK_THIS(BigSqueeze);
352
353
if (self->setupTimer) {
354
self->setupTimer++;
355
EntityEggman *eggmanPtr = self->eggman;
356
357
if (self->setupTimer == 104)
358
RSDK.SetSpriteAnimation(Eggman->aniFrames, 5, &eggmanPtr->animator, true, 0);
359
360
if (self->setupTimer == 120) {
361
self->setupTimer = 0;
362
self->state = BigSqueeze_StateManager_SetupArena;
363
eggmanPtr->onGround = false;
364
eggmanPtr->velocity.x = -0x10000;
365
eggmanPtr->velocity.y = -0x40000;
366
eggmanPtr->state = Eggman_State_ProcessAirThenSet;
367
eggmanPtr->animID = 2;
368
}
369
}
370
else {
371
if (RSDK_GET_ENTITY(SLOT_PLAYER1, Player)->position.x > self->position.x) {
372
Music_TransitionTrack(TRACK_MINIBOSS, 0.0125);
373
++self->setupTimer;
374
375
foreach_active(LightBarrier, barrier) { barrier->enabled = true; }
376
377
foreach_active(Eggman, eggman)
378
{
379
self->eggman = eggman;
380
RSDK.SetSpriteAnimation(Eggman->aniFrames, 2, &eggman->animator, true, 0);
381
eggman->state = Eggman_State_ProcessThenSet;
382
eggman->animID = 0;
383
}
384
}
385
}
386
}
387
388
void BigSqueeze_StateManager_SetupArena(void)
389
{
390
RSDK_THIS(BigSqueeze);
391
392
EntityEggman *eggman = self->eggman;
393
if (eggman->state == Eggman_State_ProcessAnimation) {
394
foreach_all(CollapsingPlatform, platform) { platform->active = ACTIVE_BOUNDS; }
395
396
Zone->cameraBoundsR[0] = (self->position.x >> 16) + WIDE_SCR_XCENTER;
397
Zone->cameraBoundsB[0] = 1792;
398
Zone->cameraBoundsT[0] = Zone->cameraBoundsB[0] - ScreenInfo->size.y;
399
400
BigSqueeze->boundsB = (Zone->cameraBoundsB[0] - 16) << 16;
401
eggman->state = Eggman_State_ProcessThenSet;
402
eggman->animID = 0;
403
self->state = BigSqueeze_StateManager_SetupBoss;
404
}
405
}
406
407
void BigSqueeze_StateManager_SetupBoss(void)
408
{
409
RSDK_THIS(BigSqueeze);
410
411
if (++self->setupTimer == 48) {
412
foreach_active(BigSqueeze, boss)
413
{
414
switch (boss->type) {
415
default: break;
416
417
case BIGSQUEEZE_BOSS:
418
boss->invincible = true;
419
boss->state = BigSqueeze_StateBoss_Idle;
420
boss->velocity.x = -0x10000;
421
break;
422
423
case BIGSQUEEZE_CRUSHER_L:
424
boss->state = BigSqueeze_StateCrusher_BeginCrushing;
425
boss->velocity.x = 0x8000;
426
boss->hitbox.top = -0x7FFF;
427
break;
428
429
case BIGSQUEEZE_CRUSHER_R:
430
boss->state = BigSqueeze_StateCrusher_BeginCrushing;
431
boss->velocity.x = -0x8000;
432
boss->hitbox.top = -0x7FFF;
433
break;
434
}
435
}
436
437
self->state = BigSqueeze_StateManager_HandleBoss;
438
}
439
}
440
441
void BigSqueeze_StateBoss_Idle(void)
442
{
443
RSDK_THIS(BigSqueeze);
444
445
if (self->setupTimer > 30)
446
BigSqueeze_HandleBossMovement();
447
448
if (++self->setupTimer == 180) {
449
self->invincible = false;
450
self->setupTimer = 0;
451
RSDK.SetSpriteAnimation(BigSqueeze->aniFrames, 5, &self->electricAnimator, true, 0);
452
self->state = BigSqueeze_StateBoss_Electrified;
453
}
454
455
BigSqueeze_CheckPlayerCollisions_Vulnerable();
456
}
457
458
void BigSqueeze_StateBoss_Electrified(void)
459
{
460
RSDK_THIS(BigSqueeze);
461
462
RSDK.ProcessAnimation(&self->domeAnimator);
463
464
// Uncomment this line if you want the prongs to animate when the boss is attacking
465
// This is all that's needed to get them animating with no issues, so I assume this line being absent was prolly an oversight?
466
// RSDK.ProcessAnimation(&self->prongsAnimator);
467
468
RSDK.ProcessAnimation(&self->electricAnimator);
469
470
if (!self->setupTimer)
471
RSDK.PlaySfx(BigSqueeze->sfxOrbinaut, false, 255);
472
473
if (++self->setupTimer == 16)
474
FBZTrash_SummonOrbinaut(self->position.x, self->position.y + 0x300000);
475
476
if (self->setupTimer == 120) {
477
self->setupTimer = 0;
478
RSDK.SetSpriteAnimation(BigSqueeze->aniFrames, 2, &self->domeAnimator, true, 0);
479
RSDK.SetSpriteAnimation(-1, 0, &self->electricAnimator, true, 0);
480
self->state = BigSqueeze_StateBoss_Idle;
481
}
482
483
if (!(Zone->timer & 0xF))
484
RSDK.PlaySfx(BigSqueeze->sfxMagnet, false, 255);
485
486
BigSqueeze_CheckPlayerCollisions_Electrified();
487
}
488
489
void BigSqueeze_StateBoss_Destroyed(void)
490
{
491
RSDK_THIS(BigSqueeze);
492
493
BigSqueeze_Explode();
494
495
++self->setupTimer;
496
if (self->type == BIGSQUEEZE_BOSS) {
497
switch (self->setupTimer) {
498
case 20:
499
BigSqueeze_SpawnDebris(BigSqueeze->prongDebrisInfo);
500
RSDK.SetSpriteAnimation(-1, 0, &self->prongsAnimator, true, 0);
501
break;
502
503
case 40:
504
BigSqueeze_SpawnDebris(BigSqueeze->domeDebrisInfo);
505
RSDK.SetSpriteAnimation(-1, 0, &self->domeAnimator, true, 0);
506
break;
507
508
case 60:
509
BigSqueeze_SpawnDebris(BigSqueeze->baseDebrisInfo);
510
RSDK.SetSpriteAnimation(-1, 0, &self->animator, true, 0);
511
RSDK.SetSpriteAnimation(-1, 0, &self->wheelAnimator, true, 0);
512
break;
513
514
case 80:
515
Music_TransitionTrack(TRACK_STAGE, 0.0125);
516
self->setupTimer = 0;
517
self->visible = false;
518
self->state = BigSqueeze_StateBoss_DropSignPost;
519
foreach_active(FBZTrash, trash)
520
{
521
if (trash->state != FBZTrash_State_LooseTrash) {
522
CREATE_ENTITY(Explosion, INT_TO_VOID(EXPLOSION_ENEMY), trash->position.x, trash->position.y)->drawGroup =
523
Zone->objectDrawGroup[1];
524
RSDK.PlaySfx(Explosion->sfxDestroy, false, 255);
525
destroyEntity(trash);
526
}
527
}
528
break;
529
}
530
}
531
else if (self->timer == 80) {
532
destroyEntity(self);
533
}
534
}
535
536
void BigSqueeze_StateBoss_DropSignPost(void)
537
{
538
RSDK_THIS(BigSqueeze);
539
540
BigSqueeze->isCrushing = false;
541
if (++self->setupTimer == 48) {
542
foreach_all(SignPost, signPost)
543
{
544
signPost->position.x = self->position.x;
545
signPost->active = ACTIVE_NORMAL;
546
signPost->state = SignPost_State_Falling;
547
RSDK.PlaySfx(SignPost->sfxTwinkle, false, 255);
548
}
549
550
self->state = StateMachine_None;
551
}
552
}
553
554
void BigSqueeze_StateManager_HandleOutro(void)
555
{
556
RSDK_THIS(BigSqueeze);
557
558
self->position.y = BigSqueeze->boundsB;
559
}
560
561
void BigSqueeze_StateManager_HandleBoss(void)
562
{
563
RSDK_THIS(BigSqueeze);
564
565
self->position.y = BigSqueeze->boundsB;
566
567
foreach_active(Player, player)
568
{
569
if (Player_CheckCollisionPlatform(player, self, &self->hitbox)) {
570
if (abs(player->groundVel) > 0x20000 && !(Zone->timer & 7)) {
571
int32 x = player->position.x + RSDK.Rand(-0x40000, 0x40000);
572
int32 y = player->position.y + 0x40000 + RSDK.Rand(-0x40000, 0x40000);
573
EntityDebris *debris = CREATE_ENTITY(Debris, Debris_State_Fall, x, y);
574
575
RSDK.SetSpriteAnimation(FBZTrash->aniFrames, RSDK.Rand(0, 2) + 9, &debris->animator, false, 0);
576
debris->velocity.x = RSDK.Rand(-0x20000, 0x20000);
577
debris->velocity.y = -0x20000;
578
debris->gravityStrength = 0x3800;
579
debris->drawGroup = Zone->objectDrawGroup[0];
580
debris->updateRange.x = 0x200000;
581
debris->updateRange.y = 0x200000;
582
}
583
}
584
}
585
586
foreach_active(FBZSinkTrash, sinkTrash)
587
{
588
sinkTrash->position.y = BigSqueeze->boundsB + (sinkTrash->size.y >> 1);
589
sinkTrash->size.x = BigSqueeze->crusherX[BIGSQUEEZE_CRUSHER_R] - BigSqueeze->crusherX[BIGSQUEEZE_CRUSHER_L];
590
}
591
}
592
593
void BigSqueeze_StateCrusher_BeginCrushing(void)
594
{
595
RSDK_THIS(BigSqueeze);
596
597
BigSqueeze_HandleWallCollisions();
598
599
BigSqueeze->crusherX[self->type] = self->position.x;
600
if (++self->setupTimer == 8) {
601
BigSqueeze->isCrushing = false;
602
}
603
604
if (self->setupTimer == 300) {
605
self->setupTimer = 0;
606
self->state = BigSqueeze_StateCrusher_Crushing;
607
BigSqueeze->isCrushing = true;
608
if (self->velocity.x > 0)
609
++BigSqueeze->crushTimer;
610
}
611
}
612
613
void BigSqueeze_StateCrusher_Crushing(void)
614
{
615
RSDK_THIS(BigSqueeze);
616
617
BigSqueeze_HandleWallCollisions();
618
619
self->position.x += self->velocity.x;
620
BigSqueeze->crusherX[self->type] = self->position.x;
621
622
if (!(Zone->timer & 3))
623
Camera_ShakeScreen(0, 0, 4);
624
625
if (self->type == BIGSQUEEZE_CRUSHER_L)
626
BigSqueeze->boundsB -= 0x4000;
627
628
if (++self->setupTimer == 32 && BigSqueeze->crushTimer < 10) {
629
self->setupTimer = 0;
630
self->state = BigSqueeze_StateCrusher_BeginCrushing;
631
}
632
}
633
634
#if GAME_INCLUDE_EDITOR
635
void BigSqueeze_EditorDraw(void)
636
{
637
RSDK_THIS(BigSqueeze);
638
639
switch (self->type) {
640
case BIGSQUEEZE_MANAGER:
641
self->updateRange.x = 0x800000;
642
self->updateRange.y = 0x800000;
643
644
RSDK.SetSpriteAnimation(BigSqueeze->aniFrames, 4, &self->wheelAnimator, true, 0);
645
RSDK.DrawSprite(&self->wheelAnimator, NULL, false); // an odd sprite, but it beats no sprite
646
break;
647
648
case BIGSQUEEZE_BOSS:
649
self->updateRange.x = 0x8000000;
650
self->updateRange.y = 0x1000000;
651
self->drawGroup = Zone->objectDrawGroup[1];
652
RSDK.SetSpriteAnimation(BigSqueeze->aniFrames, 1, &self->animator, true, 0);
653
RSDK.SetSpriteAnimation(BigSqueeze->aniFrames, 2, &self->domeAnimator, true, 0);
654
RSDK.SetSpriteAnimation(BigSqueeze->aniFrames, 3, &self->prongsAnimator, true, 0);
655
RSDK.SetSpriteAnimation(BigSqueeze->aniFrames, 4, &self->wheelAnimator, true, 0);
656
BigSqueeze_Draw_Boss();
657
break;
658
659
case BIGSQUEEZE_CRUSHER_L:
660
case BIGSQUEEZE_CRUSHER_R:
661
if (self->type == BIGSQUEEZE_CRUSHER_R) {
662
self->direction = FLIP_X;
663
self->drawFX = FX_FLIP;
664
}
665
self->updateRange.x = 0x8000000;
666
self->updateRange.y = 0x1000000;
667
self->drawGroup = Zone->objectDrawGroup[1];
668
RSDK.SetSpriteAnimation(BigSqueeze->aniFrames, 0, &self->animator, true, 0);
669
BigSqueeze_Draw_Crusher();
670
break;
671
672
default: break;
673
}
674
}
675
676
void BigSqueeze_EditorLoad(void)
677
{
678
BigSqueeze->aniFrames = RSDK.LoadSpriteAnimation("FBZ/BigSqueeze.bin", SCOPE_STAGE);
679
680
RSDK_ACTIVE_VAR(BigSqueeze, type);
681
RSDK_ENUM_VAR("Manager", BIGSQUEEZE_MANAGER);
682
RSDK_ENUM_VAR("Boss", BIGSQUEEZE_BOSS);
683
RSDK_ENUM_VAR("Left Crusher", BIGSQUEEZE_CRUSHER_L);
684
RSDK_ENUM_VAR("Right Crusher", BIGSQUEEZE_CRUSHER_R);
685
}
686
#endif
687
688
void BigSqueeze_Serialize(void) { RSDK_EDITABLE_VAR(BigSqueeze, VAR_ENUM, type); }
689
690