Path: blob/master/Sonic 2/Scripts/DEZ/MechaSonic.txt
1480 views
// ----------------------------------1// RSDK Project: Sonic 22// Script Description: Mecha Sonic Object3// Script Author: Christian Whitehead/Simon Thomley4// Unpacked by Rubberduckycooly's script unpacker5// ----------------------------------67// ========================8// Aliases9// ========================1011private alias object.value0 : object.timer12private alias object.value1 : object.movementCycle13private alias object.value2 : object.spriteIndex14private alias object.value3 : object.moveDir1516// value4 actually has two seaparate uses in this script, so for clarity's sake there are just two aliases for it17private alias object.value4 : object.turns // Used when boosting across the ground to count how many turns to make are left18private alias object.value4 : object.firedSpikes // Used when jumping to determine whether spikes have bene fired yet or not1920private alias object.value5 : object.health21private alias object.value6 : object.invincibilityTimer22private alias object.value7 : object.exploding2324// Constant values, set upon init25private alias object.value8 : object.gndStartSpeed // How fast Mecha Sonic should go when on the ground26private alias object.value9 : object.gndAcceleration27private alias object.value10 : object.airStartSpeed2829// The sprite the rockets should use, kept to 15 when no rockets are to be displayed30private alias object.value11 : object.rocketsFrame3132// States33private alias 0 : MECHASONIC_AWAITPLAYER34private alias 1 : MECHASONIC_INITPAUSE35private alias 2 : MECHASONIC_DESCENDING36private alias 3 : MECHASONIC_STANDING3738private alias 4 : MECHASONIC_GROUNDROLL_START39private alias 5 : MECHASONIC_GROUNDROLL_CHARGE40private alias 6 : MECHASONIC_GROUNDROLL_MAIN4142private alias 7 : MECHASONIC_ROCKETBOOST_START43private alias 8 : MECHASONIC_ROCKETBOOST_CHARGE44private alias 9 : MECHASONIC_ROCKETBOOST_MAIN4546private alias 10 : MECHASONIC_JUMPNORMAL_START47private alias 11 : MECHASONIC_JUMPNORMAL_CHARGE48private alias 12 : MECHASONIC_JUMPNORMAL_MAIN4950private alias 13 : MECHASONIC_JUMPSPIKES_START51private alias 14 : MECHASONIC_JUMPSPIKES_CHARGE52private alias 15 : MECHASONIC_JUMPSPIKES_MAIN5354private alias 16 : MECHASONIC_UNCURL55private alias 17 : MECHASONIC_EXPLODING56private alias 18 : MECHASONIC_DISSAPPEAR5758// Animations59private alias 0 : MECHASONICANI_NONE60private alias 1 : MECHASONICANI_IDLE61private alias 2 : MECHASONICANI_ROCKETBOOST62private alias 3 : MECHASONICANI_TURN63private alias 4 : MECHASONICANI_CURL64private alias 5 : MECHASONICANI_ROLLING65private alias 6 : MECHASONICANI_UNCURL6667// Eggman Window (object[-9]) Aliases68private alias 0 : EGGMANWINDOWANI_WINDOWCLOSED69private alias 1 : EGGMANWINDOWANI_OPENWINDOW70private alias 2 : EGGMANWINDOWANI_IDLE71private alias 3 : EGGMANWINDOWANI_LAUGH72private alias 4 : EGGMANWINDOWANI_STUNNED73private alias 5 : EGGMANWINDOWANI_CLOSEWINDOW7475// One Way Door alias76private alias object.state : object.isOpen7778// Player aliases79private alias object.state : player.state80private alias object.xpos : player.xpos81private alias object.xvel : player.xvel82private alias object.speed : player.speed83private alias object.animation : player.animation84private alias object.collisionRight : player.collisionRight85private alias object.value38 : player.hitboxTop86private alias object.value39 : player.hitboxBottom87private alias object.value40 : player.hitboxLeft88private alias object.value41 : player.hitboxRight8990// Reserved object slots91private alias 0 : SLOT_PLAYER192private alias 26 : SLOT_MUSICEVENT_BOSS9394// Music Events95private alias 0 : MUSICEVENT_FADETOBOSS96private alias 1 : MUSICEVENT_FADETOSTAGE97private alias 2 : MUSICEVENT_TRANSITION9899private alias 0 : MUSICEVENT_FLAG_NOCHANGE100private alias 1 : MUSICEVENT_FLAG_SPEEDUP101private alias 2 : MUSICEVENT_FLAG_SLOWDOWN102103// Path ID Aliases104private alias 0 : PATH_A105106107// ========================108// Function Declarations109// ========================110111reserve function MechaSonic_CheckEggmanChuckle112reserve function MechaSonic_Reset113114115// ========================116// Tables117// ========================118119// Values to apply to projectile spikes in order of:120// - xoffset, yoffset, xvel, yvel121private table MechaSonic_spikeSpawnData1220x000000, -0x180000, 0x00000, -0x30000123-0x100000, -0x100000, -0x20000, -0x20000124-0x180000, 0x000000, -0x30000, 0x00000125-0x100000, 0x100000, -0x20000, 0x200001260x000000, 0x180000, 0x00000, 0x300001270x100000, 0x100000, 0x20000, 0x200001280x180000, 0x000000, 0x30000, 0x000001290x100000, -0x100000, 0x20000, -0x20000130end table131132133// Below three tables are used for animations, each entry corresponds to a Mecha Sonic SpriteFrame134135// The last 252 value is unused, it's actually a control code from the original S2 Mecha Sonic animation bank136// (that means they grabbed this ani data from the original ROM, really interesting stuff)137private table MechaSonic_animation_turn1384, 5, 4, 3, 252139end table140141private table MechaSonic_animation_curl1423, 3, 6, 6, 6, 7, 7, 7, 8, 8, 8, 6, 6, 7, 7, 8, 8, 6, 7, 8143end table144145private table MechaSonic_animation_uncurl1468, 7, 6, 8, 8, 7, 7, 6, 6, 8, 8, 8, 7, 7, 7, 6, 6, 6, 3, 3147end table148149// Table to hold the pattern Mecha Sonic will follow150// All the values are set in ObjectStartup, as aliases values can't be put in table declarations151private table MechaSonic_movementCycleStates[16]152153154// ========================155// Function Definitions156// ========================157158private function MechaSonic_CheckEggmanChuckle159// Called to check if Robotnik should start chuckling after the player's been hit160if object[-9].animation > EGGMANWINDOWANI_OPENWINDOW161CheckEqual(player[currentPlayer].animation, ANI_HURT)162temp0 = checkResult163CheckEqual(player[currentPlayer].animation, ANI_DYING)164temp0 |= checkResult165CheckEqual(player[currentPlayer].animation, ANI_DROWNING)166temp0 |= checkResult167if temp0 != false168if object[-9].animation != EGGMANWINDOWANI_LAUGH169// If not already laughing, then start doing so170object[-9].animation = EGGMANWINDOWANI_LAUGH171object[-9].animationTimer = 0172end if173end if174end if175end function176177178private function MechaSonic_Reset179// Called to make the object return to its initial Standing state180object.timer = 100181PlaySfx(SfxName[Saw], false)182object.animation = MECHASONICANI_IDLE183object.state = MECHASONIC_STANDING184end function185186187// ========================188// Events189// ========================190191event ObjectUpdate192switch object.state193case MECHASONIC_AWAITPLAYER194temp0 = object.xpos195temp0 >>= 16196temp0 += 30197temp1 = screen.xcenter198temp1 -= 160199temp0 += temp1200stage.newXBoundary2 = temp0201202temp0 -= 320203temp0 -= temp1204stage.newXBoundary1 = temp0205206temp0 = object.xpos207temp0 -= 0x880000208if player[SLOT_PLAYER1].xpos >= temp0209// Set Mecha Sonic's movement values210if temp1 > 32211temp1 = 32212end if213temp2 = temp1214temp1 += 160215216object.gndStartSpeed = 0x80000217object.gndStartSpeed *= temp1218object.gndStartSpeed /= 160219temp2 <<= 8220object.gndStartSpeed += temp2221temp2 >>= 2222object.gndStartSpeed += temp2223temp2 >>= 6224225object.gndAcceleration = 0x2000226object.gndAcceleration *= temp1227object.gndAcceleration /= 160228229object.airStartSpeed = 0x40000230object.airStartSpeed *= temp1231object.airStartSpeed /= 160232temp2 <<= 8233object.airStartSpeed += temp2234temp2 >>= 2235object.airStartSpeed += temp2236temp2 >>= 6237temp2 <<= 16238239object.xpos += temp2240241#platform: USE_STANDALONE242object.health = 8243#endplatform244#platform: USE_ORIGINS245if game.bossOneLife == false246object.health = 8247else248object.health = 1249end if250#endplatform251252object.ypos -= 0xC40000253254ResetObjectEntity(SLOT_MUSICEVENT_BOSS, TypeName[Music Event], MUSICEVENT_FADETOBOSS, 0, 0)255object[SLOT_MUSICEVENT_BOSS].priority = PRIORITY_ACTIVE256object.state = MECHASONIC_INITPAUSE257end if258break259260case MECHASONIC_INITPAUSE261// Just chilling above screen for a moment before starting to actually come down262object.timer++263if object.timer >= 45264object.timer = 0265PlaySfx(SfxName[Thruster], false)266object.state = MECHASONIC_DESCENDING267end if268break269270case MECHASONIC_DESCENDING271object.timer++272if object.timer == 60273PlaySfx(SfxName[Thruster], false)274end if275276if object.timer == 120277PlaySfx(SfxName[Thruster], false)278end if279280object.rocketsFrame = oscillation281object.rocketsFrame &= 3282object.rocketsFrame >>= 1283object.rocketsFrame += 11284object.ypos += 0x10000285286// If landed on the floor, start the fight proper287ObjectTileCollision(CSIDE_FLOOR, 0, 28, PATH_A)288if checkResult == true289object[-9].animation = EGGMANWINDOWANI_OPENWINDOW290object.rocketsFrame = 15 // Blank frame, no rockets thrusting just yet291CallFunction(MechaSonic_Reset)292end if293break294295case MECHASONIC_STANDING296object.timer--297if object.timer == 50298// You'd think there'd be a space in its name, but there isn't...299PlaySfx(SfxName[Saw2], false)300end if301302if object.timer == 0303GetTableValue(object.state, object.movementCycle, MechaSonic_movementCycleStates)304object.movementCycle++305object.movementCycle &= 15306end if307break308309case MECHASONIC_GROUNDROLL_START310case MECHASONIC_JUMPNORMAL_START311case MECHASONIC_JUMPSPIKES_START312object.animation = MECHASONICANI_CURL313object.animationTimer = 1314object.spriteIndex = 0315object.timer = 148316object.state++317break318319case MECHASONIC_GROUNDROLL_CHARGE320object.timer--321if object.timer < 0322object.timer = 64323object.xvel = object.gndStartSpeed324if object.moveDir == 0325FlipSign(object.xvel)326end if327object.moveDir ^= 1328object.state++329end if330break331332case MECHASONIC_JUMPNORMAL_CHARGE333case MECHASONIC_JUMPSPIKES_CHARGE334object.timer--335if object.timer < 0336object.timer = 64337object.xvel = object.airStartSpeed338if object.moveDir == 0339FlipSign(object.xvel)340end if341object.moveDir ^= 1342object.state++343end if344break345346case MECHASONIC_GROUNDROLL_MAIN347object.xpos += object.xvel348object.timer--349if object.timer < 0350object.animation = MECHASONICANI_UNCURL351object.animationTimer = 1352object.spriteIndex = 8353object.direction ^= FLIP_X354object.state = MECHASONIC_UNCURL355end if356357if object.moveDir == 0358object.xvel -= object.gndAcceleration359else360object.xvel += object.gndAcceleration361end if362break363364case MECHASONIC_UNCURL365break366367case MECHASONIC_JUMPNORMAL_MAIN368object.xpos += object.xvel369370if object.yvel != 0371object.ypos += object.yvel372object.yvel += 0x3800373if object.yvel > 0374ObjectTileCollision(CSIDE_FLOOR, 0, 28, PATH_A)375if checkResult == true376object.yvel = 0377end if378end if379end if380381object.timer--382if object.timer == 60383object.yvel = -0x60000384end if385386if object.timer < 0387object.animation = MECHASONICANI_UNCURL388object.animationTimer = 1389object.spriteIndex = 8390object.direction ^= FLIP_X391object.state = MECHASONIC_UNCURL392end if393break394395case MECHASONIC_JUMPSPIKES_MAIN396object.xpos += object.xvel397if object.yvel != 0398object.ypos += object.yvel399object.yvel += 0x3800400if object.yvel > 0401if object.firedSpikes == false402temp0 = 0403temp7 = 0404arrayPos0 = object[-8].entityPos405while temp7 < 8406object[arrayPos0].type = TypeName[MechaSonicSpike]407object[arrayPos0].xpos = object.xpos408GetTableValue(temp1, temp0, MechaSonic_spikeSpawnData)409temp0++410object[arrayPos0].xpos += temp1411object[arrayPos0].ypos = object.ypos412GetTableValue(temp1, temp0, MechaSonic_spikeSpawnData)413temp0++414object[arrayPos0].ypos += temp1415GetTableValue(object[arrayPos0].xvel, temp0, MechaSonic_spikeSpawnData)416temp0++417GetTableValue(object[arrayPos0].yvel, temp0, MechaSonic_spikeSpawnData)418temp0++419object[arrayPos0].frame = temp7420arrayPos0++421422temp7++423loop424425PlaySfx(SfxName[Spikes Move], false)426object.firedSpikes = true427end if428429ObjectTileCollision(CSIDE_FLOOR, 0, 28, PATH_A)430if checkResult == true431object.yvel = 0432end if433end if434end if435436object.timer--437if object.timer == 60438object.yvel = -0x60000439end if440441if object.timer < 0442object.firedSpikes = false443object.animation = MECHASONICANI_UNCURL444object.animationTimer = 1445object.spriteIndex = 8446object.direction ^= FLIP_X447object.state = MECHASONIC_UNCURL448end if449break450451case MECHASONIC_ROCKETBOOST_START452object.animation = MECHASONICANI_ROCKETBOOST453object.timer = 32454object.turns = 2455object.state = MECHASONIC_ROCKETBOOST_CHARGE456break457458case MECHASONIC_ROCKETBOOST_CHARGE459object.timer--460if object.timer < 0461object.timer = 64462object.xvel = object.gndStartSpeed463if object.moveDir == 0464FlipSign(object.xvel)465end if466object.moveDir ^= 1467PlaySfx(SfxName[Release], false)468object.state++469end if470break471472case MECHASONIC_ROCKETBOOST_MAIN473object.xpos += object.xvel474object.timer--475if object.timer == 32476object.animationTimer = 0477object.spriteIndex = 0478object.rocketsFrame = 15479object.animation = MECHASONICANI_TURN480end if481482if object.timer < 0483object.turns--484if object.turns > 0485object.timer = 32486object.animation = MECHASONICANI_ROCKETBOOST487object.state = MECHASONIC_ROCKETBOOST_CHARGE488else489CallFunction(MechaSonic_Reset)490end if491end if492493if object.moveDir == 0494object.xvel -= object.gndAcceleration495else496object.xvel += object.gndAcceleration497end if498break499500case MECHASONIC_EXPLODING501object.timer++502if object.timer == 240503object.timer = 0504object.exploding = false505temp0 = tileLayer[0].xsize506temp0 <<= 7507stage.newXBoundary2 = temp0508object.frame = 15509object.state = MECHASONIC_DISSAPPEAR510end if511break512513case MECHASONIC_DISSAPPEAR514object.timer++515if object.timer == 60516object.type = TypeName[Blank Object]517end if518break519520end switch521522// Animate the object here523// Notably different front other boss objects, since those animate themselves in ObjectDraw instead524// However, since Mecha Sonic should pause upon death, animation is done here525switch object.animation526case MECHASONICANI_NONE527break528529case MECHASONICANI_IDLE530object.animationTimer++531if object.animationTimer >= 3532object.animationTimer = 0533object.frame++534if object.frame >= 3535object.frame = 0536end if537end if538break539540case MECHASONICANI_ROCKETBOOST541// This is the animation for boosting across the stage, with the rockets on Mecha Sonic's back542543// Mecha Sonic's frame is constant...544object.frame = 3545546// ...but still update the rockets' sprite547object.rocketsFrame = oscillation548object.rocketsFrame &= 3549object.rocketsFrame >>= 1550if object.state == MECHASONIC_ROCKETBOOST_MAIN551// Rockets552object.rocketsFrame += 9553else554// Sparks555object.rocketsFrame += 13556end if557break558559case MECHASONICANI_TURN560object.animationTimer--561if object.animationTimer <= 0562object.animationTimer = 4563GetTableValue(object.frame, object.spriteIndex, MechaSonic_animation_turn)564object.spriteIndex++565if object.frame == 5566object.direction ^= FLIP_X567end if568569if object.frame == 3570object.spriteIndex = 0571object.animationTimer = 255572end if573end if574break575576case MECHASONICANI_CURL577object.animationTimer--578if object.animationTimer <= 0579object.animationTimer = 4580GetTableValue(object.frame, object.spriteIndex, MechaSonic_animation_curl)581object.spriteIndex++582if object.spriteIndex == 21583PlaySfx(SfxName[Buzzsaw], false)584object.spriteIndex = 0585object.frame = 6586object.animationTimer = 0587object.animation = MECHASONICANI_ROLLING588end if589end if590break591592case MECHASONICANI_ROLLING593object.animationTimer++594if object.animationTimer >= 3595object.animationTimer = 0596object.frame++597if object.frame >= 9598object.frame = 6599end if600end if601break602603case MECHASONICANI_UNCURL604object.animationTimer--605if object.animationTimer <= 0606object.animationTimer = 4607GetTableValue(object.frame, object.spriteIndex, MechaSonic_animation_uncurl)608object.spriteIndex++609if object.spriteIndex == 21610object.spriteIndex = 0611CallFunction(MechaSonic_Reset)612end if613end if614break615616end switch617618// Make sure the door for exiting the arena is closed, as long as Mecha Sonic is alive619object[+1].isOpen = false620621if object.state > MECHASONIC_DESCENDING622if object.health != 0623if object.invincibilityTimer > 0624object.invincibilityTimer--625626// Update the flashing black color627GetBit(temp0, object.invincibilityTimer, 0)628if temp0 == true629SetPaletteEntry(0, 192, 0xE0E0E0)630else631SetPaletteEntry(0, 192, 0x000000)632end if633end if634635// Frames 6-8 are the jumping frames, where Mecha Sonic is completely wrapped with spikes (and undamagable as a result)636CheckEqual(object.frame, 6)637temp0 = checkResult638CheckEqual(object.frame, 7)639temp0 |= checkResult640CheckEqual(object.frame, 8)641temp0 |= checkResult642if temp0 != false643foreach (GROUP_PLAYERS, currentPlayer, ACTIVE_ENTITIES)644CallFunction(MechaSonic_CheckEggmanChuckle)645BoxCollisionTest(C_TOUCH, object.entityPos, -12, -12, 12, 12, currentPlayer, C_BOX, C_BOX, C_BOX, C_BOX)646if checkResult == true647CallFunction(Player_Hit)648end if649next650else651foreach (GROUP_PLAYERS, currentPlayer, ACTIVE_ENTITIES)652CallFunction(MechaSonic_CheckEggmanChuckle)653if object.animation == MECHASONICANI_IDLE654if object.direction == FLIP_NONE655if player[currentPlayer].xpos >= object.xpos656BoxCollisionTest(C_TOUCH, object.entityPos, -12, -12, 12, 12, currentPlayer, C_BOX, C_BOX, C_BOX, C_BOX)657if checkResult == true658CallFunction(Player_Hit)659end if660end if661else662if player[currentPlayer].xpos <= object.xpos663BoxCollisionTest(C_TOUCH, object.entityPos, -12, -12, 12, 12, currentPlayer, C_BOX, C_BOX, C_BOX, C_BOX)664if checkResult == true665CallFunction(Player_Hit)666end if667end if668end if669end if670671if object.invincibilityTimer == 0672if player[currentPlayer].state != Player_State_GotHit673BoxCollisionTest(C_TOUCH, object.entityPos, -12, -12, 12, 12, currentPlayer, player[currentPlayer].hitboxLeft, player[currentPlayer].hitboxTop, player[currentPlayer].hitboxRight, player[currentPlayer].hitboxBottom)674if checkResult == true675CallFunction(Player_CheckHit)676if checkResult == true677object.health--678if object.health == 0679#platform: USE_ORIGINS680CallNativeFunction2(NotifyCallback, NOTIFY_KILL_BOSS, 0)681#endplatform682683// None of the special global variable array stuff done here, since there's no multiplayer in DEZ684player.score += 1000685686// Make Window Robotnik start running687object[-9].frame = 4688object[-9].animationTimer = 0689object[-9].animation = EGGMANWINDOWANI_CLOSEWINDOW690691object.exploding = true692object.state = MECHASONIC_EXPLODING693object.timer = 0694695StopSfx(SfxName[Saw])696StopSfx(SfxName[Release])697StopSfx(SfxName[Buzzsaw])698699object.animation = MECHASONICANI_NONE700object.rocketsFrame = 15701else702object.invincibilityTimer = 32703// Even through a window, Eggman will still recoil when his machines are hit704if object[-9].animation > EGGMANWINDOWANI_OPENWINDOW705object[-9].animationTimer = 0706object[-9].animation = EGGMANWINDOWANI_STUNNED707end if708PlaySfx(SfxName[Boss Hit], false)709end if710end if711end if712end if713end if714next715end if716end if717end if718719if object.state != MECHASONIC_DISSAPPEAR720// Sonic should never be able to reach the right side of the screen anyway - there's already a wall there - but enforce right bounds regardless721722foreach (GROUP_PLAYERS, currentPlayer, ACTIVE_ENTITIES)723temp0 = player[currentPlayer].collisionRight724temp0 <<= 16725temp0 += player[currentPlayer].xpos726temp1 = stage.curXBoundary2727temp1 <<= 16728if temp0 > temp1729player[currentPlayer].xvel = 0730player[currentPlayer].speed = 0731player[currentPlayer].xpos = temp1732temp0 = player[currentPlayer].collisionRight733temp0 <<= 16734player[currentPlayer].xpos -= temp0735end if736next737end if738739if object.exploding == true740temp0 = oscillation741temp0 &= 7742if temp0 == 0743Rand(temp0, 48)744temp0 -= 24745temp0 <<= 16746temp0 += object.xpos747Rand(temp1, 48)748temp1 -= 24749temp1 <<= 16750temp1 += object.ypos751CreateTempObject(TypeName[Explosion], 0, temp0, temp1)752object[tempObjectPos].drawOrder = 5753PlaySfx(SfxName[Explosion], false)754end if755end if756end event757758759event ObjectDraw760// Unlike other boss objects, Mecha Sonic's animation is kept in ObjectUpdate rather than being done here761762if object.state > MECHASONIC_AWAITPLAYER763DrawSpriteFX(object.rocketsFrame, FX_FLIP, object.xpos, object.ypos)764DrawSpriteFX(object.frame, FX_FLIP, object.xpos, object.ypos)765end if766end event767768769event ObjectStartup770CheckCurrentStageFolder("Zone12")771if checkResult == true772LoadSpriteSheet("DEZ/Objects.gif")773774// 0 - 2: Idle Frames775SpriteFrame(-20, -28, 40, 56, 1, 1)776SpriteFrame(-20, -28, 40, 56, 42, 1)777SpriteFrame(-20, -28, 40, 56, 83, 1)778779// 3: Rocket Thrusting Frame780SpriteFrame(-20, -27, 40, 55, 124, 1)781782// 4 - 5: Turning Frames783SpriteFrame(-22, -27, 42, 55, 165, 1)784SpriteFrame(-22, -27, 44, 55, 208, 1)785786// 6 - 8: Jumping Frames787SpriteFrame(-24, -18, 48, 48, 255, 1)788SpriteFrame(-24, -18, 48, 48, 304, 1)789SpriteFrame(-24, -18, 48, 48, 353, 1)790791// 9 - 10: Back Rocket Frames792SpriteFrame(14, 4, 24, 24, 402, 1)793SpriteFrame(14, 5, 24, 22, 427, 1)794795// 11 - 12: Vertical Flame Sprites796SpriteFrame(-12, 28, 16, 8, 402, 26)797SpriteFrame(-12, 28, 16, 22, 419, 26)798799// 13 - 14: Sparks Frames800SpriteFrame(19, 20, 19, 8, 452, 1)801SpriteFrame(20, 20, 18, 7, 452, 10)802803// 15: Blank Frame (Used when rockets shouldn't show up)804SpriteFrame(0, 0, 1, 1, 1, 1)805else806LoadSpriteSheet("MBZ/Objects.gif")807808// 0 - 2: Idle Frames809SpriteFrame(-20, -28, 40, 56, 513, 1)810SpriteFrame(-20, -28, 40, 56, 554, 1)811SpriteFrame(-20, -28, 40, 56, 595, 1)812813// 3: Rocket Thrusting Frame814SpriteFrame(-20, -27, 40, 55, 636, 1)815816// 4 - 5: Turning Frames817SpriteFrame(-22, -27, 42, 55, 677, 1)818SpriteFrame(-22, -27, 44, 55, 720, 1)819820// 6 - 8: Jumping Frames821SpriteFrame(-24, -18, 48, 48, 767, 1)822SpriteFrame(-24, -18, 48, 48, 816, 1)823SpriteFrame(-24, -18, 48, 48, 865, 1)824825// 9 - 10: Back Rocket Frames826SpriteFrame(14, 4, 24, 24, 914, 1)827SpriteFrame(14, 5, 24, 22, 939, 1)828829// 11 - 12: Vertical Flame Sprites830SpriteFrame(-12, 28, 16, 8, 914, 26)831SpriteFrame(-12, 28, 16, 22, 931, 26)832833// 13 - 14: Sparks Frames834SpriteFrame(19, 20, 19, 8, 964, 1)835SpriteFrame(20, 20, 18, 7, 964, 10)836837// 15: Blank Frame (Interestingly, even for being blank this frame was still updated for MBZ despite being, well, blank)838SpriteFrame(0, 0, 1, 1, 513, 1)839end if840841// Set all the movement cycle states into the table842// The compiler doesn't allow for aliased values to be in tables, which is why they're all set here instead843// (Though, it would've been far better for us if they just updated the compiler to allow for such instead...)844SetTableValue(MECHASONIC_GROUNDROLL_START, 0, MechaSonic_movementCycleStates)845SetTableValue(MECHASONIC_ROCKETBOOST_START, 1, MechaSonic_movementCycleStates)846SetTableValue(MECHASONIC_JUMPNORMAL_START, 2, MechaSonic_movementCycleStates)847SetTableValue(MECHASONIC_GROUNDROLL_START, 3, MechaSonic_movementCycleStates)848SetTableValue(MECHASONIC_GROUNDROLL_START, 4, MechaSonic_movementCycleStates)849SetTableValue(MECHASONIC_JUMPSPIKES_START, 5, MechaSonic_movementCycleStates)850SetTableValue(MECHASONIC_ROCKETBOOST_START, 6, MechaSonic_movementCycleStates)851SetTableValue(MECHASONIC_JUMPNORMAL_START, 7, MechaSonic_movementCycleStates)852SetTableValue(MECHASONIC_GROUNDROLL_START, 8, MechaSonic_movementCycleStates)853SetTableValue(MECHASONIC_GROUNDROLL_START, 9, MechaSonic_movementCycleStates)854SetTableValue(MECHASONIC_JUMPNORMAL_START, 10, MechaSonic_movementCycleStates)855SetTableValue(MECHASONIC_GROUNDROLL_START, 11, MechaSonic_movementCycleStates)856SetTableValue(MECHASONIC_ROCKETBOOST_START, 12, MechaSonic_movementCycleStates)857SetTableValue(MECHASONIC_GROUNDROLL_START, 13, MechaSonic_movementCycleStates)858SetTableValue(MECHASONIC_JUMPNORMAL_START, 14, MechaSonic_movementCycleStates)859SetTableValue(MECHASONIC_JUMPSPIKES_START, 15, MechaSonic_movementCycleStates)860end event861862863// ========================864// Editor Events865// ========================866867event RSDKDraw868DrawSprite(0)869end event870871872event RSDKLoad873CheckCurrentStageFolder("Zone12")874if checkResult == true875LoadSpriteSheet("DEZ/Objects.gif")876SpriteFrame(-20, -28, 40, 56, 1, 1)877else878LoadSpriteSheet("MBZ/Objects.gif")879SpriteFrame(-20, -28, 40, 56, 513, 1)880end if881882SetVariableAlias(ALIAS_VAR_PROPVAL, "unused")883end event884885886