Path: blob/master/Sonic 2/Scripts/Ending/Tornado.txt
1482 views
// ----------------------------------1// RSDK Project: Sonic 22// Script Description: Tornado Object3// Script Author: Christian Whitehead/Simon Thomley4// Unpacked by Rubberduckycooly's script unpacker5// ----------------------------------67// ========================8// Aliases9// ========================1011private alias object.frame : object.propellerFrame // In states 0-212private alias object.frame : object.tornadoFrame // For the rest of them1314private alias object.value0 : object.timer1516private alias object.value1 : object.pilot.frame17private alias object.value2 : object.pilot.timer18private alias object.value3 : object.pilot.index1920private alias object.value4 : object.zoomoutSprIndex2122private alias object.value5 : object.logo.timer23private alias object.value6 : object.text.frame24private alias object.value7 : object.number.frame25private alias object.value8 : object.logo.frame2627private alias object.value9 : object.superSonic.state28private alias object.value10 : object.superSonic.frame29private alias object.value11 : object.superSonic.index30private alias object.value12 : object.superSonic.timer31private alias object.value13 : object.superSonic.x32private alias object.value14 : object.superSonic.y3334private alias object.value15 : object.superBlendTimer35private alias object.value16 : object.superBlendColor3637private alias 0 : TORNADO_CATCHPLAYER38private alias 1 : TORNADO_STABALIZE39private alias 2 : TORNADO_FLYING40private alias 3 : TORNADO_FLYINTOBG41private alias 4 : TORNADO_OFFSCREEN42private alias 5 : TORNADO_FLYINTOSCREEN43private alias 6 : TORNADO_INITLOGO44private alias 7 : TORNADO_FADEINLOGO45private alias 8 : TORNADO_LOGOSHINE_TEXT46private alias 9 : TORNADO_LOGOSHINE_NUMBER47private alias 10 : TORNADO_DISPLAY48private alias 11 : TORNADO_FADEOUT4950private alias 0 : SUPERSONIC_DESCEND51private alias 1 : SUPERSONIC_MEETTORNADO52private alias 2 : SUPERSONIC_FLYALONGTORNADO53private alias 3 : SUPERSONIC_FLYINTOBG54private alias 4 : SUPERSONIC_OFFSCREEN55private alias 5 : SUPERSONIC_FLYINTOSCREEN56private alias 6 : SUPERSONIC_DISPLAY5758// Player Aliases59private alias object.xpos : player.xpos60private alias object.ypos : player.ypos61private alias object.animation : player.animation62private alias object.visible : player.visible6364private alias 0 : SUPERSTATE_NONE6566// Bird Aliases67private alias object.value0 : bird.timer686970// ========================71// Function Declarations72// ========================7374reserve function Tornado_HandleSuperTailsPal75reserve function Tornado_AnimatePilot767778// ========================79// Tables80// ========================8182// Format followed for below two tables - first number is frame ID, second number is frame duration83private table Tornado_PilotAni_Tails845, 32856, 8867, 8878, 8887, 8896, 16909, 32916, 1692end table9394private table Tornado_PilotAni_Sonic9510, 99611, 99710, 99811, 99910, 910011, 910110, 910211, 9103end table104105private table Tornado_ZoomoutSprites_Sonic10619, 19, 19, 19, 20, 20, 20, 20, 20, 20, 20, 21, 21, 21, 2210722, 22, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23108end table109110private table Tornado_ZoomoutSprites_SS // full name would be Tornado_ZoomoutSprites_SuperSonic but there's a 32 chars name length max lol11112, 12, 12, 12, 13, 13, 13, 13, 13, 13, 13, 14, 14, 14, 1511215, 15, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16113end table114115private table Tornado_ZoomoutSprites_Tails11627, 27, 27, 27, 28, 28, 28, 28, 28, 28, 28, 29, 29, 29, 3011730, 30, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31118end table119120private table Tornado_ZoomoutSprites_Knuckles12135, 35, 35, 35, 36, 36, 36, 36, 36, 36, 36, 37, 37, 37, 3812238, 38, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39123end table124125private table Tornado_ZoomoutSprites_Amy12660, 60, 60, 60, 61, 61, 61, 61, 61, 61, 61, 62, 62, 62, 6312763, 63, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64128end table129130private table Tornado_ZoomoutPositions1310xA00000, 0x7000001320xB00000, 0x7000001330xB60000, 0x7100001340xBC0000, 0x7200001350xC40000, 0x7400001360xC80000, 0x7500001370xCA0000, 0x7600001380xCC0000, 0x7700001390xCE0000, 0x7800001400xD00000, 0x7900001410xD20000, 0x7A00001420xD40000, 0x7B00001430xD60000, 0x7C00001440xD90000, 0x7E00001450xDC0000, 0x8100001460xDE0000, 0x8400001470xE10000, 0x8700001480xE40000, 0x8B00001490xE70000, 0x8F00001500xEC0000, 0x9400001510xF00000, 0x9900001520xF50000, 0x9D00001530xF90000, 0xA400001540x1000000, 0xAC00001550x1080000, 0xB800001560x1120000, 0xC400001570x11F0000, 0xD300001580x12C0000, 0xFA0000159end table160161private table Tornado_SuperSonic_Sprites16243, 43, 43, 43, 43, 43, 43, 44, 44, 44, 44, 44, 44, 45, 45, 45, 45, 46, 4616346, 47, 47, 47, 47, 47, 47, 47, 47, 47, 48, 48, 48, 48, 48, 48, 48, 48, 48164end table165166private table Tornado_SuperSonic_Positions1670xC00000, 0x9000001680xB00000, 0x9100001690xA80000, 0x9200001700x9B0000, 0x9600001710x990000, 0x9800001720x980000, 0x9900001730x990000, 0x9A00001740x9B0000, 0x9C00001750x9F0000, 0x9E00001760xA40000, 0xA000001770xAC0000, 0xA200001780xB70000, 0xA500001790xC40000, 0xA800001800xD30000, 0xAB00001810xDE0000, 0xAE00001820xE80000, 0xB000001830xEF0000, 0xB200001840xF40000, 0xB500001850xF90000, 0xB800001860xFC0000, 0xBB00001870xFE0000, 0xBE00001880xFF0000, 0xC000001890x1000000, 0xC200001900x1010000, 0xC500001910x1020000, 0xC800001920x1020000, 0xCC00001930x1010000, 0xD100001940xFD0000, 0xD700001950xF90000, 0xDE00001960xF90000, 0x11800001970x600000, 0x8800001980x500000, 0x6800001990x440000, 0x4600002000x3C0000, 0x3600002010x360000, 0x2A00002020x330000, 0x2400002030x310000, 0x2000002040x300000, 0x1E0000205end table206207private table Tornado_EndPosePositions208-0x3A0000, -0x880000209-0x0C0000, -0x220000210-0x080000, -0x100000211-0x040000, -0x080000212-0x020000, -0x040000213-0x010000, -0x020000214-0x010000, -0x020000215end table216217// Bug Details:218// ..5453? it's supposed to be "54, 53" but i think they forgot a comma..219// The flash's fade-out is just supposed to be in the fade-in but in reverse, but this typo makes the fade-out a bit more abrupt than it should be220// (5453 isn't even a valid SpriteFrame number..)221private table Tornado_LogoTextFlash22251, 53, 54, 55, 5453, 51223end table224225private table Tornado_LogoNumberFlash22651, 56, 57, 58, 59, 58, 57, 56, 51227end table228229230// ========================231// Function Definitions232// ========================233234private function Tornado_HandleSuperTailsPal235object.superBlendTimer++236if object.superBlendTimer >= 12237object.superBlendTimer = 0238239object.superBlendColor += 4240if object.superBlendColor >= 24241object.superBlendColor = 0242end if243end if244245temp1 = object.superBlendColor246GetTableValue(temp0, temp1, Player_TailsSuperPal)247SetPaletteEntry(0, 202, temp0)248249temp1++250251GetTableValue(temp0, temp1, Player_TailsSuperPal)252SetPaletteEntry(0, 205, temp0)253254temp1++255256GetTableValue(temp0, temp1, Player_TailsSuperPal)257SetPaletteEntry(0, 206, temp0)258259temp1++260261GetTableValue(temp0, temp1, Player_TailsSuperPal)262SetPaletteEntry(0, 203, temp0)263end function264265266private function Tornado_AnimatePilot267object.propellerFrame++268object.propellerFrame &= 3269270if object.pilot.timer < 2271if stage.playerListPos == PLAYER_TAILS_A272// Sonic pilots the Tornado when Tails is being saved273274// Get the sprite275GetTableValue(object.pilot.frame, object.pilot.index, Tornado_PilotAni_Sonic)276object.pilot.index++277278// Get its duration279GetTableValue(object.pilot.timer, object.pilot.index, Tornado_PilotAni_Sonic)280object.pilot.index++281else282// Tails pilots the Tornado for everyone else283284// Get the sprite285GetTableValue(object.pilot.frame, object.pilot.index, Tornado_PilotAni_Tails)286object.pilot.index++287288// Get its duration289GetTableValue(object.pilot.timer, object.pilot.index, Tornado_PilotAni_Tails)290object.pilot.index++291end if292293// Loop after a cycle of 16294object.pilot.index &= 15295else296object.pilot.timer--297end if298end function299300301// ========================302// Events303// ========================304305event ObjectUpdate306object.drawOrder = 4307308if stage.playerListPos == PLAYER_TAILS_A309if Player_superState != SUPERSTATE_NONE310CallFunction(Tornado_HandleSuperTailsPal)311end if312end if313314switch object.state315case TORNADO_CATCHPLAYER316object.xpos += 0x10000317object.ypos -= 0x8000318319if object.xpos == 0xB40000320if Player_superState != SUPERSTATE_NONE321if stage.playerListPos == PLAYER_KNUCKLES_A // (PLAYER_KNUCKLES in Origins)322player[0].animation = ANI_GLIDING_DROP323end if324#platform: USE_ORIGINS325if stage.playerListPos == PLAYER_KNUCKLES_TAILS326player[0].animation = ANI_GLIDING_DROP327end if328#endplatform329end if330end if331332if object.xpos > 0xD40000333#platform: USE_ORIGINS334switch stage.playerListPos335case PLAYER_AMY_A336case PLAYER_AMY_TAILS_A337// Move Amy down a bit more338player[0].ypos += 0x30000339break340end switch341#endplatform342343if Player_superState == SUPERSTATE_NONE344player[0].animation = ANI_STOPPED345else346#platform: USE_STANDALONE347if stage.playerListPos == PLAYER_TAILS_A348player[0].animation = ANI_STOPPED349end if350351if stage.playerListPos == PLAYER_KNUCKLES_A352player[0].animation = ANI_STOPPED353end if354#endplatform355356#platform: USE_ORIGINS357// I don't understand why they don't just check if the player isn't Sonic358switch stage.playerListPos359case PLAYER_TAILS_A360case PLAYER_KNUCKLES_A361case PLAYER_KNUCKLES_TAILS_A362case PLAYER_AMY_A363case PLAYER_AMY_TAILS_A364player[0].animation = ANI_STOPPED365break366end switch367#endplatform368end if369370EndingSetup_scrollVelocity.x = -0x10000371372// Create a flock of birds373arrayPos0 = object[34].entityPos // ..aka "arrayPos0 = 34"374temp0 = 0375temp1 = 0376temp3 = false377while temp0 < 20378object[arrayPos0].type = TypeName[Bird]379object[arrayPos0].priority = PRIORITY_ACTIVE380bird[arrayPos0].timer = temp1381if temp3 == false382object[arrayPos0].drawOrder = 3383else384object[arrayPos0].drawOrder = 5385end if386387temp3 ^= true388389Rand(temp2, 16)390temp1 += temp2391arrayPos0++392temp0++393loop394395switch stage.playerListPos396case PLAYER_SONIC_A397case PLAYER_SONIC_TAILS_A398if specialStage.emeralds >= 0x7F399object.superSonic.timer = 64400object.superSonic.state = SUPERSONIC_MEETTORNADO401402stage.newXBoundary2 = screen.xsize403stage.newYBoundary2 = 376404stage.newYBoundary2 += screen.ysize405406stage.deathBoundary = stage.newYBoundary2407stage.deathBoundary <<= 16408end if409break410end switch411412object.state = TORNADO_STABALIZE413end if414415CallFunction(Tornado_AnimatePilot)416break417418case TORNADO_STABALIZE419EndingSetup_scrollVelocity.y += 0x400420if EndingSetup_scrollVelocity.y >= 0421object.state = TORNADO_FLYING422end if423CallFunction(Tornado_AnimatePilot)424break425426case TORNADO_FLYING427object.timer++428if object.timer >= 1102429object.timer = 0430switch stage.playerListPos431case PLAYER_SONIC_A432case PLAYER_SONIC_TAILS_A433if Player_superState == SUPERSTATE_NONE434player[0].visible = false435end if436break437438case PLAYER_TAILS_A439case PLAYER_KNUCKLES_A440#platform: USE_ORIGINS441case PLAYER_KNUCKLES_TAILS_A442case PLAYER_AMY_A443case PLAYER_AMY_TAILS_A444#endplatform445player[0].visible = false446break447end switch448449object.state = TORNADO_FLYINTOBG450end if451CallFunction(Tornado_AnimatePilot)452break453454case TORNADO_FLYINTOBG455switch stage.playerListPos456case PLAYER_SONIC_A457case PLAYER_SONIC_TAILS_A458if Player_superState != SUPERSTATE_NONE459if object.superSonic.state != SUPERSONIC_FLYINTOBG460object.superSonic.timer++461if object.superSonic.timer >= 90462object.superSonic.timer = 0463player[0].visible = false464object.superSonic.state = SUPERSONIC_FLYINTOBG465end if466end if467end if468break469end switch470471object.timer--472if object.timer < 0473object.timer = 2474switch stage.playerListPos475case PLAYER_SONIC_A476case PLAYER_SONIC_TAILS_A477if specialStage.emeralds < 0x7F478GetTableValue(object.tornadoFrame, object.zoomoutSprIndex, Tornado_ZoomoutSprites_Sonic)479else480GetTableValue(object.tornadoFrame, object.zoomoutSprIndex, Tornado_ZoomoutSprites_SS)481end if482break483484case PLAYER_TAILS_A485GetTableValue(object.tornadoFrame, object.zoomoutSprIndex, Tornado_ZoomoutSprites_Tails)486break487488case PLAYER_KNUCKLES_A489#platform: USE_ORIGINS490case PLAYER_KNUCKLES_TAILS_A491#endplatform492GetTableValue(object.tornadoFrame, object.zoomoutSprIndex, Tornado_ZoomoutSprites_Knuckles)493break494495#platform: USE_ORIGINS496case PLAYER_AMY_A497case PLAYER_AMY_TAILS_A498GetTableValue(object.tornadoFrame, object.zoomoutSprIndex, Tornado_ZoomoutSprites_Amy)499#endplatform500end switch501502temp0 = object.zoomoutSprIndex503temp0 <<= 1504GetTableValue(object.xpos, temp0, Tornado_ZoomoutPositions)505object.xpos += 0x340000506507temp0++508GetTableValue(object.ypos, temp0, Tornado_ZoomoutPositions)509510temp0 = camera[0].ypos511temp0 -= screen.ycenter512temp0 += 32513temp0 <<= 16514object.ypos += temp0515516object.zoomoutSprIndex++517if object.zoomoutSprIndex >= 28518object.timer = 0519object.zoomoutSprIndex = 0520if stage.playerListPos == PLAYER_TAILS_A521object.tornadoFrame = 49522else523object.tornadoFrame = 50524end if525object.xpos -= 0x220000526object.ypos += 0x450000527object.state = TORNADO_OFFSCREEN528end if529end if530break531532case TORNADO_OFFSCREEN533switch stage.playerListPos534case PLAYER_SONIC_A535case PLAYER_SONIC_TAILS_A536if Player_superState != SUPERSTATE_NONE537if object.superSonic.state != SUPERSONIC_FLYINTOBG538object.superSonic.timer++539if object.superSonic.timer >= 90540object.superSonic.timer = 0541player[0].visible = false542object.superSonic.state = SUPERSONIC_FLYINTOBG543end if544end if545end if546break547end switch548549object.timer++550if object.timer >= 120551object.timer = 0552object.state = TORNADO_FLYINTOSCREEN553end if554break555556case TORNADO_FLYINTOSCREEN557object.timer--558if object.timer < 0559object.timer = 2560temp0 = object.zoomoutSprIndex561temp0 <<= 1562GetTableValue(temp1, temp0, Tornado_EndPosePositions)563object.xpos += temp1564565temp0++566GetTableValue(temp1, temp0, Tornado_EndPosePositions)567object.ypos += temp1568object.zoomoutSprIndex++569if object.zoomoutSprIndex >= 7570object.timer = 0571object.state = TORNADO_INITLOGO572end if573end if574break575576case TORNADO_INITLOGO577object.timer++578if object.timer == 4579object.timer = 0580GetTableValue(object.text.frame, 0, Tornado_LogoTextFlash)581GetTableValue(object.number.frame, 0, Tornado_LogoNumberFlash)582object.state = TORNADO_FADEINLOGO583end if584break585586case TORNADO_FADEINLOGO587if object.alpha < 256588object.alpha += 4589end if590591object.timer++592if object.timer == 90593object.timer = 0594object.logo.frame = 0595object.state = TORNADO_LOGOSHINE_TEXT596end if597break598599case TORNADO_LOGOSHINE_TEXT600object.logo.timer++601if object.logo.timer == 2602object.logo.timer = 0603object.logo.frame++604GetTableValue(object.text.frame, object.logo.frame, Tornado_LogoTextFlash)605if object.logo.frame == 6606object.logo.frame = 0607object.state = TORNADO_LOGOSHINE_NUMBER608end if609end if610break611612case TORNADO_LOGOSHINE_NUMBER613object.logo.timer++614if object.logo.timer == 2615object.logo.timer = 0616object.logo.frame++617GetTableValue(object.number.frame, object.logo.frame, Tornado_LogoNumberFlash)618if object.logo.frame == 9619object.logo.frame = 0620object.state = TORNADO_DISPLAY621end if622end if623break624625case TORNADO_DISPLAY626object.timer++627if object.timer >= 240628object.timer = 0629object.state = TORNADO_FADEOUT630end if631break632633case TORNADO_FADEOUT634if object.timer < 320635object.timer += 12636else637// Roll the credits!638stage.activeList = PRESENTATION_STAGE639stage.listPos = 2640LoadStage()641end if642643if object.timer > 0644temp0 = object.timer645else646temp0 = 0647end if648SetScreenFade(0x00, 0x00, 0x00, temp0)649break650end switch651652switch object.superSonic.state653case SUPERSONIC_DESCEND654break655656case SUPERSONIC_MEETTORNADO657player[0].xpos += 0x08000658player[0].ypos += 0x10000659object.superSonic.timer--660if object.superSonic.timer < 0661object.superSonic.x = player[0].xpos662object.superSonic.y = player[0].ypos663object.superSonic.state = SUPERSONIC_FLYALONGTORNADO664end if665break666667case SUPERSONIC_FLYALONGTORNADO668break669670case SUPERSONIC_FLYINTOBG671object.superSonic.timer--672if object.superSonic.timer < 0673object.superSonic.timer = 2674GetTableValue(object.superSonic.frame, object.superSonic.index, Tornado_SuperSonic_Sprites)675temp0 = object.superSonic.index676temp0 <<= 1677678GetTableValue(object.superSonic.x, temp0, Tornado_SuperSonic_Positions)679object.superSonic.x += 0x340000680temp0++681682GetTableValue(object.superSonic.y, temp0, Tornado_SuperSonic_Positions)683temp0 = camera[0].ypos684temp0 -= screen.ycenter685temp0 += 32686temp0 <<= 16687object.superSonic.y += temp0688689object.superSonic.index++690if object.superSonic.index >= 30691object.superSonic.timer = 0692object.superSonic.state = SUPERSONIC_OFFSCREEN693end if694end if695break696697case SUPERSONIC_OFFSCREEN698object.superSonic.timer++699if object.superSonic.timer >= 60700object.superSonic.timer = 0701object.superSonic.state = SUPERSONIC_FLYINTOSCREEN702end if703break704705case SUPERSONIC_FLYINTOSCREEN706object.superSonic.timer--707if object.superSonic.timer < 0708object.superSonic.timer = 2709GetTableValue(object.superSonic.frame, object.superSonic.index, Tornado_SuperSonic_Sprites)710temp0 = object.superSonic.index711temp0 <<= 1712713GetTableValue(object.superSonic.x, temp0, Tornado_SuperSonic_Positions)714object.superSonic.x += 0x340000715temp0++716717GetTableValue(object.superSonic.y, temp0, Tornado_SuperSonic_Positions)718temp0 = camera[0].ypos719temp0 -= screen.ycenter720temp0 += 32721temp0 <<= 16722object.superSonic.y += temp0723724object.superSonic.index++725if object.superSonic.index >= 38726object.superSonic.state = SUPERSONIC_DISPLAY727end if728end if729break730731case SUPERSONIC_DISPLAY732// Just hover in front of the screen, nothing to do here733break734end switch735end event736737738event ObjectDraw739switch object.state740case TORNADO_CATCHPLAYER741case TORNADO_STABALIZE742case TORNADO_FLYING743// The Tornado is in its normal 2D version right now, so just draw the propeller, the Tornado, and its pilot744DrawSprite(object.propellerFrame)745DrawSprite(4)746DrawSprite(object.pilot.frame)747break748749case TORNADO_FLYINTOBG750DrawSprite(object.tornadoFrame)751break752753case TORNADO_OFFSCREEN754break755756case TORNADO_FLYINTOSCREEN757DrawSprite(object.tornadoFrame)758759temp0 = object.xpos760temp1 = object.ypos761762// Draw the first frame of the character posing for the screen763switch stage.playerListPos764case PLAYER_SONIC_A765case PLAYER_SONIC_TAILS_A766if specialStage.emeralds < 0x7F767temp0 -= 0x220000768temp1 -= 0x2F0000769DrawSpriteXY(24, temp0, temp1)770end if771break772773case PLAYER_TAILS_A774temp0 -= 0x240000775temp1 -= 0x2D0000776DrawSpriteXY(32, temp0, temp1)777break778779case PLAYER_KNUCKLES_A780#platform: USE_ORIGINS781case PLAYER_KNUCKLES_TAILS_A782#endplatform783temp0 -= 0x220000784temp1 -= 0x2F0000785DrawSpriteXY(40, temp0, temp1)786break787788#platform: USE_ORIGINS789case PLAYER_AMY_A790case PLAYER_AMY_TAILS_A791temp0 -= 0x220000792temp1 -= 0x2F0000793DrawSpriteXY(65, temp0, temp1)794break795#endplatform796end switch797break798799case TORNADO_INITLOGO800DrawSprite(object.tornadoFrame)801802temp0 = object.xpos803temp1 = object.ypos804805// Draw the second frame of the character posing for the screen806switch stage.playerListPos807case PLAYER_SONIC_A808case PLAYER_SONIC_TAILS_A809if specialStage.emeralds < 0x7F810temp0 -= 0x2A0000811temp1 -= 0x2F0000812DrawSpriteXY(25, temp0, temp1)813end if814break815816case PLAYER_TAILS_A817temp0 -= 0x2A0000818temp1 -= 0x250000819DrawSpriteXY(33, temp0, temp1)820break821822case PLAYER_KNUCKLES_A823#platform: USE_ORIGINS824case PLAYER_KNUCKLES_TAILS_A825#endplatform826temp0 -= 0x2A0000827temp1 -= 0x270000828DrawSpriteXY(41, temp0, temp1)829break830831#platform: USE_ORIGINS832case PLAYER_AMY_A833case PLAYER_AMY_TAILS_A834temp0 -= 0x2A0000835temp1 -= 0x2F0000836DrawSpriteXY(66, temp0, temp1)837break838#endplatform839end switch840break841842case TORNADO_FADEINLOGO843case TORNADO_LOGOSHINE_TEXT844case TORNADO_LOGOSHINE_NUMBER845case TORNADO_DISPLAY846case TORNADO_FADEOUT847// First draw the base logo848temp0 = screen.xsize849temp0 -= 79850temp1 = screen.ysize851temp1 -= 38852DrawSpriteScreenFX(52, FX_INK, temp0, temp1)853854// Then draw its shines on top of it855DrawSpriteScreenFX(object.text.frame, FX_INK, temp0, temp1)856DrawSpriteScreenFX(object.number.frame, FX_INK, temp0, temp1)857858// And the actual Tornado sprite859DrawSprite(object.tornadoFrame)860861temp0 = object.xpos862temp1 = object.ypos863864// And then draw the character posing in front of it865switch stage.playerListPos866case PLAYER_SONIC_A867case PLAYER_SONIC_TAILS_A868if specialStage.emeralds < 0x7F869// Only normal Sonic is drawn here870// Super Sonic has his own entire process below871temp0 -= 0x6E0000872temp1 -= 0x670000873DrawSpriteXY(26, temp0, temp1)874end if875break876877case PLAYER_TAILS_A878temp0 -= 0x6D0000879temp1 -= 0x670000880DrawSpriteXY(34, temp0, temp1)881break882883case PLAYER_KNUCKLES_A884#platform: USE_ORIGINS885case PLAYER_KNUCKLES_TAILS_A886#endplatform887temp0 -= 0x660000888temp1 -= 0x670000889DrawSpriteXY(42, temp0, temp1)890break891892#platform: USE_ORIGINS893case PLAYER_AMY_A894case PLAYER_AMY_TAILS_A895temp0 -= 0x6E0000896temp1 -= 0x670000897DrawSpriteXY(67, temp0, temp1)898break899#endplatform900end switch901break902end switch903904switch object.superSonic.state905case SUPERSONIC_FLYINTOBG906case SUPERSONIC_OFFSCREEN907case SUPERSONIC_FLYINTOSCREEN908case SUPERSONIC_DISPLAY909DrawSpriteXY(object.superSonic.frame, object.superSonic.x, object.superSonic.y)910break911end switch912913if object.state >= TORNADO_FLYINTOSCREEN914GetBit(temp0, oscillation, 1)915temp0 += 17916DrawSprite(temp0)917end if918end event919920921event ObjectStartup922LoadSpriteSheet("Ending/Objects.gif")923924// 0-3 - Front Propeller Frames925SpriteFrame(21, 8, 4, 24, 373, 191)926SpriteFrame(21, 11, 4, 18, 378, 194)927SpriteFrame(21, 16, 4, 8, 383, 199)928SpriteFrame(21, 11, 4, 18, 388, 194)929930// 4 - Main Tornado Frame931SpriteFrame(-95, -16, 116, 64, 256, 191)932933// 5-9 - Tails Piloting the Tornado Frames934SpriteFrame(-45, -8, 21, 16, 256, 174) // 5 - Looking straight ahead935SpriteFrame(-45, -8, 21, 16, 278, 174) // 6 - Normal head sprite (~3/4 angle one cropped from normal standing sprite)936SpriteFrame(-45, -8, 21, 16, 300, 174) // 7 - Mid-blink frame937SpriteFrame(-45, -8, 21, 16, 322, 174) // 8 - Blink frame with fully closed eyes938SpriteFrame(-47, -8, 23, 16, 344, 174) // 9 - Looking up939940// 10-11 - Sonic Piloting the Tornado Frames941SpriteFrame(-50, -8, 24, 16, 256, 157)942SpriteFrame(-50, -8, 24, 16, 281, 157)943944//12-16 - Zoomout Tornado shots, Tails as pilot and no passenger945SpriteFrame(-32, -16, 60, 32, 1, 1)946SpriteFrame(-24, -12, 44, 24, 63, 1)947SpriteFrame(-20, -12, 39, 24, 108, 1)948SpriteFrame(-20, -12, 40, 24, 149, 1)949SpriteFrame(-19, -12, 38, 24, 190, 1)950951// 17-18 - Zoomout Propeller Frames952SpriteFrame(-10, 7, 31, 31, 1, 34)953SpriteFrame(-11, 6, 31, 31, 33, 34)954955// 19-23 - Zoomout Tornado Frames, Tails as pilot and Sonic as passenger956SpriteFrame(-32, -28, 60, 44, 65, 26)957SpriteFrame(-24, -24, 44, 36, 126, 26)958SpriteFrame(-20, -19, 39, 31, 171, 26)959SpriteFrame(-20, -19, 40, 31, 211, 26)960SpriteFrame(-19, -15, 38, 27, 1, 146)961962// 24-26 - Normal Sonic Posing Frames963SpriteFrame(0, 0, 31, 38, 4, 179)964SpriteFrame(2, 5, 29, 42, 36, 175)965SpriteFrame(3, 3, 77, 96, 178, 159)966967// 27-31 - Zoomout Tornado Frames, Sonic as pilot and Tails as passenger968SpriteFrame(-32, -26, 60, 42, 1, 68)969SpriteFrame(-24, -23, 44, 34, 62, 75)970SpriteFrame(-20, -18, 39, 30, 1, 115)971SpriteFrame(-20, -19, 40, 31, 41, 115)972SpriteFrame(-19, -15, 38, 27, 82, 115)973974// 32-34 - Tails Posing Frame975SpriteFrame(0, 2, 31, 36, 1, 219)976SpriteFrame(0, 10, 32, 37, 33, 218)977SpriteFrame(1, 0, 111, 96, 66, 159)978979// 35-39 - Zoomout Tornado Frames, Tails as pilot and Knuckles as passenger980SpriteFrame(-32, -32, 60, 48, 181, 256)981SpriteFrame(-24, -24, 44, 36, 181, 305)982SpriteFrame(-20, -19, 39, 31, 181, 342)983SpriteFrame(-20, -19, 40, 31, 181, 374)984SpriteFrame(-19, -15, 38, 27, 181, 406)985986// 40-42 - Knuckles Posing Frames987SpriteFrame(0, 0, 31, 38, 382, 217)988SpriteFrame(0, 0, 32, 39, 414, 216)989SpriteFrame(0, 0, 64, 104, 447, 151)990991// 43-48 - Super Sonic Zoomout Frames992SpriteFrame(-11, -8, 19, 16, 124, 84)993SpriteFrame(-8, -8, 15, 12, 128, 101)994SpriteFrame(-7, -8, 11, 14, 132, 144)995SpriteFrame(-7, -7, 13, 13, 130, 129)996SpriteFrame(-6, -8, 13, 15, 130, 143)997SpriteFrame(1, 4, 111, 92, 144, 66)998999// 49 - Big Tornado Frame, Sonic as pilot1000SpriteFrame(-90, -53, 179, 105, 1, 256)10011002// 50 - Big Tornado Frame, Tails as pilot1003SpriteFrame(-90, -53, 179, 105, 1, 362)10041005// 51 - Blank Frame1006SpriteFrame(0, 0, 0, 0, 391, 256)10071008// 52 - `Sonic the Hedgehog 2` Complete Text Frame1009SpriteFrame(-60, -20, 120, 40, 391, 256)10101011// 53-55 - Flashing `Sonic` Text Frames1012SpriteFrame(-63, -22, 81, 38, 397, 297)1013SpriteFrame(-63, -22, 81, 38, 397, 336)1014SpriteFrame(-63, -22, 81, 38, 397, 375)10151016// 56-59 - Flashing `2` Text Frames1017SpriteFrame(28, -20, 32, 39, 479, 297)1018SpriteFrame(28, -20, 32, 39, 479, 337)1019SpriteFrame(28, -20, 32, 39, 479, 377)1020SpriteFrame(28, -20, 32, 39, 479, 417)10211022#platform: USE_ORIGINS1023// 60-64 - Zoomout Tornado Frames, Tails as pilot and Amy as passenger1024SpriteFrame(-32, -32, 60, 48, 257, 1)1025SpriteFrame(-24, -24, 44, 36, 402, 151)1026SpriteFrame(-20, -19, 39, 31, 242, 256)1027SpriteFrame(-20, -19, 40, 31, 282, 256)1028SpriteFrame(-19, -15, 38, 27, 256, 50)10291030// 65-67 - Amy Posing Frames1031SpriteFrame(2, 2, 27, 35, 256, 77)1032SpriteFrame(-1, -1, 28, 43, 256, 113)1033SpriteFrame(6, -3, 65, 102, 325, 256)1034#endplatform1035end event103610371038// ========================1039// Editor Events1040// ========================10411042event RSDKDraw1043DrawSprite(0)1044DrawSprite(1)1045DrawSprite(2)1046end event104710481049event RSDKLoad1050LoadSpriteSheet("Ending/Objects.gif")1051SpriteFrame(21, 8, 4, 24, 373, 191) // Propeller1052SpriteFrame(-95, -16, 116, 64, 256, 191) // Tornado1053SpriteFrame(-45, -8, 21, 16, 278, 174) // Tails10541055SetVariableAlias(ALIAS_VAR_PROPVAL, "unused")1056end event105710581059