Path: blob/main/Scripts/Special/StageFinish.txt
1319 views
//---------------Sonic CD Stage Finish Script-----------------//1//--------Scripted by Christian Whitehead 'The Taxman'--------//2//-------Unpacked By Rubberduckycooly's Script Unpacker-------//34// Aliases5#alias Object.Value0 : Object.Timer6#alias Object.Value5 : Object.TimeBonus7#alias Object.Value6 : Object.RingBonus89// This can be Coins bonus too, depending on the current mode10// For simplicity's sake, we're just going to continue calling it ExtraLives11#alias Object.Value7 : Object.ExtraLives1213// All texts have their own X position values14#alias Object.XPos : Object.LineXPos015#alias Object.Value1 : Object.LineXPos116#alias Object.Value2 : Object.LineXPos217#alias Object.Value3 : Object.LineXPos318#alias Object.Value4 : Object.LineXPos41920// HUD Alias21#alias Object.Value1 : HUD.TimeSeconds22#alias Object.Value3 : HUD.Rings2324// States25#alias 0 : STAGEFINISH_INIT26#alias 1 : STAGEFINISH_FADEOUT27#alias 2 : STAGEFINISH_FADEIN28#alias 3 : STAGEFINISH_SCROLLTEXT29#alias 4 : STAGEFINISH_DISPLAYTALLY30#alias 5 : STAGEFINISH_TALLYDOWN31#alias 6 : STAGEFINISH_DISPLAYFINAL32#alias 7 : STAGEFINISH_LOADNORMAL33#alias 8 : STAGEFINISH_LOADTIMEATTACK34#alias 9 : STAGEFINISH_LOADLEVELSELECT35#alias 10: STAGEFINISH_CHECKRETRYCOND36#alias 11: STAGEFINISH_SAVE3738// Property Value - Results Type39// Changed by this object, as well as the things that may spawn it40#alias Object.PropertyValue : Object.ResultsType4142// Character limit is rearing its head here, which is why we can only stick in a "T" to distinguish it from states43// Not what was planned, but not much we can do...44#alias 0 : STAGEFINISH_T_FAILURE45#alias 1 : STAGEFINISH_T_STONEOBTAINED46#alias 2 : STAGEFINISH_T_ALLSTONESOBTAINED4748// Player Aliases49#alias 0 : PLAYER_SONIC_A50#alias 1 : PLAYER_TAILS_A5152// Game Mode Aliases53#alias 2 : MODE_TIMEATTACK5455// Language Aliases56#alias 0 : LANG_ENGLISH57#alias 1 : LANG_FRENCH58#alias 2 : LANG_ITALIAN59#alias 3 : LANG_DEUTSCH60#alias 4 : LANG_SPANISH61#alias 5 : LANG_JAPANESE6263// Global SFX64#alias 16 : SFX_G_SCOREADD65#alias 17 : SFX_G_SCORETOTAL66#alias 19 : SFX_G_SPECIALWARP67#alias 20 : SFX_G_1UP68#alias 21 : SFX_G_ACHIEVEMENT6970// Ink Effect Aliases71#alias 2 : INK_ALPHA7273// Soundtrack74#alias 0 : OST_JP7576// Stage Aliases77#alias 0 : STAGE_P_TITLESCREEN78#alias 2 : STAGE_P_TIMEATTACK79#alias 4 : STAGE_P_SOUNDTEST80#alias 7 : STAGE_P_CREDITS8182// Game Mode Aliases83#alias 1 : MODE_SAVEGAME8485// Control Mode86#alias 0 : CONTROLMODE_NORMAL878889sub ObjectMain90switch Object.State91case STAGEFINISH_INIT92// Setup the initial text line positions93Object.LineXPos0 = -79994Object.LineXPos1 = 125595Object.LineXPos2 = 131996Object.LineXPos3 = 140297Object.LineXPos4 = 14669899Object.State = STAGEFINISH_FADEOUT100Object.Timer = 0101102// Setup alpha, used for fading in the Time Stones103Object.Alpha = 0104Object.InkEffect = INK_ALPHA105106#platform: Use_Origins107// Some stuff for Origins, where we back up some cool values108BackupSpecialStageListPos = SpecialStage.ListPos109BackupTimeStones = SpecialStage.TimeStones110#endplatform111112// Don't wanna reward the Player if they just lost!113if Object.ResultsType > STAGEFINISH_T_FAILURE114115// Setup the Time Bonus116Object.TimeBonus = HUD[4].TimeSeconds117Object.TimeBonus *= 200118119// Set the corresponding Time Stone bit for this stage120TempValue0 = Stage.ActNo121TempValue0--122123#platform: Use_Origins124// Origins changed it up a bit125SetBit(BackupTimeStones, TempValue0, true)126#endplatform127128#platform: Use_Standalone129SetBit(SpecialStage.TimeStones, TempValue0, true)130#endplatform131else132Object.TimeBonus = 0133end if134135#platform: Use_Origins136// Backup the Player's Rings137StageStatsUsabilityParam5 = HUD[4].Rings138139// Setup the Ring Bonus140Object.RingBonus = HUD[4].Rings141Object.RingBonus *= 200142143if BackupTimeStones < 127144TempValue0 = false145while TempValue0 == false146BackupSpecialStageListPos++147if BackupSpecialStageListPos > 6148BackupSpecialStageListPos = 0149end if150151// Carrying through...152GetBit(TempValue1, BackupTimeStones, BackupSpecialStageListPos)153154if TempValue1 == false155TempValue0 = true156end if157loop158else159TempValue0 = Stage.ListPos160TempValue0 %= 10161if TempValue0 == 9162Stage.ListPos--163end if164165Good_Future_Count = 2166167if Stage.PlayerListPos == PLAYER_SONIC168// If all Stones are collected, unlock the "Treasure Hunter" achievement169SetAchievement(8, 100)170end if171end if172173// There used to be duplicate saving here, but Origins actually optimised that! How nice of them174175// As a replacement for all that, let's just back up the Score instead176recScore = Player.Score177178#endplatform179180#platform: Use_Standalone181// Setup the Ring Bonus182Object.RingBonus = HUD[4].Rings183Object.RingBonus *= 200184185Stage.ListPos = SpecialStage.NextZone186Stage.ActiveList = REGULAR_STAGE187188if SpecialStage.TimeStones < 127189TempValue0 = false190while TempValue0 == false191SpecialStage.ListPos++192if SpecialStage.ListPos > 6193SpecialStage.ListPos = 0194end if195196GetBit(TempValue1, SpecialStage.TimeStones, SpecialStage.ListPos)197if TempValue1 == false198TempValue0 = true199end if200loop201else202TempValue0 = Stage.ListPos203TempValue0 %= 10204if TempValue0 == 9205Stage.ListPos--206end if207208Good_Future_Count = 2209210if Stage.PlayerListPos == PLAYER_SONIC_A211// If all Stones are collected, unlock the "Treasure Hunter" achievement212SetAchievement(8, 100)213end if214end if215#endplatform216break217218case STAGEFINISH_FADEOUT219if Object.Timer == 120220221// More Origins changes222#platform: Use_Origins223Object.State = STAGEFINISH_CHECKRETRYCOND224#endplatform225226#platform: Use_Standalone227Object.State = STAGEFINISH_FADEIN228Object.Timer = 256229230if SpecialStage.TimeStones > 126 // 0b01111110, each '1' bit represents an obtained time stone231// If the player has all Stones, then turn this object into the "Got 'em all!!" variant232233Object.ResultsType = STAGEFINISH_T_ALLSTONESOBTAINED234end if235236PlayMusic(1)237#endplatform238else239Object.Timer++240Music.Volume--241242if Object.Timer == 24243// Clear all game objects (aside from this one)244245// First do all the reserved object slots246TempValue0 = 0247while TempValue0 < 30248ResetObjectEntity(TempValue0, TypeName[Blank Object], 0, 0, 0)249TempValue0++250loop251252// Then do all the game object slots253TempValue0++254while TempValue0 < 1184255ResetObjectEntity(TempValue0, TypeName[Blank Object], 0, 0, 0)256TempValue0++257loop258259// Set all layers to not draw260Stage.ActiveLayer[0] = 9261Stage.ActiveLayer[1] = 9262Stage.ActiveLayer[2] = 9263Stage.ActiveLayer[3] = 9264265// Lock the player from doing stuff too266Player.ControlMode = CONTROLMODE_NORMAL267KeyDown[1].Left = false268KeyDown[1].Right = false269Player.Direction = FACING_RIGHT270271end if272end if273274TempValue0 = Object.Timer275TempValue0 <<= 4276if TempValue0 > 255277TempValue0 = 255278end if279SetScreenFade(208, 255, 224, TempValue0)280break281282case STAGEFINISH_FADEIN283Object.Timer -= 16284if Object.Timer == 0285Object.State = STAGEFINISH_SCROLLTEXT286287#platform: Use_Origins288// We can actually set the stage now289Stage.ActiveList = REGULAR_STAGE290Stage.ListPos = SpecialStage.NextZone291#endplatform292end if293294SetScreenFade(208, 255, 224, Object.Timer)295296// Move in all the texts297298TempValue0 = Screen.CenterX299TempValue0 -= 88300if Object.LineXPos0 < TempValue0301Object.LineXPos0 += 16302if Object.LineXPos0 > TempValue0303Object.LineXPos0 = TempValue0304end if305else306Object.LineXPos0 = TempValue0307end if308309TempValue0++310if Object.LineXPos1 > TempValue0311Object.LineXPos1 -= 16312if Object.LineXPos1 < TempValue0313Object.LineXPos1 = TempValue0314end if315else316Object.LineXPos1 = TempValue0317end if318319if Object.LineXPos2 > TempValue0320Object.LineXPos2 -= 16321if Object.LineXPos2 < TempValue0322Object.LineXPos2 = TempValue0323end if324else325Object.LineXPos2 = TempValue0326end if327328if Object.LineXPos3 > TempValue0329Object.LineXPos3 -= 16330if Object.LineXPos3 < TempValue0331Object.LineXPos3 = TempValue0332end if333else334Object.LineXPos3 = TempValue0335end if336337if Object.LineXPos4 > TempValue0338Object.LineXPos4 -= 16339if Object.LineXPos4 < TempValue0340Object.LineXPos4 = TempValue0341end if342else343Object.LineXPos4 = TempValue0344345// All the texts are in place, proceed346// It should never happen, but if this is reached before the screen is fully faded in (see start of this state) then347// the screen will stay faded the entire durration of the results screen348349Object.State = STAGEFINISH_DISPLAYTALLY350Object.Timer = 0351end if352break353354case STAGEFINISH_SCROLLTEXT355// Moving the text in356357TempValue0 = Screen.CenterX358TempValue0 -= 88359360if Object.LineXPos0 < TempValue0361Object.LineXPos0 += 16362if Object.LineXPos0 > TempValue0363Object.LineXPos0 = TempValue0364end if365else366Object.LineXPos0 = TempValue0367end if368369TempValue0++370if Object.LineXPos1 > TempValue0371Object.LineXPos1 -= 16372if Object.LineXPos1 < TempValue0373Object.LineXPos1 = TempValue0374end if375else376Object.LineXPos1 = TempValue0377end if378379if Object.LineXPos2 > TempValue0380Object.LineXPos2 -= 16381if Object.LineXPos2 < TempValue0382Object.LineXPos2 = TempValue0383end if384else385Object.LineXPos2 = TempValue0386end if387388if Object.LineXPos3 > TempValue0389Object.LineXPos3 -= 16390if Object.LineXPos3 < TempValue0391Object.LineXPos3 = TempValue0392end if393else394Object.LineXPos3 = TempValue0395end if396397if Object.LineXPos4 > TempValue0398Object.LineXPos4 -= 16399if Object.LineXPos4 < TempValue0400Object.LineXPos4 = TempValue0401end if402else403Object.LineXPos4 = TempValue0404Object.State = STAGEFINISH_DISPLAYTALLY405Object.Timer = 0406end if407break408409case STAGEFINISH_DISPLAYTALLY410// Waiting for a bit, to let the player see what they got411412// Fade in the Stones413if Object.Alpha < 255414// TempValue0 is used to hold the target value since Object.Alpha is a byte, and therefore prone to overflowing if too much is added415416TempValue0 = Object.Alpha417TempValue0 += 8418if TempValue0 > 255419TempValue0 = 255420end if421422Object.Alpha = TempValue0423end if424425// The different soundtrack jingles have different lenghts, so account for that426if Options.Soundtrack == OST_JP427Object.Timer++428if Object.Timer > 299429Object.Timer = 0430Object.State = STAGEFINISH_TALLYDOWN431end if432else433Object.Timer++434if Object.Timer > 429435Object.Timer = 0436Object.State = STAGEFINISH_TALLYDOWN437end if438end if439break440441case STAGEFINISH_TALLYDOWN442// Tally up the bonuses, rings first then time443444if Object.RingBonus > 0445Object.RingBonus -= 200446Player.Score += 200447448if Object.RingBonus < 0449Player.Score += Object.RingBonus450Object.RingBonus = 0451end if452else453if Object.TimeBonus > 0454Object.TimeBonus -= 200455Player.Score += 200456457if Object.TimeBonus < 0458Player.Score += Object.TimeBonus459Object.TimeBonus = 0460end if461end if462end if463464if Player.Score >= Player.ScoreBonus465Object.ExtraLives++466467#platform: Use_Origins468// In Origins, give either Coins or Lives based on the current mode469if game.coinMode == false470Player.Lives++471else472game.callbackParam0 = 1 // Set the amount of coins to add473EngineCallback(NOTIFY_ADD_COIN)474end if475#endplatform476477#platform: Use_Standalone478Player.Lives++ // In Standalone, we only have lives479#endplatform480481Player.ScoreBonus += 50000482483if Stage.PlayerListPos == PLAYER_SONIC_A // PLAYER_SONIC in origins484PlaySfx(SFX_G_1UP, false)485else486PlaySfx(SFX_G_ACHIEVEMENT, false)487end if488end if489490CheckGreater(Object.RingBonus, 0)491TempValue0 = CheckResult492CheckGreater(Object.TimeBonus, 0)493TempValue0 |= CheckResult494495if TempValue0 == true496Object.Timer++497498if Object.Timer == 2499PlaySfx(SFX_G_SCOREADD, false)500Object.Timer = 0501end if502else503// The tally's done, proceed504505Object.State = STAGEFINISH_DISPLAYFINAL506Object.Timer = 0507508// And of course, the signature ka-ching!509PlaySfx(SFX_G_SCORETOTAL, false)510end if511break512513case STAGEFINISH_DISPLAYFINAL514// Wait some more, letting the player see what they *really* got515Object.Timer++516517if Object.Timer == 160518Object.Timer = 0519Object.State = STAGEFINISH_LOADNORMAL520if Object[0].Type == TypeName[Blank Object]521PlaySfx(SFX_G_SPECIALWARP, false)522end if523end if524break525526case STAGEFINISH_LOADNORMAL527if Object[0].Type == TypeName[Blank Object]528Object.Timer += 8529SetScreenFade(208, 255, 224, Object.Timer)530531if Object.Timer == 1024532if Options.GameMode == MODE_SAVEGAME533534// Save the Player's progress535// This used to be useless, because the Player's progress was already saved previously in the Object,536// but Origins removed that duplicate, and now this whole section actually serves a purpose now537538ArrayPos1 = Options.SaveSlot539ArrayPos1 <<= 3540541SaveRAM[ArrayPos1] = Stage.PlayerListPos542543ArrayPos1++544SaveRAM[ArrayPos1] = Player.Lives545546ArrayPos1++547SaveRAM[ArrayPos1] = Player.Score548549ArrayPos1++550SaveRAM[ArrayPos1] = Stage.ListPos551SaveRAM[ArrayPos1]++552553ArrayPos1++554SaveRAM[ArrayPos1] = SpecialStage.TimeStones555556ArrayPos1++557SaveRAM[ArrayPos1] = SpecialStage.ListPos558559ArrayPos1++560SaveRAM[ArrayPos1] = Player.ScoreBonus561562// This bump in particular, it doesn't do anything, does it?563ArrayPos1++564565WriteSaveRAM()566end if567568#platform: Use_Origins569// A small Origins tweak - backup the Player's score (again)570// So I guess in return for one redundancy loss, we got another one in return...571recScore = Player.Score572#endplatform573574// Write the correct colors to Fade_Colour so that the maingame fades back in with the same white575// (This is setting Fade_Colout to 0xD0FFE0, in hex form)576Fade_Colour = 208577Fade_Colour <<= 16578TempValue0 = 255579TempValue0 <<= 8580Fade_Colour += TempValue0581Fade_Colour += 224582583#platform: Use_Origins584// Now, let the game know how many Rings we got585game.callbackParam0 = StageStatsUsabilityParam5586EngineCallback(NOTIFY_STATS_RING)587588// Reset the variable for future use589StageStatsUsabilityParam5 = 0590#endplatform591592if Stage.ListPos < Stage.ListSize593LoadStage()594else595// This should never happen, but you're somehow supposed to go to a stage that doesn't exist, so596// just go back to the title screen instead597Stage.ActiveList = PRESENTATION_STAGE598Stage.ListPos = STAGE_P_TITLESCREEN599LoadStage()600end if601end if602end if603break604605case STAGEFINISH_LOADTIMEATTACK606if Object.Timer < 480607Object.Timer += 4608Music.Volume--609else610StopMusic()611612// Save the Time Attack results613TimeAttack.Result = Stage.Seconds614TimeAttack.Result *= 100615616TempValue0 = Stage.Minutes617TempValue0 *= 6000618619TimeAttack.Result += TempValue0620TimeAttack.Result += Stage.MilliSeconds621622// Load the Time Attack Menu623// This is an extremely minor change, but Origins changed this part to be more in line with624// other stage setting code, where active list is set first and then list pos comes after625// Before that, this part had list pos first and then active list, which was quite odd...626Stage.ActiveList = PRESENTATION_STAGE627Stage.ListPos = STAGE_P_TIMEATTACK628629LoadStage()630end if631632SetScreenFade(0, 0, 0, Object.Timer)633break634635case STAGEFINISH_LOADLEVELSELECT636// Used when exiting the hidden Robotnik stage637#platform: Use_Standalone638if Object.Timer < 480639#endplatform640#platform: Use_Origins641if Object.Timer < 240642#endplatform643// Fade out the screen and the music644645Object.Timer += 4646Music.Volume--647else648// Load the credits scene649650StopMusic()651652// Similarly to the above, this spot used to be out-of-order until Origins came and fixed it653// One strange thing through, it changed it from the Credits to be the Sound Test instead?654// I have no idea if that was an intentional change or not, but it's strange...655656Stage.ActiveList = PRESENTATION_STAGE657658#platform: Use_Origins659Stage.ListPos = STAGE_P_SOUNDTEST660#endplatform661662#platform: Use_Standalone663Stage.ListPos = STAGE_P_CREDITS664#endplatform665LoadStage()666end if667668SetScreenFade(0, 0, 0, Object.Timer)669break670671#platform: Use_Origins672// The Origins folks put an extra break in here LOL673// This code never hits anyway, so I guess it's fine?674break675676case STAGEFINISH_CHECKRETRYCOND677678game.callbackResult = -1 // Reset the Callback result679680if Object.ResultsType == STAGEFINISH_T_FAILURE681// We've failed getting the Stone, so we're able to retry the Special Stage682683game.callbackParam0 = false684else685// We got the Stone, so we don't need to retry686687game.callbackParam0 = true688end if689690// Offer to restart the Special Stage, if the Player failed it691game.callbackParam1 = BackupSpecialStageListPos692game.callbackParam2 = BackupTimeStones693EngineCallback(NOTIFY_SPECIAL_RETRY)694695Object.State = STAGEFINISH_SAVE696697SetScreenFade(208, 255, 224, 255)698break699700case STAGEFINISH_SAVE701if game.callbackResult >= false702SpecialStage.ListPos = BackupSpecialStageListPos703SpecialStage.TimeStones = BackupTimeStones704705if Options.GameMode == MODE_SAVEGAME706ArrayPos1 = Options.SaveSlot707ArrayPos1 <<= 3708709SaveRAM[ArrayPos1] = Stage.PlayerListPos710711ArrayPos1++712SaveRAM[ArrayPos1] = Player.Lives713714ArrayPos1++715SaveRAM[ArrayPos1] = Player.Score716717ArrayPos1++718SaveRAM[ArrayPos1] = Stage.ListPos719SaveRAM[ArrayPos1]++720721ArrayPos1++722SaveRAM[ArrayPos1] = SpecialStage.TimeStones723724ArrayPos1++725SaveRAM[ArrayPos1] = SpecialStage.ListPos726727ArrayPos1++728SaveRAM[ArrayPos1] = Player.ScoreBonus729730ArrayPos1++731732WriteSaveRAM()733end if734735if Options.GameMode == MODE_TIMEATTACK736737// Save up the Time Attack results738739TimeAttack.Result = Stage.Seconds740TimeAttack.Result *= 100741742TempValue0 = Stage.Minutes743TempValue0 *= 6000744745TimeAttack.Result += TempValue0746TimeAttack.Result += Stage.MilliSeconds747748// Load the Time Attack menu749Stage.ActiveList = PRESENTATION_STAGE750Stage.ListPos = STAGE_P_TIMEATTACK751752LoadStage()753else754Object.State = STAGEFINISH_FADEIN755Object.Timer = 256756if SpecialStage.TimeStones > 126 // 0b1111110, each '1' bit represents an obtained time stone757// Got 'em all!758Object.ResultsType = STAGEFINISH_T_ALLSTONESOBTAINED759EngineCallback(NOTIFY_STATS_PARAM_2)760end if761762PlayMusic(1)763end if764end if765766SetScreenFade(208, 255, 224, 255)767break768#endplatform769end switch770771end sub772773774sub ObjectDraw775if Object.State != STAGEFINISH_LOADLEVELSELECT776if Object.State > STAGEFINISH_FADEOUT777778// Draw the Background779TempValue0 = 0780while TempValue0 < 240781TempValue1 = 0782while TempValue1 < 360783DrawSpriteScreenXY(0, TempValue1, TempValue0)784TempValue1 += 224785loop786787TempValue0 += 48788loop789790#platform: Use_Decomp791// Only on decomp, extend the bg past 448792TempValue0 = 0793while TempValue0 < 240794TempValue1 = 448795while TempValue1 < 720796DrawSpriteScreenXY(0, TempValue1, TempValue0)797TempValue1 += 224798loop799800TempValue0 += 48801loop802803#endplatform804805// Draw all the Time Stones the player has so far806// - TempValue0 is the current Stone807// - TempValue1 is the starting Sprite Frame ID for the Stones808// - TempValue2 is the draw position for the Stones809// - TempValue3 is either true or false based if the current Time Stone is obtained810TempValue0 = 0811TempValue1 = 20812TempValue2 = Screen.CenterX813TempValue2 -= 79814815while TempValue0 < 7816817// See if the Player has the current Time Stone818GetBit(TempValue3, SpecialStage.TimeStones, TempValue0)819820// Bump up the index, for next loop around821TempValue0++822823// If the Player has the Time Stone, then draw it824if TempValue3 == true825DrawSpriteScreenFX(TempValue1, FX_INK, TempValue2, 81)826end if827828TempValue1++829830// Each Stone is drawn 24 px apart from each other's center831TempValue2 += 24832loop833end if834835// Draw the main text, depending on what the current results type is836switch Object.ResultsType837case STAGEFINISH_T_FAILURE838// "SPECIAL ZONE"839DrawSpriteScreenXY(1, Object.XPos, 50)840break841842case STAGEFINISH_T_STONEOBTAINED843// "TIME STONES"844DrawSpriteScreenXY(2, Object.XPos, 50)845break846847case STAGEFINISH_T_ALLSTONESOBTAINED848// "GOT THEM ALL!!"849DrawSpriteScreenXY(3, Object.XPos, 50)850break851852end switch853854// Draw the Score text855DrawSpriteScreenXY(4, Object.LineXPos1, 105)856857// Draw the Player's Score858TempValue0 = Object.LineXPos1859TempValue0 += 176860DrawNumbers(10, TempValue0, 105, Player.Score, 6, 8, false)861862// Then, the Ring Bonus line863864// First, draw the "RING" sprite865DrawSpriteScreenXY(5, Object.LineXPos2, 129)866867TempValue0 = Object.LineXPos2868TempValue0 += 40869870// Then, 40 pixels to the right of that, draw the "BONUS" sprite871DrawSpriteScreenXY(7, TempValue0, 129)872873// And at the end of the line, draw the Ring Bonus count874TempValue0 += 136875DrawNumbers(10, TempValue0, 129, Object.RingBonus, 5, 8, false)876877// Line 3, holds the Time Bonus text878879// First, the "TIME" sprite880DrawSpriteScreenXY(6, Object.LineXPos3, 153)881882TempValue0 = Object.LineXPos3883TempValue0 += 40884885// Then, 40 pixels to the right, the "BONUS" frame886DrawSpriteScreenXY(7, TempValue0, 153)887888// And at the end of this line too, draw the Time Bonus numbers889TempValue0 += 136890DrawNumbers(10, TempValue0, 153, Object.TimeBonus, 5, 8, false)891892// Line 4, holds either Continues or Coins based on the current mode893#platform: Use_Origins894if game.coinMode == false895896// Draw the "EXTRA LIVES" text897898// First, is "EXTRA"899DrawSpriteScreenXY(8, Object.LineXPos4, 177)900901TempValue0 = Object.LineXPos4902TempValue0 += 49903904// Then after than of course, comes "LIVES"905DrawSpriteScreenXY(9, TempValue0, 177)906907else908909// Draw the "COINS BONUS" text910911// First, comes "COINS"912DrawSpriteScreenXY(35, Object.LineXPos4, 177)913914TempValue0 = Object.LineXPos4915TempValue0 += 40916917// Then to the right of that, is "BONUS"918DrawSpriteScreenXY(7, TempValue0, 177)919920// And then bump up the position for the icons to be drawn at921TempValue0 += 9922923end if924#endplatform925926#platform: Use_Standalone927// Draw the "EXTRA LIVES" text928929// First, is "EXTRA"930DrawSpriteScreenXY(8, Object.LineXPos4, 177)931932TempValue0 = Object.LineXPos4933TempValue0 += 49934935// Then after than of course, comes "LIVES"936DrawSpriteScreenXY(9, TempValue0, 177)937#endplatform938939// Move to the end of the line940TempValue0 += 86941942// Animate the mini-character943Object.Frame++944Object.Frame &= 15945946// Get the base frame the mini-character should use947TempValue1 = Object.Frame948TempValue1 >>= 3949950// Bump it up to match its corresponding Sprite Frame ID951TempValue1 += 27952953TempValue2 = Object.ExtraLives954955#platform: Use_Origins956// Now, draw either Continues or Coins957958if game.coinMode == false959960// Draw Continues961962while TempValue2 > 0963DrawSpriteScreenXY(TempValue1, TempValue0, 177)964TempValue2--965966TempValue0 += 24967loop968969else970971if TempValue2 > 0972TempValue0 += 12973974// This TempValue1, it isn't used anywhere, is it?975// It corresponds with the following Sprite Frame ID, perhaps it was used for that before...976TempValue1 = 29977978// Draw the Coins icon979DrawSpriteScreenXY(29, TempValue0, 177)980981// And then an x1 next to it982DrawSpriteScreenXY(30, TempValue0, 177)983984// And then make the Coin sparkle985TempValue1 = Object.Frame986TempValue1 >>= 2987988// From that sparkle frame, but it up by 31 to match the Sprite Frame IDs989TempValue1 += 31990991// And now, draw the sparkle on top of the Coin992DrawSpriteScreenXY(TempValue1, TempValue0, 177)993end if994995end if996#endplatform997998#platform: Use_Standalone999// Just draw Continues, we don't use Coins in Standalone10001001while TempValue2 > 01002DrawSpriteScreenXY(TempValue1, TempValue0, 177)1003TempValue2--1004TempValue0 += 241005loop1006#endplatform10071008end if1009end sub101010111012sub ObjectStartup10131014// Load the correct sheet based on the current language1015switch Engine.Language1016case LANG_ENGLISH1017case LANG_JAPANESE1018// LANG_ENGLISH and LANG_JAPANESE use the same sheet (the LANG_ENGLISH sheet)1019LoadSpriteSheet("Special/ScoreScreen.gif")1020break10211022case LANG_FRENCH1023LoadSpriteSheet("Special/ScoreScreen_FR.gif")1024break10251026case LANG_ITALIAN1027LoadSpriteSheet("Special/ScoreScreen_IT.gif")1028break10291030case LANG_DEUTSCH1031LoadSpriteSheet("Special/ScoreScreen_DE.gif")1032break10331034case LANG_SPANISH1035LoadSpriteSheet("Special/ScoreScreen_ES.gif")1036break10371038end switch10391040// 0 - Background1041SpriteFrame(0, 0, 224, 48, 0, 63)10421043// 1 - "SPECIAL ZONE" Text1044SpriteFrame(0, 0, 184, 14, 1, 1)10451046// 2 - "TIME STONES" Text1047SpriteFrame(9, 0, 167, 14, 1, 16)10481049// 3 - "GOT THEM ALL!!" Text1050SpriteFrame(-16, 0, 205, 14, 1, 48)10511052// 4 - "SCORE" Text1053SpriteFrame(0, 0, 39, 11, 1, 112)10541055// 5 - "RING" Text1056SpriteFrame(0, 0, 31, 11, 41, 112)10571058// 6 - "TIME" Text1059SpriteFrame(0, 0, 31, 11, 73, 112)10601061// 7 - "BONUS" Text1062SpriteFrame(0, 0, 41, 11, 105, 112)10631064// 8 - "EXTRA" Text1065SpriteFrame(0, 0, 40, 11, 147, 112)10661067// 9 - "LIVES" Text1068SpriteFrame(0, 0, 36, 11, 188, 112)10691070// 10-19 - Numbers 0-91071SpriteFrame(0, 0, 8, 11, 220, 1)1072SpriteFrame(0, 0, 8, 11, 229, 1)1073SpriteFrame(0, 0, 8, 11, 238, 1)1074SpriteFrame(0, 0, 8, 11, 247, 1)1075SpriteFrame(0, 0, 8, 11, 220, 13)1076SpriteFrame(0, 0, 8, 11, 229, 13)1077SpriteFrame(0, 0, 8, 11, 238, 13)1078SpriteFrame(0, 0, 8, 11, 247, 13)1079SpriteFrame(0, 0, 8, 11, 238, 25)1080SpriteFrame(0, 0, 8, 11, 247, 25)10811082// 20-26 - Time Stones1083SpriteFrame(0, 0, 16, 16, 1, 31)1084SpriteFrame(0, 0, 16, 16, 18, 31)1085SpriteFrame(0, 0, 16, 16, 35, 31)1086SpriteFrame(0, 0, 16, 16, 52, 31)1087SpriteFrame(0, 0, 16, 16, 69, 31)1088SpriteFrame(0, 0, 16, 16, 86, 31)1089SpriteFrame(0, 0, 16, 16, 103, 31)10901091// 27-28 - Small Foot-Tapping Player Icons1092if Stage.PlayerListPos == PLAYER_SONIC_A // PLAYER_SONIC in origins1093// Do note, these are separate from the ones used in the Pause Menu1094// These ones are bluer, as well as having a hole in Sonic's head...1095SpriteFrame(0, 0, 16, 23, 169, 24)1096SpriteFrame(0, 0, 16, 23, 186, 24)1097end if1098if Stage.PlayerListPos == PLAYER_TAILS_A // PLAYER_TAILS in origins1099SpriteFrame(0, 0, 16, 23, 139, 203)1100SpriteFrame(0, 0, 16, 23, 156, 203)1101end if1102#platform: Use_Origins1103if Stage.PlayerListPos == PLAYER_KNUCKLES1104SpriteFrame(0, 0, 16, 22, 18, 256)1105SpriteFrame(0, 0, 16, 22, 35, 256)1106end if1107if Stage.PlayerListPos == PLAYER_AMY1108SpriteFrame(0, 0, 17, 22, 70, 256)1109SpriteFrame(0, 0, 17, 22, 88, 256)1110end if11111112// These below ones are new to Origins11131114// 29 - Coins icon1115SpriteFrame(0, -4, 18, 16, 204, 29)11161117// 30 - "x1"1118SpriteFrame(18, -4, 32, 16, 187, 1)11191120// 31-34 - Sparkle Frames1121SpriteFrame(-4, -8, 24, 24, 130, 125)1122SpriteFrame(-4, -8, 24, 24, 155, 125)1123SpriteFrame(-4, -8, 24, 24, 130, 150)1124SpriteFrame(-4, -8, 24, 24, 155, 150)11251126// 35 - "COIN" text, in the context of "Coin Bonus"1127SpriteFrame(0, 0, 31, 11, 130, 175)1128#endplatform11291130end sub113111321133// ========================1134// Editor Subs1135// ========================11361137sub RSDKDraw1138DrawSprite(0)1139end sub114011411142sub RSDKLoad1143LoadSpriteSheet("Special/ScoreScreen.gif")1144SpriteFrame(0, 0, 184, 14, 1, 1)11451146// Although used, it's not to be set from editor1147SetVariableAlias(ALIAS_VAR_PROPVAL, "unused")1148end sub114911501151