Path: blob/master/SonicMania/Objects/SSZ/GigaMetal.c
338 views
// ---------------------------------------------------------------------1// RSDK Project: Sonic Mania2// Object Description: GigaMetal Object3// Object Author: Christian Whitehead/Simon Thomley/Hunter Bridges4// Decompiled by: Rubberduckycooly & RMGRich5// ---------------------------------------------------------------------67#include "Game.h"89#if MANIA_USE_PLUS10ObjectGigaMetal *GigaMetal;1112void GigaMetal_Update(void)13{14RSDK_THIS(GigaMetal);1516StateMachine_Run(self->state);17}1819void GigaMetal_LateUpdate(void) {}2021void GigaMetal_StaticUpdate(void) {}2223void GigaMetal_Draw(void)24{25RSDK_THIS(GigaMetal);2627if (GigaMetal->explodeTimer <= 0) {28if (GigaMetal->invincibleTimer & 1) {29RSDK.CopyPalette(2, 32, 0, 32, 16);30RSDK.CopyPalette(2, 160, 0, 160, 10);31RSDK.CopyPalette(2, 240, 0, 240, 7);3233if (self->stateDraw) {34StateMachine_Run(self->stateDraw);35}36else {37RSDK.DrawSprite(&self->mainAnimator, NULL, false);38}3940RSDK.CopyPalette(1, 32, 0, 32, 16);41RSDK.CopyPalette(1, 160, 0, 160, 10);42RSDK.CopyPalette(1, 240, 0, 240, 7);43}44else {45if (self->stateDraw) {46StateMachine_Run(self->stateDraw);47}48else {49RSDK.DrawSprite(&self->mainAnimator, NULL, false);50}51}52}53else {54RSDK.SetLimitedFade(0, 4, 5, GigaMetal->explodeTimer, 0, 256);5556if (self->stateDraw) {57StateMachine_Run(self->stateDraw);58}59else {60RSDK.DrawSprite(&self->mainAnimator, NULL, false);61}6263RSDK.CopyPalette(4, 1, 0, 1, 255);64}65}6667void GigaMetal_Create(void *data)68{69RSDK_THIS(GigaMetal);7071if (!SceneInfo->inEditor) {72if (globals->gameMode < MODE_TIMEATTACK) {73self->drawGroup = Zone->objectDrawGroup[0] - 1;74self->updateRange.x = 0x800000;75self->updateRange.y = 0x800000;76int32 slot = RSDK.GetEntitySlot(self);7778if (data)79self->aniID = VOID_TO_INT(data);8081switch (self->aniID) {82case GIGAMETAL_HEAD:83self->body = RSDK_GET_ENTITY(slot - 1, GigaMetal);84self->frontArm = RSDK_GET_ENTITY(slot + 3, GigaMetal);85self->backArm = RSDK_GET_ENTITY(slot - 2, GigaMetal);86self->stateDraw = GigaMetal_Draw_Head;87self->componentPos.x = 0x140000;88self->componentPos.y = -0x240000;8990RSDK.SetSpriteAnimation(GigaMetal->aniFrames, GIGAMETAL_HEAD, &self->mainAnimator, true, 0);91break;9293case GIGAMETAL_SHOULDER:94self->body = RSDK_GET_ENTITY(slot - 5, GigaMetal);95self->frontArm = RSDK_GET_ENTITY(slot - 1, GigaMetal);9697self->stateDraw = GigaMetal_Draw_Shoulder;98self->componentPos.y = -0x2C0000;99self->componentPos.x = -0x240000;100self->drawGroup = Zone->objectDrawGroup[1];101102RSDK.SetSpriteAnimation(GigaMetal->aniFrames, GIGAMETAL_SHOULDER, &self->mainAnimator, true, 0);103break;104105case GIGAMETAL_BODY: {106self->head = RSDK_GET_ENTITY(slot + 1, GigaMetal);107self->ruby = RSDK_GET_ENTITY(slot + 2, PhantomRuby);108self->cover = RSDK_GET_ENTITY(slot + 3, GigaMetal);109self->frontArm = RSDK_GET_ENTITY(slot + 4, GigaMetal);110self->backArm = RSDK_GET_ENTITY(slot - 1, GigaMetal);111self->shoulder = RSDK_GET_ENTITY(slot + 5, GigaMetal);112113self->active = ACTIVE_BOUNDS;114RSDK.SetSpriteAnimation(GigaMetal->aniFrames, GIGAMETAL_BODY, &self->mainAnimator, true, 0);115116foreach_all(MetalSonic, metal) { self->metalSonic = metal; }117118self->health = 8;119self->state = GigaMetal_StateBody_AwaitPlayer;120break;121}122123case GIGAMETAL_COVER:124self->body = RSDK_GET_ENTITY(slot - 3, GigaMetal);125126self->stateDraw = GigaMetal_Draw_Cover;127self->inkEffect = INK_ADD;128self->alpha = 0xFF;129130RSDK.SetSpriteAnimation(GigaMetal->aniFrames, GIGAMETAL_COVER, &self->mainAnimator, true, 0);131break;132133case GIGAMETAL_ARMFRONT:134self->body = RSDK_GET_ENTITY(slot - 4, GigaMetal);135136self->stateDraw = GigaMetal_Draw_Arm;137self->componentPos.x = -0x1C0000;138self->componentPos.y = -0x2C0000;139self->drawGroup = Zone->objectDrawGroup[1];140141RSDK.SetSpriteAnimation(GigaMetal->aniFrames, GIGAMETAL_ARMFRONT, &self->mainAnimator, true, 0);142RSDK.SetSpriteAnimation(GigaMetal->aniFrames, GIGAMETAL_ARMFRONT, &self->jointAnimator, true, 1);143RSDK.SetSpriteAnimation(GigaMetal->aniFrames, GIGAMETAL_ARMFRONT, &self->armAnimator, true, 2);144RSDK.SetSpriteAnimation(GigaMetal->aniFrames, GIGAMETAL_ARMFRONT, &self->handAnimator, true, 3);145break;146147case GIGAMETAL_ARMBACK:148self->body = RSDK_GET_ENTITY(slot + 1, GigaMetal);149150self->stateDraw = GigaMetal_Draw_Arm;151self->componentPos.x = -0xC0000;152self->componentPos.y = -0x2C0000;153154RSDK.SetSpriteAnimation(GigaMetal->aniFrames, GIGAMETAL_ARMBACK, &self->mainAnimator, true, 0);155RSDK.SetSpriteAnimation(GigaMetal->aniFrames, GIGAMETAL_ARMBACK, &self->jointAnimator, true, 1);156RSDK.SetSpriteAnimation(GigaMetal->aniFrames, GIGAMETAL_ARMBACK, &self->armAnimator, true, 2);157RSDK.SetSpriteAnimation(GigaMetal->aniFrames, GIGAMETAL_ARMBACK, &self->handAnimator, true, 3);158break;159160case GIGAMETAL_LASEREDGE:161self->drawFX = FX_ROTATE;162self->laserSize = -1;163self->angle = 0x40;164self->active = ACTIVE_NORMAL;165self->visible = true;166self->scale.x = 0x200;167self->scale.y = 0x200;168self->state = GigaMetal_State_Laser;169self->stateDraw = GigaMetal_Draw_LaserEdge;170171RSDK.SetSpriteAnimation(GigaMetal->aniFrames, GIGAMETAL_LASEREDGE, &self->mainAnimator, true, 0);172RSDK.SetSpriteAnimation(GigaMetal->aniFrames, GIGAMETAL_LASERBEAM, &self->jointAnimator, true, 0);173RSDK.SetSpriteAnimation(GigaMetal->aniFrames, GIGAMETAL_LASEREDGE, &self->armAnimator, true, 1);174break;175176case GIGAMETAL_SHARD:177self->scale.x = RSDK.Rand(0x200, 0x400);178self->scale.y = RSDK.Rand(0x200, 0x400);179self->rotationAngles[0] = RSDK.Rand(0, 0x400);180self->rotationAngles[1] = RSDK.Rand(0, 0x400);181self->rotationAngles[2] = RSDK.Rand(0, 0x400);182183self->active = ACTIVE_NORMAL;184self->visible = true;185self->drawGroup = Zone->objectDrawGroup[1];186self->velocity.x = RSDK.Rand(-0x10000, 0x10000);187self->velocity.y = RSDK.Rand(-0x40000, -0x10000);188self->groundVel = RSDK.Rand(-16, 16);189190self->state = GigaMetal_State_Shard;191self->stateDraw = GigaMetal_Draw_Shard;192break;193194default: break;195}196}197else {198destroyEntity(self);199}200}201}202203void GigaMetal_StageLoad(void)204{205GigaMetal->aniFrames = RSDK.LoadSpriteAnimation("SSZ2/GigaMetal.bin", SCOPE_STAGE);206207GigaMetal->hitboxLaser.left = -12;208GigaMetal->hitboxLaser.top = -12;209GigaMetal->hitboxLaser.right = 12;210GigaMetal->hitboxLaser.bottom = 12;211212GigaMetal->hitboxHand.left = -12;213GigaMetal->hitboxHand.top = -10;214GigaMetal->hitboxHand.right = 12;215GigaMetal->hitboxHand.bottom = 10;216217GigaMetal->hitboxCore.left = -40;218GigaMetal->hitboxCore.top = -16;219GigaMetal->hitboxCore.right = 40;220GigaMetal->hitboxCore.bottom = 40;221222GigaMetal->hitboxHead.left = -56;223GigaMetal->hitboxHead.top = -124;224GigaMetal->hitboxHead.right = 16;225GigaMetal->hitboxHead.bottom = -64;226227GigaMetal->sfxRoar = RSDK.GetSfx("SSZ2/MSRoar.wav");228GigaMetal->sfxImpact = RSDK.GetSfx("Stage/Impact6.wav");229GigaMetal->sfxTarget = RSDK.GetSfx("SSZ2/MSTarget.wav");230GigaMetal->sfxPimpom = RSDK.GetSfx("Stage/PimPom.wav");231GigaMetal->sfxCannon = RSDK.GetSfx("SSZ2/MSCannon.wav");232233RSDK.CopyPalette(0, 1, 4, 1, 255);234// Pink blend palette235for (int32 i = 0; i < 256; ++i) RSDK.SetPaletteEntry(5, i, 0xF00080);236237GigaMetal->invincibleTimer = 0;238GigaMetal->explodeTimer = 0;239240if (StarPost->postIDs[0]) {241foreach_all(Music, music)242{243if (music->playOnLoad)244music->trackID = TRACK_METALSONIC;245}246247Music->restartTrackID = TRACK_METALSONIC;248}249}250251void GigaMetal_Draw_Cover(void)252{253RSDK_THIS(GigaMetal);254255self->position.x = self->body->position.x + self->componentPos.x;256self->position.y = self->body->position.y + self->componentPos.y;257258RSDK.DrawSprite(&self->mainAnimator, NULL, false);259}260261void GigaMetal_Draw_Head(void)262{263RSDK_THIS(GigaMetal);264265self->position.x = self->body->position.x + self->componentPos.x;266self->position.y = self->body->position.y + self->componentPos.y;267268RSDK.DrawSprite(&self->mainAnimator, NULL, false);269RSDK.DrawSprite(&self->jointAnimator, NULL, false);270RSDK.DrawSprite(&self->armAnimator, NULL, false);271}272273void GigaMetal_Draw_Shoulder(void)274{275RSDK_THIS(GigaMetal);276277self->position.x = self->body->position.x + self->componentPos.x;278self->position.y = self->body->position.y + self->componentPos.y;279280self->position.x = MIN(3 * (self->position.x >> 2) + ((self->frontArm->position.x - 0xC0000) >> 2), self->position.x);281282RSDK.DrawSprite(&self->mainAnimator, NULL, false);283}284285void GigaMetal_Draw_Arm(void)286{287RSDK_THIS(GigaMetal);288Vector2 drawPos;289290self->position.x = self->body->position.x + self->componentPos.x;291self->position.y = self->body->position.y + self->componentPos.y;292293int32 angle = self->rotationAngles[0] >> 6;294drawPos.x = (RSDK.Sin1024(angle) << 11) + self->position.x;295drawPos.y = (RSDK.Cos1024(angle) << 11) + self->position.y;296self->position.x = drawPos.x;297self->position.y = drawPos.y;298RSDK.DrawSprite(&self->mainAnimator, &drawPos, false);299300angle += (self->rotationAngles[1] >> 6);301drawPos.x += 0x600 * RSDK.Sin1024(angle);302drawPos.y += 0x600 * RSDK.Cos1024(angle);303304if (self->mainAnimator.animationID == GIGAMETAL_ARMFRONT) {305self->drawFX = FX_ROTATE;306self->rotation = -(angle >> 1);307RSDK.DrawSprite(&self->armAnimator, &drawPos, false);308309self->drawFX = FX_NONE;310RSDK.DrawSprite(&self->jointAnimator, &drawPos, false);311}312else {313RSDK.DrawSprite(&self->jointAnimator, &drawPos, false);314315self->drawFX = FX_ROTATE;316self->rotation = -(angle >> 1);317RSDK.DrawSprite(&self->armAnimator, &drawPos, false);318319self->drawFX = FX_NONE;320}321322drawPos.x += RSDK.Sin1024(angle) << 9;323drawPos.y += RSDK.Cos1024(angle) << 9;324325angle += 0x100;326drawPos.x += 0x1500 * RSDK.Sin1024(angle);327drawPos.y += 0x1500 * RSDK.Cos1024(angle);328self->drawFX = FX_ROTATE;329self->rotation = -((angle + ((self->rotationAngles[2] >> 6) - 256)) >> 1);330RSDK.DrawSprite(&self->handAnimator, &drawPos, false);331332self->drawFX = FX_NONE;333}334335void GigaMetal_Draw_LaserEdge(void)336{337RSDK_THIS(GigaMetal);338339Vector2 drawPos;340self->position.x = self->body->position.x;341self->position.y = self->body->position.y;342343// Draw Laser Edge (Bit that emits laser)344int32 angle = self->angle - self->body->rotation;345self->rotation = self->angle + self->body->rotation;346drawPos.x = (RSDK.Sin512(angle + 8) << 12) + self->position.x;347drawPos.y = (RSDK.Cos512(angle + 8) << 12) + self->position.y;348RSDK.DrawSprite(&self->mainAnimator, &drawPos, false);349350int32 moveX = (RSDK.Sin512(angle) << 12) & 0xFFFF0000;351int32 moveY = (RSDK.Cos512(angle) << 12) & 0xFFFF0000;352353// Draw Laser354for (int32 i = 0; i < self->laserSize; ++i) {355RSDK.DrawSprite(&self->jointAnimator, &drawPos, false);356drawPos.x += moveX;357drawPos.y += moveY;358}359360// Draw Laser Edge (Bit that hits the ground)361RSDK.DrawSprite(&self->armAnimator, &drawPos, false);362}363364void GigaMetal_Draw_Shard(void)365{366RSDK_THIS(GigaMetal);367368Vector2 vertices[3];369370int32 x = ScreenInfo[SceneInfo->currentScreenID].position.x << 16;371int32 y = ScreenInfo[SceneInfo->currentScreenID].position.y << 16;372373int32 angle = self->angle + self->rotationAngles[0];374vertices[0].x = self->scale.x * RSDK.Sin1024(angle) - x + self->position.x;375vertices[0].y = self->scale.y * RSDK.Cos1024(angle) + self->position.y - y;376377angle = self->angle + self->rotationAngles[1];378vertices[1].x = self->scale.x * RSDK.Sin1024(angle) - x + self->position.x;379vertices[1].y = self->scale.y * RSDK.Cos1024(angle) + self->position.y - y;380381angle = self->angle + self->rotationAngles[2];382vertices[2].x = self->scale.x * RSDK.Sin1024(angle) - x + self->position.x;383vertices[2].y = self->scale.y * RSDK.Cos1024(angle) + self->position.y - y;384385RSDK.DrawFace(vertices, 3, 0xF0, 0x00, 0x80, 0xFF, INK_ADD);386}387388void GigaMetal_HandleCameraMovement(void)389{390Zone->cameraBoundsL[0] += 2;391Zone->cameraBoundsR[0] += 2;392393EntityCamera *camera = RSDK_GET_ENTITY(SLOT_CAMERA1, Camera);394camera->boundsL = Zone->cameraBoundsL[0];395camera->boundsR = Zone->cameraBoundsR[0];396camera->position.x = (Zone->cameraBoundsR[0] + camera->boundsL) << 15;397398MetalSonic_HandleStageWrap();399}400401void GigaMetal_CheckPlayerCollisions(void)402{403RSDK_THIS(GigaMetal);404405if (GigaMetal->invincibleTimer > 0)406GigaMetal->invincibleTimer--;407408foreach_active(Player, player)409{410if (Player_CheckCollisionTouch(player, self, &GigaMetal->hitboxHead) && player->velocity.x < 0 && Player_CheckBossHit(player, self)) {411player->velocity.x = abs(player->velocity.x) + Zone->autoScrollSpeed;412RSDK.PlaySfx(GigaMetal->sfxPimpom, false, 0xFF);413}414}415416foreach_active(Player, playerPtr)417{418if (!GigaMetal->invincibleTimer && Player_CheckBadnikTouch(playerPtr, self, &GigaMetal->hitboxCore) && Player_CheckBossHit(playerPtr, self)) {419playerPtr->velocity.x += Zone->autoScrollSpeed;420GigaMetal_Hit();421}422}423}424425void GigaMetal_Hit(void)426{427RSDK_THIS(GigaMetal);428429if (--self->health <= 0) {430EntityGigaMetal *head = self->head;431EntityGigaMetal *frontArm = self->frontArm;432EntityGigaMetal *backArm = self->backArm;433head->state = StateMachine_None;434frontArm->state = StateMachine_None;435backArm->state = StateMachine_None;436437self->timer = 0;438self->state = GigaMetal_StateBody_Destroyed;439SceneInfo->timeEnabled = false;440Player_GiveScore(RSDK_GET_ENTITY(SLOT_PLAYER1, Player), 1000);441}442else {443GigaMetal->invincibleTimer = 40;444RSDK.PlaySfx(MetalSonic->sfxHit, false, 255);445446EntityGigaMetal *cover = self->cover;447++cover->mainAnimator.frameID;448}449}450451void GigaMetal_StateBody_AwaitPlayer(void)452{453RSDK_THIS(GigaMetal);454455EntityPlayer *player1 = RSDK_GET_ENTITY(SLOT_PLAYER1, Player);456if (player1->position.y < self->position.y && !player1->collisionPlane) {457458Zone->playerBoundActiveL[0] = true;459Zone->playerBoundActiveR[0] = true;460461Zone->cameraBoundsL[0] = FROM_FIXED(self->position.x) - ScreenInfo->center.x + 32;462Zone->cameraBoundsR[0] = FROM_FIXED(self->position.x) + ScreenInfo->center.x + 32;463Zone->cameraBoundsT[0] = FROM_FIXED(self->position.y) - ScreenInfo->size.y + 16;464Zone->cameraBoundsB[0] = FROM_FIXED(self->position.y) + 16;465Zone->deathBoundary[0] = FROM_FIXED(self->position.y) + 16;466467EntityMetalSonic *metal = self->metalSonic;468if (metal) {469if (!metal->onScreen) {470metal->position.x = self->position.x - 0xC00000;471metal->position.y = self->position.y + 0x400000;472}473metal->angle = 0;474metal->targetPos.x = self->position.x - 0x400000;475metal->targetPos.y = self->position.y - 0x500000;476metal->timer = 0;477metal->visible = true;478metal->active = ACTIVE_NORMAL;479metal->state = MetalSonic_State_WaitForRuby;480RSDK.SetSpriteAnimation(MetalSonic->aniFrames, MS_ANI_HOVER, &metal->metalSonicAnimator, false, 0);481RSDK.SetSpriteAnimation(MetalSonic->aniFrames, MS_ANI_BOOSTER_WEAK, &metal->boosterAnimator, false, 0);482}483484self->position.x -= 0x500000;485self->position.y -= 0x380000;486self->active = ACTIVE_NORMAL;487self->state = GigaMetal_StateBody_SetupComponents;488489foreach_all(BoundsMarker, marker) { destroyEntity(marker); }490}491}492493void GigaMetal_StateBody_SetupComponents(void)494{495RSDK_THIS(GigaMetal);496497EntityMetalSonic *metal = self->metalSonic;498499// Wait for metal sonic to become inactive (should happen during the white flash)500if (metal->active == ACTIVE_NEVER) {501EntityGigaMetal *head = self->head;502head->visible = true;503head->active = ACTIVE_NORMAL;504505EntityPhantomRuby *ruby = self->ruby;506ruby->startPos.x = self->position.x + 0x200000;507ruby->startPos.y = self->position.y + 0x100000;508ruby->drawGroup = self->drawGroup;509ruby->position.x = ruby->startPos.x;510ruby->position.y = ruby->startPos.y;511512EntityGigaMetal *cover = self->cover;513cover->visible = true;514cover->active = ACTIVE_NORMAL;515516EntityGigaMetal *shoulder = self->shoulder;517shoulder->visible = true;518shoulder->active = ACTIVE_NORMAL;519520EntityGigaMetal *frontArm = self->frontArm;521frontArm->visible = true;522frontArm->active = ACTIVE_NORMAL;523frontArm->state = GigaMetal_StateArm_Idle_Front;524525EntityGigaMetal *backArm = self->backArm;526backArm->visible = true;527backArm->active = ACTIVE_NORMAL;528backArm->state = GigaMetal_StateArm_Idle_Front;529530self->visible = true;531self->state = GigaMetal_StateBody_Transformed;532RSDK.CopyTileLayer(Zone->fgLayer[1], 0, 34, Zone->fgLayer[1], 0, 26, 256, 6);533534foreach_active(Player, player)535{536if (player->position.x < self->position.x + 0xE00000)537player->position.x = self->position.x + 0xE00000;538539player->position.y = ruby->position.y + 0x80000;540player->groundVel = 0;541player->velocity.x = 0;542}543}544}545546void GigaMetal_StateBody_Transformed(void)547{548RSDK_THIS(GigaMetal);549550if (++self->timer == 120) {551EntityGigaMetal *head = self->head;552head->state = GigaMetal_StateHead_PrepareRoar;553554EntityGigaMetal *frontArm = self->frontArm;555frontArm->state = GigaMetal_StateArm_Idle_Behind;556557EntityGigaMetal *backArm = self->backArm;558backArm->state = GigaMetal_StateArm_Idle_Behind;559560self->timer = 0;561self->state = GigaMetal_StateBody_Roar;562}563}564565void GigaMetal_StateBody_Roar(void)566{567RSDK_THIS(GigaMetal);568569++self->timer;570if (!(self->timer & 7))571Camera_ShakeScreen(0, 0, 4);572573if (self->timer == 120) {574EntityGigaMetal *head = self->head;575head->state = GigaMetal_StateHead_FinishRoar;576577EntityGigaMetal *frontArm = self->frontArm;578frontArm->timer = 48;579frontArm->state = GigaMetal_StateArm_Marching;580581EntityGigaMetal *backArm = self->backArm;582backArm->timer = 48;583backArm->angle = 128;584backArm->state = GigaMetal_StateArm_Marching;585586self->targetPos.x = self->position.x;587self->targetPos.y = self->position.y + 0x80000;588self->timer = 320;589self->velocity.x = 0x20000;590self->state = GigaMetal_StateBody_Marching;591Zone->autoScrollSpeed = 0x20000;592}593}594595void GigaMetal_StateBody_Marching(void)596{597RSDK_THIS(GigaMetal);598599self->position.x += self->velocity.x;600601if ((RSDK.Sin256(self->angle) & 0x200000) != 0)602self->position.y = self->targetPos.y - -(RSDK.Sin256(self->angle) << 10);603else604self->position.y = self->targetPos.y - (RSDK.Sin256(self->angle) << 10);605606self->angle = (self->angle + 2) & 0xFF;607608EntityPhantomRuby *ruby = self->ruby;609ruby->position.x = self->position.x + 0x200000;610ruby->startPos.y = self->position.y + 0x100000;611612EntityGigaMetal *head = self->head;613if (!(self->angle & 0x7F)) {614if (!head->state) {615head->targetPos.x = head->componentPos.x;616head->targetPos.y = head->componentPos.y;617head->velocity.y = 0x10000;618head->state = GigaMetal_StateHead_Impact;619RSDK.PlaySfx(GigaMetal->sfxImpact, false, 255);620}621622EntityGigaMetal *shoulder = self->shoulder;623shoulder->targetPos.x = shoulder->componentPos.x;624shoulder->targetPos.y = shoulder->componentPos.y;625shoulder->velocity.y = -0x12000;626shoulder->state = GigaMetal_StateShoulder_Impact;627628Camera_ShakeScreen(0, 0, 4);629}630631if (!head->state || head->state == GigaMetal_StateHead_Impact)632--self->timer;633634if (self->timer <= 0) {635EntityGigaMetal *frontArm = self->frontArm;636EntityGigaMetal *backArm = self->backArm;637638self->timer = RSDK.Rand(240, 480);639if (RSDK.Rand(0, 1024) <= 0x200) {640if (self->attackTimer & 0xFFFFFF00)641self->attackTimer = 0;642else643self->attackTimer++;644645if ((self->attackTimer & 0xFF) > 2)646self->attackTimer = 0x100;647}648else {649if ((self->attackTimer & 0xFFFFFF00) == 0x100)650++self->attackTimer;651else652self->attackTimer = 0x100;653654if ((self->attackTimer & 0xFF) > 2)655self->attackTimer = 0;656}657658head->state = (self->attackTimer & 0xFFFFFF00) == 0x100 ? GigaMetal_StateHead_TargetingPlayer : GigaMetal_StateHead_PrepareLaser;659660frontArm->state = GigaMetal_StateArm_Idle_Behind;661backArm->state = GigaMetal_StateArm_Idle_Behind;662}663664GigaMetal_HandleCameraMovement();665GigaMetal_CheckPlayerCollisions();666667if ((Zone->timer & 7) == 2) {668int32 endX = ((ScreenInfo->size.x + ScreenInfo->position.x) >> 4) + 1;669int32 endY = (ScreenInfo->size.y + ScreenInfo->position.y) >> 4;670671RSDK.CopyTileLayer(Zone->fgLayer[1], endX, endY - 5, Zone->fgLayer[1], endX, endY - 5 + 8, 1, 6);672if (endX > 224)673RSDK.CopyTileLayer(Zone->fgLayer[1], endX - 224, endY - 5, Zone->fgLayer[1], endX - 224, endY - 5 + 8, 1, 6);674675int32 tileX = (ScreenInfo->position.x >> 4) + 8;676int32 spawnY = (endY << 20) + 0x80000;677678for (int32 delay = 4; delay < 40; delay += 6) {679uint16 tile = RSDK.GetTile(Zone->fgLayer[1], tileX, endY);680681if (tile != (uint16)-1) {682EntityBreakableWall *block = CREATE_ENTITY(BreakableWall, INT_TO_VOID(BREAKWALL_TILE_DYNAMIC), (tileX << 20) + 0x80000, spawnY);683block->drawGroup = Zone->objectDrawGroup[1];684block->targetLayer = Zone->fgLayer[1];685block->tileInfo = tile;686block->tilePos.x = tileX;687block->tilePos.y = endY;688block->timer = delay;689block->active = ACTIVE_NORMAL;690691if (tileX > 224) {692block = CREATE_ENTITY(BreakableWall, INT_TO_VOID(BREAKWALL_TILE_DYNAMIC), (tileX << 20) - 0xDF80000, spawnY);693block->drawGroup = Zone->objectDrawGroup[1];694block->targetLayer = Zone->fgLayer[1];695block->tileInfo = tile;696block->tilePos.y = endY;697block->tilePos.x = tileX - 224;698block->timer = delay;699block->updateRange.x = 0x10000000;700block->active = ACTIVE_NORMAL;701}702}703704--endY;705spawnY -= 0x100000;706}707}708}709710void GigaMetal_StateBody_Destroyed(void)711{712RSDK_THIS(GigaMetal);713714self->velocity.y += 0x1000;715self->position.y += self->velocity.y;716717if (self->position.y >= self->targetPos.y) {718EntityGigaMetal *head = self->head;719self->velocity.y = -0xC000;720head->velocity.y = 0x18000;721head->targetPos = head->componentPos;722head->state = GigaMetal_StateHead_Impact;723724EntityGigaMetal *shoulder = self->shoulder;725shoulder->velocity.y = -0x18000;726shoulder->targetPos = shoulder->componentPos;727shoulder->state = GigaMetal_StateShoulder_Impact;728Camera_ShakeScreen(0, 0, 4);729}730731EntityPhantomRuby *ruby = self->ruby;732ruby->position.x = self->position.x + 0x200000;733ruby->startPos.y = self->position.y + 0x100000;734735if (!(Zone->timer & 7)) {736int32 x = self->position.x + RSDK.Rand(-0x600000, 0x600000);737int32 y = self->position.y + RSDK.Rand(-0x600000, 0x600000);738CREATE_ENTITY(Explosion, INT_TO_VOID((RSDK.Rand(0, 256) > 192) + EXPLOSION_BOSS), x, y)->drawGroup = Zone->objectDrawGroup[1];739}740741if (!(Zone->timer % 6))742RSDK.PlaySfx(MetalSonic->sfxExplosion2, false, 255);743744if ((Zone->timer & 0x3F) == 32)745RSDK.PlaySfx(MSBomb->sfxExplosion, false, 255);746747foreach_active(Player, player)748{749if (player->position.x < self->position.x + 0x400000) {750player->velocity.x = 0x40000;751752if (player->velocity.y >= 0) {753player->velocity.y = -0x40000;754player->onGround = false;755RSDK.SetSpriteAnimation(player->aniFrames, ANI_JUMP, &player->animator, false, 0);756}757}758}759760if (GigaMetal->explodeTimer >= 240) {761GigaMetal->explodeTimer = 0;762EntityMetalSonic *metal = self->metalSonic;763764metal->position.x = self->position.x - 0x100000;765metal->position.y = self->position.y - 0x200000;766metal->active = ACTIVE_NORMAL;767metal->state = MetalSonic_State_Defeated;768metal->velocity.x = 0;769metal->velocity.y = -0x40000;770RSDK.SetSpriteAnimation(MetalSonic->aniFrames, MS_ANI_DEFEATED, &metal->metalSonicAnimator, false, 0);771772foreach_active(GigaMetal, part) { destroyEntity(part); }773774for (int32 i = 0; i < 0x40; ++i) {775int32 x = metal->position.x + RSDK.Rand(-0x600000, 0x400000);776int32 y = metal->position.y + RSDK.Rand(-0x600000, 0x600000);777CREATE_ENTITY(GigaMetal, INT_TO_VOID(GIGAMETAL_SHARD), x, y);778}779780EntityFXFade *fxFade = CREATE_ENTITY(FXFade, INT_TO_VOID(0xF0F0F0), self->position.x, self->position.y);781fxFade->speedIn = 256;782fxFade->speedOut = 64;783Zone->autoScrollSpeed = 0;784RSDK.PlaySfx(MetalSonic->sfxExplosion3, false, 255);785786EntityDango *dango = CREATE_ENTITY(Dango, NULL, (ScreenInfo->position.x - 64) << 16, (ScreenInfo->position.y + 200) << 16);787dango->timer = 0;788dango->direction = FLIP_X;789dango->state = Dango_StateTaunt_Setup;790791int32 tileX = ScreenInfo->position.x >> 4;792int32 tileY = ((ScreenInfo->size.y + ScreenInfo->position.y) >> 4) - 5;793794int32 spawnX = (tileX << 20) + 0x80000;795for (int32 x = 0; x < 32; ++x) {796int32 spawnY = (tileY << 20) + 0x80000;797798for (int32 y = 0; y < 6; ++y) {799uint16 tile = RSDK.GetTile(Zone->fgLayer[1], tileX, tileY);800801if (tile != (uint16)-1) {802RSDK.SetTile(Zone->fgLayer[1], tileX, tileY, -1);803EntityBreakableWall *block = CREATE_ENTITY(BreakableWall, INT_TO_VOID(BREAKWALL_TILE_FIXED), spawnX, spawnY);804block->drawGroup = Zone->objectDrawGroup[1];805block->visible = true;806block->tileInfo = tile;807block->velocity.x = RSDK.Rand(-0x20000, 0x20000);808block->velocity.y = RSDK.Rand(-0x20000, 0x20000);809block->drawFX = FX_ROTATE | FX_FLIP;810}811812++tileY;813spawnY += 0x100000;814}815816spawnX += 0x100000;817tileY -= 6;818++tileX;819}820821RSDK.CopyTileLayer(Zone->fgLayer[0], 0, 30, Zone->fgLayer[0], 0, 174, 256, 2);822RSDK.CopyTileLayer(Zone->fgLayer[1], 0, 26, Zone->fgLayer[0], 0, 0, 256, 6);823}824else {825GigaMetal->explodeTimer++;826}827}828829void GigaMetal_StateShoulder_Impact(void)830{831RSDK_THIS(GigaMetal);832833self->velocity.y += 0x3800;834self->componentPos.y += self->velocity.y;835836if (self->velocity.y > 0) {837if (self->componentPos.y >= self->targetPos.y) {838self->componentPos.y = self->targetPos.y;839self->velocity.y = -(self->velocity.y >> 2);840if (self->velocity.y > -0x800) {841self->velocity.y = 0;842self->state = StateMachine_None;843}844}845}846}847848void GigaMetal_StateHead_Impact(void)849{850RSDK_THIS(GigaMetal);851852self->velocity.y -= 0x3800;853self->componentPos.y += self->velocity.y;854855if (self->velocity.y < 0) {856if (self->componentPos.y <= self->targetPos.y) {857self->componentPos.y = self->targetPos.y;858self->velocity.y = -(self->velocity.y >> 2);859860if (self->velocity.y < 0x4000) {861self->velocity.y = 0;862self->state = StateMachine_None;863}864}865}866}867868void GigaMetal_State_Laser(void)869{870RSDK_THIS(GigaMetal);871872RSDK.ProcessAnimation(&self->jointAnimator);873874if (!(Zone->timer & 1)) {875if (self->laserSize < 9)876self->laserSize++;877}878879self->position.x = self->body->position.x;880self->position.y = self->body->position.y;881882int32 angle = self->angle - self->body->rotation;883int32 x = self->position.x + (RSDK.Sin512(angle + 8) << 12);884int32 y = self->position.y + (RSDK.Cos512(angle + 8) << 12);885int32 moveX = (RSDK.Sin512(angle) << 12) & 0xFFFF0000;886int32 moveY = (RSDK.Cos512(angle) << 12) & 0xFFFF0000;887888for (int32 c = 0; c < self->laserSize; ++c) {889self->position.x = x;890self->position.y = y;891892foreach_active(Player, player)893{894if (Player_CheckCollisionTouch(player, self, &GigaMetal->hitboxLaser) && Player_ElementHurt(player, self, SHIELD_LIGHTNING))895player->velocity.x = abs(player->velocity.x) + Zone->autoScrollSpeed;896}897898if (!(Zone->timer & 3)) {899if (RSDK.ObjectTileCollision(self, Zone->collisionLayers, CMODE_FLOOR, 0, 0, 0x20000, true))900CREATE_ENTITY(Explosion, NULL, self->position.x, self->position.y);901}902903x += moveX;904y += moveY;905}906}907908void GigaMetal_StateLaser_Finish(void)909{910RSDK_THIS(GigaMetal);911912RSDK.ProcessAnimation(&self->jointAnimator);913914if (self->scale.y <= 8)915destroyEntity(self);916else917self->scale.y -= 8;918}919920void GigaMetal_State_Shard(void)921{922RSDK_THIS(GigaMetal);923924self->velocity.y += 0x3800;925self->position.x += self->velocity.x;926self->position.y += self->velocity.y;927self->angle += self->groundVel;928929if (!RSDK.CheckOnScreen(self, NULL))930destroyEntity(self);931}932933void GigaMetal_StateHead_PrepareRoar(void)934{935RSDK_THIS(GigaMetal);936937self->drawFX = FX_ROTATE;938939if (self->rotation <= -32) {940self->state = GigaMetal_StateHead_Roar;941942RSDK.PlaySfx(GigaMetal->sfxRoar, false, 255);943}944else {945self->rotation -= 2;946}947}948949void GigaMetal_StateHead_Roar(void)950{951RSDK_THIS(GigaMetal);952953self->rotation = RSDK.Rand(-34, -30);954}955956void GigaMetal_StateHead_FinishRoar(void)957{958RSDK_THIS(GigaMetal);959960if (self->rotation >= 0) {961self->rotation = 0;962self->drawFX = FX_NONE;963self->state = StateMachine_None;964}965else {966self->rotation += 2;967}968}969970void GigaMetal_StateHead_PrepareLaser(void)971{972RSDK_THIS(GigaMetal);973974self->drawFX = FX_ROTATE;975976if (self->rotation <= -64) {977RSDK.SetSpriteAnimation(GigaMetal->aniFrames, GIGAMETAL_LASERCHARGE, &self->armAnimator, false, 0);978self->state = GigaMetal_StateHead_ChargeLaser;979980RSDK.PlaySfx(GigaMetal->sfxRoar, false, 255);981}982else {983self->rotation -= 2;984}985}986987void GigaMetal_StateHead_ChargeLaser(void)988{989RSDK_THIS(GigaMetal);990991// Shaking effect992self->rotation = RSDK.Rand(-66, -62);993994RSDK.ProcessAnimation(&self->armAnimator);995996if (++self->timer == 120) {997self->timer = 0;998self->state = GigaMetal_StateHead_FiringLaser;999CREATE_ENTITY(GigaMetal, INT_TO_VOID(GIGAMETAL_LASEREDGE), self->position.x, self->position.y)->body = self;1000RSDK.PlaySfx(MetalSonic->sfxMSFireball, false, 255);1001}1002}10031004void GigaMetal_StateHead_FiringLaser(void)1005{1006RSDK_THIS(GigaMetal);10071008RSDK.ProcessAnimation(&self->armAnimator);10091010if (self->rotation >= 0) {1011if (++self->timer == 2) {1012RSDK.SetSpriteAnimation(-1, 0, &self->armAnimator, false, 0);10131014foreach_active(GigaMetal, laser)1015{1016if (laser->state == GigaMetal_State_Laser) {1017laser->drawFX |= FX_SCALE;1018laser->alpha = 0xA0;1019laser->state = GigaMetal_StateLaser_Finish;1020}1021}1022}1023else if (self->timer == 30) {1024self->timer = 0;10251026foreach_active(GigaMetal, arm)1027{1028if (arm->state == GigaMetal_StateArm_Idle_Behind) {1029arm->angle = arm->body->angle;1030if (arm->mainAnimator.animationID == GIGAMETAL_ARMBACK)1031arm->angle += 0x80;1032arm->timer = 48;1033arm->state = GigaMetal_StateArm_Marching;1034}1035}10361037self->rotation = 0;1038self->drawFX = FX_NONE;1039self->state = StateMachine_None;1040}1041}1042else {1043self->rotation++;1044}1045}10461047void GigaMetal_StateHead_TargetingPlayer(void)1048{1049RSDK_THIS(GigaMetal);10501051++self->timer;1052RSDK.ProcessAnimation(&self->jointAnimator);10531054if (self->timer == 1) {1055RSDK.SetSpriteAnimation(GigaMetal->aniFrames, GIGAMETAL_EYE, &self->jointAnimator, false, 3);1056}1057else if (self->timer == 88) {1058RSDK.SetSpriteAnimation(-1, 0, &self->jointAnimator, false, 0);1059self->targetPos = self->componentPos;1060self->timer = 0;1061self->state = GigaMetal_StateHead_ReleasingBombs;1062}10631064bool32 playTargetingSfx = false;1065if (self->timer >= 72)1066playTargetingSfx = (self->timer & 7) == 1;1067else1068playTargetingSfx = (self->timer % 20) == 1;10691070if (playTargetingSfx)1071RSDK.PlaySfx(GigaMetal->sfxTarget, false, 255);1072}10731074void GigaMetal_StateHead_ReleasingBombs(void)1075{1076RSDK_THIS(GigaMetal);10771078self->timer++;1079if ((self->timer % 90) == 1) {1080self->velocity.x = -0x8000;1081EntityMSBomb *bomb = CREATE_ENTITY(MSBomb, NULL, self->position.x + 0x100000, self->position.y + 0xC0000);10821083bomb->velocity.x = 0x40000;1084bomb->velocity.y = 0x40000;1085RSDK.PlaySfx(GigaMetal->sfxCannon, false, 255);1086}10871088self->componentPos.x += self->velocity.x;1089self->componentPos.y += self->velocity.x;1090self->velocity.x += 0x3800;10911092if (self->componentPos.x > self->targetPos.x) {1093self->componentPos.x = self->targetPos.x;1094self->componentPos.y = self->targetPos.y;1095self->velocity.x = 0;1096}10971098if (self->timer == 224) {1099EntityGigaMetal *frontArm = self->frontArm;1100self->timer = 0;1101frontArm->timer = 48;1102frontArm->angle = 0;1103frontArm->state = GigaMetal_StateArm_Marching;11041105EntityGigaMetal *backArm = self->backArm;1106backArm->timer = 48;1107backArm->angle = 128;1108backArm->state = GigaMetal_StateArm_Marching;1109self->state = 0;1110}1111}11121113void GigaMetal_HandleArmCollisions(void)1114{1115RSDK_THIS(GigaMetal);11161117if (self->mainAnimator.animationID != GIGAMETAL_ARMBACK) {1118int32 angle = self->rotationAngles[0] >> 6;11191120self->position.x = self->body->position.x + self->componentPos.x + (RSDK.Sin1024(angle) << 11);1121self->position.y = self->body->position.y + self->componentPos.y + (RSDK.Cos1024(angle) << 11);11221123angle += self->rotationAngles[1] >> 6;1124self->position.x += 0x600 * RSDK.Sin1024(angle);1125self->position.y += 0x600 * RSDK.Cos1024(angle);1126self->position.x += RSDK.Sin1024(angle) << 9;11271128angle += 0x100;1129self->position.y += RSDK.Cos1024(angle) << 9;1130self->position.x += 0x1500 * RSDK.Sin1024(angle);1131self->position.y += 0x1500 * RSDK.Cos1024(angle);11321133angle += self->rotationAngles[2] >> 6;1134self->position.x += 0x600 * RSDK.Sin1024(angle);1135self->position.y += 0x600 * RSDK.Cos1024(angle);11361137foreach_active(Player, player)1138{1139if (!GigaMetal->invincibleTimer) {1140if (Player_CheckCollisionTouch(player, self, &GigaMetal->hitboxHand)1141&& !Player_CheckMightyUnspin(player, 0x400, false, &player->uncurlTimer) && Player_Hurt(player, self)) {1142player->velocity.x = abs(player->velocity.x) + Zone->autoScrollSpeed;1143}1144}1145}1146}1147}11481149void GigaMetal_StateArm_Idle_Front(void)1150{1151RSDK_THIS(GigaMetal);11521153self->rotationAngles[0] = RSDK.Sin256(self->timer) - 0x800;1154self->rotationAngles[1] = RSDK.Sin256(self->timer) - 0x200;1155self->rotationAngles[2] = RSDK.Sin256(self->timer) + 0xC00;1156self->timer = (self->timer + 2) & 0xFF;11571158GigaMetal_HandleArmCollisions();1159}11601161void GigaMetal_StateArm_Idle_Behind(void)1162{1163RSDK_THIS(GigaMetal);11641165if (self->rotationAngles[0] >= -0x1F00) {1166self->rotationAngles[0] += ((-0x2000 - self->rotationAngles[0]) >> 3);1167self->rotationAngles[1] += (-0x1000 - self->rotationAngles[1]) >> 3;1168self->rotationAngles[2] += ((0x1000 - self->rotationAngles[2]) >> 3);1169}1170else {1171self->rotationAngles[1] = RSDK.Rand(-0x1200, -0xE00);1172}11731174GigaMetal_HandleArmCollisions();1175}11761177void GigaMetal_StateArm_Marching(void)1178{1179RSDK_THIS(GigaMetal);11801181int32 angle1 = 16 * RSDK.Sin256(self->angle);1182int32 angle2 = 4 * RSDK.Sin256(self->angle);1183int32 angle3 = 4 * RSDK.Sin256(self->angle - 0x40);11841185if (self->timer > 0) {1186angle1 = self->rotationAngles[0] + ((angle1 - self->rotationAngles[0]) >> 2);1187angle2 = self->rotationAngles[1] + ((angle2 - self->rotationAngles[1]) >> 2);1188angle3 = self->rotationAngles[2] + ((angle3 - self->rotationAngles[2]) >> 2);1189--self->timer;1190}11911192self->rotationAngles[0] = angle1;1193self->rotationAngles[1] = angle2;1194self->rotationAngles[2] = angle3;1195self->angle = (self->angle + 2) & 0xFF;11961197GigaMetal_HandleArmCollisions();1198}11991200#if GAME_INCLUDE_EDITOR1201void GigaMetal_EditorDraw(void)1202{1203RSDK_THIS(GigaMetal);12041205switch (self->aniID) {1206case GIGAMETAL_HEAD:1207self->componentPos.x = 0x140000;1208self->componentPos.y = -0x240000;1209RSDK.SetSpriteAnimation(GigaMetal->aniFrames, GIGAMETAL_HEAD, &self->mainAnimator, true, 0);12101211RSDK.DrawSprite(&self->mainAnimator, NULL, false);1212break;12131214case GIGAMETAL_SHOULDER:1215self->componentPos.x = -0x240000;1216self->componentPos.y = -0x2C0000;1217self->drawGroup = Zone->objectDrawGroup[1];1218RSDK.SetSpriteAnimation(GigaMetal->aniFrames, GIGAMETAL_SHOULDER, &self->mainAnimator, true, 0);12191220RSDK.DrawSprite(&self->mainAnimator, NULL, false);1221break;12221223case GIGAMETAL_BODY:1224self->active = ACTIVE_BOUNDS;1225RSDK.SetSpriteAnimation(GigaMetal->aniFrames, GIGAMETAL_BODY, &self->mainAnimator, true, 0);12261227RSDK.DrawSprite(&self->mainAnimator, NULL, false);12281229if (showGizmos()) {1230RSDK_DRAWING_OVERLAY(true);12311232DrawHelpers_DrawArenaBounds(-WIDE_SCR_XCENTER + 32, -SCREEN_YSIZE + 16, WIDE_SCR_XCENTER + 32, 16, 1 | 2 | 4 | 8, 0x00C0F0);12331234RSDK_DRAWING_OVERLAY(false);1235}1236break;12371238case GIGAMETAL_COVER:1239self->inkEffect = INK_ADD;1240self->alpha = 0xFF;1241RSDK.SetSpriteAnimation(GigaMetal->aniFrames, GIGAMETAL_COVER, &self->mainAnimator, true, 0);12421243RSDK.DrawSprite(&self->mainAnimator, NULL, false);1244break;12451246case GIGAMETAL_ARMFRONT:1247self->componentPos.x = -0x1C0000;1248self->componentPos.y = -0x2C0000;1249self->drawGroup = Zone->objectDrawGroup[1];12501251RSDK.SetSpriteAnimation(GigaMetal->aniFrames, GIGAMETAL_ARMFRONT, &self->mainAnimator, true, 0);1252RSDK.SetSpriteAnimation(GigaMetal->aniFrames, GIGAMETAL_ARMFRONT, &self->jointAnimator, true, 1);1253RSDK.SetSpriteAnimation(GigaMetal->aniFrames, GIGAMETAL_ARMFRONT, &self->armAnimator, true, 2);1254RSDK.SetSpriteAnimation(GigaMetal->aniFrames, GIGAMETAL_ARMFRONT, &self->handAnimator, true, 3);12551256self->body = self;1257GigaMetal_Draw_Arm();1258break;12591260case GIGAMETAL_ARMBACK:1261self->componentPos.x = -0xC0000;1262self->componentPos.y = -0x2C0000;1263RSDK.SetSpriteAnimation(GigaMetal->aniFrames, GIGAMETAL_ARMBACK, &self->mainAnimator, true, 0);1264RSDK.SetSpriteAnimation(GigaMetal->aniFrames, GIGAMETAL_ARMBACK, &self->jointAnimator, true, 1);1265RSDK.SetSpriteAnimation(GigaMetal->aniFrames, GIGAMETAL_ARMBACK, &self->armAnimator, true, 2);1266RSDK.SetSpriteAnimation(GigaMetal->aniFrames, GIGAMETAL_ARMBACK, &self->handAnimator, true, 3);12671268self->body = self;1269GigaMetal_Draw_Arm();1270break;12711272case GIGAMETAL_LASEREDGE:1273self->drawFX = FX_ROTATE;1274self->laserSize = -1;1275self->angle = 0x40;1276self->visible = true;1277self->scale.x = 0x200;1278self->scale.y = 0x200;1279RSDK.SetSpriteAnimation(GigaMetal->aniFrames, GIGAMETAL_LASEREDGE, &self->mainAnimator, true, 0);1280RSDK.SetSpriteAnimation(GigaMetal->aniFrames, GIGAMETAL_LASERBEAM, &self->jointAnimator, true, 0);1281RSDK.SetSpriteAnimation(GigaMetal->aniFrames, GIGAMETAL_LASEREDGE, &self->armAnimator, true, 1);12821283self->body = self;1284GigaMetal_Draw_LaserEdge();1285break;12861287case GIGAMETAL_SHARD: break;12881289default: break;1290}1291}12921293void GigaMetal_EditorLoad(void)1294{1295GigaMetal->aniFrames = RSDK.LoadSpriteAnimation("SSZ2/GigaMetal.bin", SCOPE_STAGE);12961297RSDK_ACTIVE_VAR(GigaMetal, aniID);1298RSDK_ENUM_VAR("Head", GIGAMETAL_HEAD);1299RSDK_ENUM_VAR("Shoulder", GIGAMETAL_SHOULDER);1300RSDK_ENUM_VAR("Body", GIGAMETAL_BODY);1301RSDK_ENUM_VAR("Cover", GIGAMETAL_COVER);1302RSDK_ENUM_VAR("Eye", GIGAMETAL_EYE);1303RSDK_ENUM_VAR("Arm (Front)", GIGAMETAL_ARMFRONT);1304RSDK_ENUM_VAR("Arm (Back)", GIGAMETAL_ARMBACK);1305}1306#endif13071308void GigaMetal_Serialize(void)1309{1310RSDK_EDITABLE_VAR(GigaMetal, VAR_UINT8, aniID);1311RSDK_EDITABLE_VAR(GigaMetal, VAR_UINT8, frameID);1312}1313#endif131413151316