Path: blob/master/SonicMania/Objects/SPZ/LottoMachine.c
338 views
// ---------------------------------------------------------------------1// RSDK Project: Sonic Mania2// Object Description: LottoMachine Object3// Object Author: Christian Whitehead/Simon Thomley/Hunter Bridges4// Decompiled by: Rubberduckycooly & RMGRich5// ---------------------------------------------------------------------67#include "Game.h"89ObjectLottoMachine *LottoMachine;1011void LottoMachine_Update(void)12{13RSDK_THIS(LottoMachine);1415StateMachine_Run(self->state);1617if (self->chutePos >= self->chuteTargetPos) {18if (self->chutePos > self->chuteTargetPos) {19self->chutePos -= self->chuteVel;20if (self->chutePos < 0)21self->chuteAnimator.frameID = 1;22}23}24else {25self->chutePos += self->chuteVel;26if (self->chutePos > 0)27self->chuteAnimator.frameID = 2;28}2930self->angle = (self->angle + self->spinSpeed) & 0x1FF0000;31}3233void LottoMachine_LateUpdate(void) {}3435void LottoMachine_StaticUpdate(void)36{37LottoMachine->shineAnimator.frameID = SPZ2Setup->stageLightsFrame;3839foreach_all(LottoMachine, lottoMachine)40{41int32 slot = RSDK.GetEntitySlot(lottoMachine);42RSDK.AddDrawListRef(Zone->objectDrawGroup[0], slot);43RSDK.AddDrawListRef(lottoMachine->drawGroupHigh, slot);44}45}4647void LottoMachine_Draw(void)48{49RSDK_THIS(LottoMachine);5051Vector2 drawPos;52if (SceneInfo->currentDrawGroup == self->drawGroup) {53self->direction = FLIP_NONE;54self->rotation = self->angle >> 16;55RSDK.DrawSprite(&self->supportAnimator, NULL, false);5657self->rotation += 0x80;58RSDK.DrawSprite(&self->supportAnimator, NULL, false);5960self->rotation += 0x80;61RSDK.DrawSprite(&self->supportAnimator, NULL, false);6263self->rotation += 0x80;64RSDK.DrawSprite(&self->supportAnimator, NULL, false);6566self->direction = FLIP_NONE;67RSDK.DrawSprite(&self->motorAnimator, NULL, false);6869self->machineAnimator.frameID = 7;70RSDK.DrawSprite(&self->machineAnimator, NULL, false);7172self->direction = FLIP_NONE;73RSDK.DrawSprite(&self->glassAnimator, NULL, false);7475self->direction = FLIP_X;76RSDK.DrawSprite(&self->glassAnimator, NULL, false);7778self->machineAnimator.frameID = 0;79self->inkEffect = INK_ADD;80self->direction = FLIP_NONE;81RSDK.DrawSprite(&self->machineAnimator, NULL, false);8283self->direction = FLIP_X;84RSDK.DrawSprite(&self->machineAnimator, NULL, false);8586self->direction = FLIP_NONE;87RSDK.DrawSprite(&LottoMachine->shineAnimator, NULL, false);8889self->direction = FLIP_X;90RSDK.DrawSprite(&LottoMachine->shineAnimator, NULL, false);9192self->inkEffect = INK_NONE;93for (int32 i = 0; i < 3; ++i) {94self->direction = FLIP_NONE;95self->machineAnimator.frameID = i + 2;96RSDK.DrawSprite(&self->machineAnimator, NULL, false);97self->direction = FLIP_X;98RSDK.DrawSprite(&self->machineAnimator, NULL, false);99}100}101else if (SceneInfo->currentDrawGroup == self->drawGroupHigh) {102drawPos.x = self->position.x;103drawPos.y = self->position.y + 0x6C0000 + self->chutePos;104RSDK.DrawSprite(&self->chuteAnimator, &drawPos, false);105}106else {107self->machineAnimator.frameID = 8;108self->direction = FLIP_NONE;109RSDK.DrawSprite(&self->machineAnimator, NULL, false);110111self->direction = FLIP_X;112RSDK.DrawSprite(&self->machineAnimator, NULL, false);113114self->direction = FLIP_Y;115RSDK.DrawSprite(&self->machineAnimator, NULL, false);116117self->direction = FLIP_XY;118RSDK.DrawSprite(&self->machineAnimator, NULL, false);119120self->direction = FLIP_NONE;121}122}123124void LottoMachine_Create(void *data)125{126RSDK_THIS(LottoMachine);127128RSDK.SetSpriteAnimation(LottoMachine->aniFrames, 0, &self->machineAnimator, true, 0);129RSDK.SetSpriteAnimation(LottoMachine->aniFrames, 1, &self->supportAnimator, true, 0);130RSDK.SetSpriteAnimation(LottoMachine->aniFrames, 2, &self->chuteAnimator, true, 0);131RSDK.SetSpriteAnimation(LottoMachine->aniFrames, 3, &self->motorAnimator, true, 0);132RSDK.SetSpriteAnimation(LottoMachine->aniFrames, 4, &self->glassAnimator, true, 0);133134if (SceneInfo->inEditor) {135self->drawFX = FX_FLIP;136}137else {138self->active = ACTIVE_BOUNDS;139self->updateRange.x = 0x1000000;140self->updateRange.y = 0x1000000;141self->visible = true;142self->drawGroup = Zone->objectDrawGroup[1] + 1;143self->alpha = 160;144self->drawFX = FX_ROTATE | FX_FLIP;145self->chuteTargetPos = 0x180000;146self->chutePos = 0x180000;147self->drawGroupHigh = Zone->objectDrawGroup[1];148self->motorAnimator.speed = 0;149self->state = LottoMachine_State_Startup;150}151}152153void LottoMachine_StageLoad(void)154{155LottoMachine->aniFrames = RSDK.LoadSpriteAnimation("SPZ2/LottoMachine.bin", SCOPE_STAGE);156RSDK.SetSpriteAnimation(LottoMachine->aniFrames, 5, &LottoMachine->shineAnimator, true, 0);157158LottoMachine->hitboxBottom.left = -16;159LottoMachine->hitboxBottom.top = 124;160LottoMachine->hitboxBottom.right = 16;161LottoMachine->hitboxBottom.bottom = 160;162163LottoMachine->hitboxMotor.left = -48;164LottoMachine->hitboxMotor.top = 92;165LottoMachine->hitboxMotor.right = 48;166LottoMachine->hitboxMotor.bottom = 124;167168LottoMachine->active = ACTIVE_ALWAYS;169170LottoMachine->sfxPimPom = RSDK.GetSfx("Stage/PimPom.wav");171LottoMachine->sfxFail = RSDK.GetSfx("Stage/Fail.wav");172173Zone_AddVSSwapCallback(LottoMachine_VSSwap_CheckBusy);174}175176void LottoMachine_VSSwap_CheckBusy(void)177{178#if MANIA_USE_PLUS179if ((1 << Zone->swapPlayerID) & LottoMachine->activePlayers)180Zone->playerSwapEnabled[Zone->swapPlayerID] = false;181#else182if (LottoMachine->activePlayers)183Zone->playerSwapEnabled = false;184#endif185}186187void LottoMachine_CheckPlayerCollisions(void)188{189RSDK_THIS(LottoMachine);190191foreach_active(Player, player)192{193int32 playerID = RSDK.GetEntitySlot(player);194195if (self->playerAngles[playerID] <= 0) {196// Inside the Machine197if (RSDK.CheckObjectCollisionTouchCircle(self, 0x600000, player, 0x100000)) {198199bool32 playerMatch = false;200for (int32 p = 0; p < self->playerCount; ++p) {201EntityPlayer *playerPtr = self->playerPtrs[p];202if (player == playerPtr)203playerMatch = true;204}205206if (!playerMatch) {207if ((!player->sidekick || self->playerCount) && (!self->collectedBallCount || player->sidekick)) {208if (self->playerCount < Player->playerCount) {209if (!self->playerCount)210self->playerDir = player->direction;211212self->playerPtrs[self->playerCount++] = player;213214if (Zone->cameraBoundsB[playerID] != (self->position.y >> 16) + 160) {215self->playerTimers[playerID] = Zone->cameraBoundsB[playerID];216Zone->cameraBoundsB[playerID] = (self->position.y >> 16) + 160;217}218219LottoMachine->activePlayers |= 1 << playerID;220if (!self->timer)221self->timer = 1;222}223}224else {225player->velocity.x = 0;226player->velocity.y = -0xA0000;227player->applyJumpCap = false;228self->playerAngles[playerID] = 16;229RSDK.PlaySfx(Player->sfxRelease, false, 255);230RSDK.PlaySfx(LottoMachine->sfxFail, false, 255);231}232}233}234else if (RSDK.CheckObjectCollisionTouchCircle(self, 0x730000, player, 0x100000)) { // Outside of the machine235int32 angle = RSDK.ATan2(player->position.x - self->position.x, player->position.y - self->position.y);236int32 vel = MAX((abs(player->velocity.x) + abs(player->velocity.y)) >> 8, 0x400);237int32 radius = RSDK.Rand(512, vel);238239angle += RSDK.Rand(-6, 6);240int32 velX = radius * RSDK.Cos256(angle);241int32 velY = radius * RSDK.Sin256(angle);242243if ((player->characterID == ID_KNUCKLES && player->animator.animationID == ANI_GLIDE) || player->state == Player_State_FlyCarried244#if MANIA_USE_PLUS245|| player->state == Player_State_RayGlide246#endif247) {248if (player->state == Player_State_FlyCarried)249RSDK_GET_ENTITY(SLOT_PLAYER2, Player)->flyCarryTimer = 30;250player->state = Player_State_Air;251RSDK.SetSpriteAnimation(player->aniFrames, ANI_JUMP, &player->animator, true, 0);252}253254player->groundVel = velX;255player->velocity.x = velX;256player->velocity.y = velY;257player->onGround = false;258player->applyJumpCap = false;259self->playerAngles[playerID] = 8;260RSDK.PlaySfx(LottoMachine->sfxPimPom, false, 255);261}262}263else {264--self->playerAngles[playerID];265}266}267}268269void LottoMachine_CheckPlayerCollisions_Bottom(void)270{271RSDK_THIS(LottoMachine);272273foreach_active(Player, player)274{275if (!player->sidekick || self->playerCount) {276if (Player_CheckCollisionTouch(player, self, &LottoMachine->hitboxBottom)) {277bool32 hasPlayer = false;278for (int32 p = 0; p < self->playerCount; ++p) {279EntityPlayer *playerPtr = self->playerPtrs[p];280if (player == playerPtr)281hasPlayer = true;282}283284if (!hasPlayer) {285if (self->playerCount < Player->playerCount) {286if (!self->playerCount)287self->playerDir = player->direction;288289self->playerPtrs[self->playerCount++] = player;290player->state = Player_State_Static;291player->position.x = self->position.x;292player->position.y = self->position.y + 0x980000;293player->velocity.x = 0;294player->velocity.y = 0;295296RSDK.SetSpriteAnimation(player->aniFrames, ANI_JUMP, &player->animator, true, 0);297RSDK.PlaySfx(Player->sfxRoll, false, 255);298LottoMachine->activePlayers |= 1 << player->playerID;299300if (!self->timer)301self->timer = 1;302}303}304}305}306}307}308309void LottoMachine_HandleMotor(void)310{311RSDK_THIS(LottoMachine);312313int32 vel = 0;314for (int32 p = 0; p < self->playerCount; ++p) {315EntityPlayer *player = self->playerPtrs[p];316if (player) {317if (player->state != Player_State_Death) {318player->position.x = self->position.x;319Player_CheckCollisionPlatform(player, self, &LottoMachine->hitboxMotor);320player->direction = self->playerDir;321player->jumpAbilityState = 0;322323if (player->onGround) {324vel += player->groundVel;325326if (self->playerDir) {327if (player->groundVel > -0x10000)328player->groundVel = -0x10000;329}330else if (player->groundVel < 0x10000) {331player->groundVel = 0x10000;332}333}334}335}336}337338if (self->playerDir) {339if (self->spinSpeed < -0x10000) {340self->spinSpeed += 0x800;341if (self->spinSpeed > -0x10000)342self->spinSpeed = -0x10000;343}344345if (vel < self->spinSpeed)346self->spinSpeed = vel;347348self->motorAnimator.speed = -self->spinSpeed >> 11;349}350else {351if (self->spinSpeed > 0x10000) {352self->spinSpeed -= 0x800;353if (self->spinSpeed < 0x10000)354self->spinSpeed = 0x10000;355}356357if (vel > self->spinSpeed)358self->spinSpeed = vel;359360self->motorAnimator.speed = self->spinSpeed >> 11;361}362363if (self->motorAnimator.speed > 0x80)364self->motorAnimator.speed = 0x80;365}366367void LottoMachine_SetupBalls(void)368{369RSDK_THIS(LottoMachine);370371foreach_active(LottoBall, ball)372{373if (abs(ball->position.x - self->position.x) < 0x900000 && abs(ball->position.y - self->position.y) < 0x900000) {374ball->state = LottoBall_State_FallIntoMachine;375ball->parent = self;376ball->timer = 16;377}378}379}380381void LottoMachine_SetupUIBalls(void)382{383RSDK_THIS(LottoMachine);384385foreach_active(LottoBall, ball)386{387if (ball->isUIBall) {388if (ball->isVisible[RSDK.GetEntitySlot(self->playerPtrs[0])])389ball->state = LottoBall_State_SetupUIBall;390}391}392}393394void LottoMachine_GiveRings(void)395{396RSDK_THIS(LottoMachine);397398int32 multiplier = 1;399int32 bonus = 0;400401int32 playerCount = 0;402for (int32 p = 0; p < PLAYER_COUNT; ++p) {403uint8 reward = self->collectedBallTypes[p] & 0xFF;404switch (self->collectedBallTypes[p] >> 8) {405case LOTTOBALL_BLUE:406case LOTTOBALL_YELLOW: bonus += reward; break;407case LOTTOBALL_MULTI: multiplier *= reward; break;408case LOTTOBALL_EGGMAN: ++playerCount; break;409default: break;410}411}412int32 reward = bonus * multiplier;413414for (int32 p = 0; p < self->playerCount; ++p) {415EntityPlayer *player = self->playerPtrs[p];416if (player->state != Player_State_Death && !player->sidekick) {417int32 rings = 0;418int32 count = reward;419420if (playerCount == 4) {421rings = player->rings;422}423else if (playerCount > 0) {424rings = player->rings - (player->rings >> playerCount);425if (!player->rings)426count = reward >> playerCount;427}428429int32 ringCount = count - rings * multiplier;430Player_GiveRings(player, ringCount, false);431432if (ringCount > 0) {433RSDK.PlaySfx(Ring->sfxRing, false, 0xFF);434}435else if (!ringCount) {436RSDK.PlaySfx(LottoMachine->sfxFail, false, 0xFF);437}438else if (ringCount < 0) {439Vector2 pos;440pos.x = self->position.x;441pos.y = self->position.y + 0x540000;442Ring_FakeLoseRings(&pos, -ringCount, self->drawGroup);443RSDK.PlaySfx(Player->sfxLoseRings, false, 255);444player->state = Player_State_Hurt;445RSDK.SetSpriteAnimation(player->aniFrames, ANI_HURT, &player->animator, false, 0);446player->velocity.y = -0x40000;447player->onGround = false;448player->nextAirState = StateMachine_None;449player->nextGroundState = StateMachine_None;450}451452EntityLottoBall *ball = CREATE_ENTITY(LottoBall, NULL, ScreenInfo->center.x << 16, (ScreenInfo->size.y - 48) << 16);453ball->type = LOTTOBALL_BIG;454ball->isUIBall = true;455ball->ringCount = ringCount;456ball->drawGroup = Zone->hudDrawGroup;457ball->active = ACTIVE_NORMAL;458ball->drawFX = FX_SCALE;459ball->state = LottoBall_State_ShowUIBall;460ball->isVisible[player->playerID] = true;461if (ringCount <= 0)462ball->angle = 0x800000;463464RSDK.SetSpriteAnimation(LottoBall->aniFrames, 6, &ball->ballAnimator, true, 0);465RSDK.SetSpriteAnimation(LottoBall->aniFrames, 6, &ball->leftNumAnimator, true, 1);466}467}468}469470void LottoMachine_State_Startup(void)471{472RSDK_THIS(LottoMachine);473474LottoMachine_CheckPlayerCollisions();475LottoMachine_CheckPlayerCollisions_Bottom();476LottoMachine_HandleMotor();477478if (self->timer > 0) {479self->timer++;480if (self->timer > 60) {481self->timer = 0;482RSDK.PlaySfx(Player->sfxRelease, false, 0xFF);483484for (int32 p = 0; p < self->playerCount; ++p) {485EntityPlayer *player = self->playerPtrs[p];486487if (player && player->state != Player_State_Death) {488int32 playerID = RSDK.GetEntitySlot(player);489if (player->state == Player_State_Static) {490player->state = Player_State_Air;491player->velocity.x = 0;492player->velocity.y = -0x98000;493player->applyJumpCap = false;494self->playerAngles[playerID] = 32;495}496497if (Zone->cameraBoundsB[playerID] != (self->position.y >> 16) + 160) {498self->playerTimers[playerID] = Zone->cameraBoundsB[playerID];499Zone->cameraBoundsB[playerID] = ((self->position.y >> 16) + 160);500}501}502}503504LottoMachine_SetupBalls();505self->chuteVel = 0x10000;506self->spinSpeed = !self->playerDir ? 0x10000 : -0x10000;507self->chuteTargetPos = 0x80000;508self->state = LottoMachine_State_HandleBallCollect;509}510}511}512513void LottoMachine_State_HandleBallCollect(void)514{515RSDK_THIS(LottoMachine);516517LottoMachine_CheckPlayerCollisions();518LottoMachine_HandleMotor();519520RSDK.ProcessAnimation(&self->motorAnimator);521self->glassAnimator.frameID = self->motorAnimator.frameID;522523switch (self->collectedBallCount) {524case 0:525if (++self->timer == 240) {526self->timer = 0;527self->chuteVel = 0x20000;528self->chuteTargetPos = -0x180000;529self->drawGroupHigh = Zone->objectDrawGroup[0] + 1;530self->state = LottoMachine_State_CollectBall;531}532break;533534case 1:535case 2:536case 3:537if (++self->timer == 32) {538self->timer = 0;539self->chuteVel = 0x20000;540self->chuteTargetPos = -0x180000;541self->state = LottoMachine_State_CollectBall;542}543break;544545case 4:546if (++self->timer == 96) {547self->timer = 0;548self->collectedBallCount = 5;549LottoMachine_SetupUIBalls();550}551break;552553case 5:554if (++self->timer == 32) {555self->timer = 0;556self->collectedBallCount = 6;557LottoMachine_GiveRings();558}559break;560561case 6:562if (++self->timer == 64) {563self->timer = 0;564self->chuteVel = 0x20000;565self->chuteTargetPos = -0x180000;566self->drawGroupHigh = Zone->objectDrawGroup[1];567self->state = LottoMachine_State_DropPlayers;568}569break;570571default: break;572}573}574575void LottoMachine_State_CollectBall(void)576{577RSDK_THIS(LottoMachine);578579LottoMachine_CheckPlayerCollisions();580LottoMachine_HandleMotor();581582RSDK.ProcessAnimation(&self->motorAnimator);583self->glassAnimator.frameID = self->motorAnimator.frameID;584585if (self->timer == 20) {586int32 dist = 10000;587EntityLottoBall *ballPtr = NULL;588589foreach_active(LottoBall, ball)590{591if (abs(ball->position.x - self->position.x) < 0x900000) {592if (abs(ball->position.y - self->position.y) < 0x900000) {593int32 rx = (self->position.x - ball->position.x) >> 16;594int32 ry = (self->position.y - ball->position.y + 0x540000) >> 16;595if (rx * rx + ry * ry < dist) {596dist = rx * rx + ry * ry;597ballPtr = ball;598}599}600}601}602603if (ballPtr) {604ballPtr->position.x = self->position.x;605ballPtr->position.y = self->position.y + 0x540000;606ballPtr->velocity.x = 0;607ballPtr->velocity.y = 0;608ballPtr->angle = 0;609ballPtr->angleVel = 0;610ballPtr->bounds.x = (ScreenInfo->center.x - (self->collectedBallCount << 6) + 96) << 16;611ballPtr->bounds.y = (ScreenInfo->size.y - 48) << 16;612ballPtr->timer = 0;613ballPtr->isVisible[0] = false;614615for (int32 p = 0; p < self->playerCount; ++p) {616EntityPlayer *player = self->playerPtrs[p];617if (player)618ballPtr->isVisible[RSDK.GetEntitySlot(player)] = true;619}620621ballPtr->state = LottoBall_State_Collected;622self->collectedBallTypes[self->collectedBallCount++] = ballPtr->lottoNum + (ballPtr->type << 8);623}624}625626if (++self->timer == 32) {627self->timer = 0;628self->chuteVel = 0x40000;629self->chuteTargetPos = 0x180000;630self->state = LottoMachine_State_HandleBallCollected;631}632}633634void LottoMachine_State_HandleBallCollected(void)635{636RSDK_THIS(LottoMachine);637638LottoMachine_CheckPlayerCollisions();639LottoMachine_HandleMotor();640641RSDK.ProcessAnimation(&self->motorAnimator);642self->glassAnimator.frameID = self->motorAnimator.frameID;643644if (self->chutePos == self->chuteTargetPos) {645self->chuteVel = 0x10000;646self->chuteTargetPos = 0x80000;647self->state = LottoMachine_State_HandleBallCollect;648}649}650651void LottoMachine_State_DropPlayers(void)652{653RSDK_THIS(LottoMachine);654655LottoMachine_CheckPlayerCollisions();656LottoMachine_HandleMotor();657658RSDK.ProcessAnimation(&self->motorAnimator);659self->glassAnimator.frameID = self->motorAnimator.frameID;660661if (self->chutePos == self->chuteTargetPos) {662bool32 onGround = true;663for (int32 p = 0; p < self->playerCount; ++p) {664EntityPlayer *player = self->playerPtrs[p];665if (player && !player->onGround)666onGround = false;667}668669if (onGround) {670for (int32 p = 0; p < self->playerCount; ++p) {671EntityPlayer *player = self->playerPtrs[p];672673if (player && player->state != Player_State_Death) {674player->state = Player_State_Static;675player->nextAirState = StateMachine_None;676player->velocity.x = 0;677player->velocity.y = 0;678player->groundVel = 0;679player->onGround = false;680player->applyJumpCap = false;681RSDK.SetSpriteAnimation(player->aniFrames, ANI_JUMP, &player->animator, true, 0);682int32 playerID = RSDK.GetEntitySlot(player);683Zone->cameraBoundsB[playerID] = self->playerTimers[playerID];684}685}686687self->state = LottoMachine_State_ReleasePlayers;688}689}690}691692void LottoMachine_State_ReleasePlayers(void)693{694RSDK_THIS(LottoMachine);695696LottoMachine_CheckPlayerCollisions();697698self->spinSpeed -= self->spinSpeed >> 4;699self->motorAnimator.speed -= self->motorAnimator.speed >> 4;700701RSDK.ProcessAnimation(&self->motorAnimator);702self->glassAnimator.frameID = self->motorAnimator.frameID;703704if (++self->timer == 60) {705self->timer = 0;706self->chuteVel = 0x40000;707self->chuteTargetPos = 0x180000;708self->state = LottoMachine_State_StopSpinning;709710for (int32 p = 0; p < self->playerCount; ++p) {711EntityPlayer *player = self->playerPtrs[p];712713if (player && player->state != Player_State_Death) {714player->state = Player_State_Air;715player->velocity.y = 0x40000;716LottoMachine->activePlayers &= ~(1 << RSDK.GetEntitySlot(player));717RSDK.PlaySfx(Player->sfxRelease, false, 0xFF);718self->playerAngles[RSDK.GetEntitySlot(player)] = 32;719}720}721}722}723724void LottoMachine_State_StopSpinning(void)725{726RSDK_THIS(LottoMachine);727728LottoMachine_CheckPlayerCollisions();729++self->timer;730731self->spinSpeed -= (self->spinSpeed >> 4);732self->motorAnimator.speed -= self->motorAnimator.speed >> 4;733734if (self->timer == 30) {735for (int32 p = 0; p < PLAYER_COUNT; ++p) self->playerPtrs[p] = NULL;736self->playerCount = 0;737self->collectedBallCount = 0;738self->chuteAnimator.frameID = 0;739self->timer = 0;740self->spinSpeed = 0;741self->state = LottoMachine_State_Startup;742}743}744745#if GAME_INCLUDE_EDITOR746void LottoMachine_EditorDraw(void)747{748RSDK_THIS(LottoMachine);749Vector2 drawPos;750751self->machineAnimator.frameID = 8;752self->direction = FLIP_NONE;753RSDK.DrawSprite(&self->machineAnimator, NULL, false);754755self->direction = FLIP_X;756RSDK.DrawSprite(&self->machineAnimator, NULL, false);757758self->direction = FLIP_Y;759RSDK.DrawSprite(&self->machineAnimator, NULL, false);760761self->direction = FLIP_XY;762RSDK.DrawSprite(&self->machineAnimator, NULL, false);763764self->direction = FLIP_NONE;765766drawPos.x = self->position.x;767drawPos.y = self->position.y + 0x6C0000 + self->chutePos;768RSDK.DrawSprite(&self->chuteAnimator, &drawPos, false);769770self->direction = FLIP_NONE;771self->rotation = self->angle >> 16;772RSDK.DrawSprite(&self->supportAnimator, NULL, false);773774self->rotation += 0x80;775RSDK.DrawSprite(&self->supportAnimator, NULL, false);776777self->rotation += 0x80;778RSDK.DrawSprite(&self->supportAnimator, NULL, false);779780self->rotation += 0x80;781RSDK.DrawSprite(&self->supportAnimator, NULL, false);782783self->direction = FLIP_NONE;784RSDK.DrawSprite(&self->motorAnimator, NULL, false);785786self->machineAnimator.frameID = 7;787RSDK.DrawSprite(&self->machineAnimator, NULL, false);788789self->direction = FLIP_NONE;790RSDK.DrawSprite(&self->glassAnimator, NULL, false);791792self->direction = FLIP_X;793RSDK.DrawSprite(&self->glassAnimator, NULL, false);794795self->machineAnimator.frameID = 0;796self->inkEffect = INK_ADD;797self->direction = FLIP_NONE;798RSDK.DrawSprite(&self->machineAnimator, NULL, false);799800self->direction = FLIP_X;801RSDK.DrawSprite(&self->machineAnimator, NULL, false);802803self->direction = FLIP_NONE;804RSDK.DrawSprite(&LottoMachine->shineAnimator, NULL, false);805806self->direction = FLIP_X;807RSDK.DrawSprite(&LottoMachine->shineAnimator, NULL, false);808809self->inkEffect = INK_NONE;810for (int32 i = 0; i < 3; ++i) {811self->direction = FLIP_NONE;812self->machineAnimator.frameID = i + 2;813RSDK.DrawSprite(&self->machineAnimator, NULL, false);814self->direction = FLIP_X;815RSDK.DrawSprite(&self->machineAnimator, NULL, false);816}817}818819void LottoMachine_EditorLoad(void) { LottoMachine->aniFrames = RSDK.LoadSpriteAnimation("SPZ2/LottoMachine.bin", SCOPE_STAGE); }820#endif821822void LottoMachine_Serialize(void) {}823824825