Path: blob/main/Scripts/TitleCards/SS_TitleCard.txt
1319 views
//-----------------Sonic CD Title Card Script-----------------//1//--------Scripted by Christian Whitehead 'The Taxman'--------//2//-------Unpacked By Rubberduckycooly's Script Unpacker-------//34// Aliases5#alias Object.Value0 : Object.BarPos6#alias Object.Value1 : Object.TextPos7#alias Object.Value2 : Object.TextSize8#alias Object.Value3 : Object.Timer9#alias Object.Value4 : Object.FadeR10#alias Object.Value5 : Object.FadeG11#alias Object.Value6 : Object.FadeB12#alias Object.Value7 : Object.CharPos1314// SS Sonic aliases15#alias Player.ControlMode : SSSonic.ControlMode1617// HUD Alias18#alias Object.Value1 : HUD.TimeSeconds19#alias Object.Value2 : HUD.TimeFrames2021// States22#alias 0 : TITLECARD_FADEIN23#alias 1 : TITLECARD_SLIDEIN24#alias 2 : TITLECARD_DISPLAY25#alias 3 : TITLECARD_SLIDEOUT2627// Languages28#alias 0 : LANG_ENGLISH29#alias 1 : LANG_FRENCH30#alias 2 : LANG_ITALIAN31#alias 3 : LANG_DEUTSCH32#alias 4 : LANG_SPANISH33#alias 5 : LANG_JAPANESE3435// ControlMode Aliases36#alias -1 : CONTROLMODE_NONE37#alias 0 : CONTROLMODE_NORMAL3839// Game Mode Aliases40#alias 2 : MODE_TIMEATTACK4142// Priority43#alias 1 : PRIORITY_ACTIVE444546sub ObjectDraw47// Set the starting time values48// (Rather than disabling the HUD timer while the title card is active,49// its values are simply reset here every frame until no longer needed)50HUD[4].TimeSeconds = 10051HUD[4].TimeFrames = 05253switch Object.State54case TITLECARD_FADEIN55if Object.Timer > 056if Object.Timer == 25657// Start the stage music!58PlayMusic(0)5960// Free Sonic's control61// (But, it gets locked again right after anyway...)62SSSonic.ControlMode = CONTROLMODE_NORMAL63end if6465SetScreenFade(Object.FadeR, Object.FadeG, Object.FadeB, Object.Timer)66Object.Timer -= 867else68// Make the Title Card start appearing6970Object.State = TITLECARD_SLIDEIN71Object.Timer = 072end if7374// Lock Sonic's control75SSSonic.ControlMode = CONTROLMODE_NONE76break7778case TITLECARD_SLIDEIN79TempValue0 = 14480TempValue0 += Object.CharPos8182if Object.TextPos > TempValue083// Slide the text to the left84Object.TextPos -= 88586// Now, this part got changed in an update8788else89// -> Updated version - both the text AND the bar have to be on screen for the title card to progress9091if Object.BarPos == 092Object.State = TITLECARD_DISPLAY93end if94end if9596if Object.BarPos < 097// Move the Bar down98Object.BarPos += 899100// There used to be code here in older versions, but not anymore...101// -> Initial version - only the bar needed to be in the proper position for the title card to continue102// This had text get incorrectly often103104end if105break106107case TITLECARD_DISPLAY108// Hold for a moment to let the Player see what a nice Title Card this is109110if Object.Timer == 160111// Time's up, start sliding out!112Object.State = TITLECARD_SLIDEOUT113else114Object.Timer++115end if116break117118case TITLECARD_SLIDEOUT119if Object.TextPos < 408120121// Move the text to the right, and...122Object.TextPos += 16123124// ...move the bar upwards as well125Object.BarPos -= 16126127else128// The Title Card's job is done, despawn it129ResetObjectEntity(20, TypeName[Blank Object], 0, 0, 0)130131// Free Sonic's control, for real this time132SSSonic.ControlMode = CONTROLMODE_NORMAL133134if Options.GameMode == MODE_TIMEATTACK135// If in time attack, start proper time progression136Stage.TimeEnabled = true137end if138end if139break140141end switch142143// Before drawing, make sure this object hasn't been blanked already144// (Under certain circumstances, this can otherwise cause major graphical issues!!)145if Object.Type > TypeName[Blank Object]146TempValue0 = 136147TempValue0 += Object.CharPos148149// Draw the Title Card Bar150DrawSpriteScreenXY(0, TempValue0, Object.BarPos)151152// And then draw the Sonic CD bar and the weird three lines153DrawSpriteScreenXY(5, Object.TextPos, 64)154DrawSpriteScreenXY(6, Object.TextPos, 64)155DrawSpriteScreenXY(7, Object.TextPos, 64)156157#platform: Use_Decomp // Creates a black rectangle that fills the empty space on wider resolutions158TempValue0 = Object.TextPos159TempValue0 += 150160DrawRect(TempValue0, 147, Screen.XSize, 9, 0, 0, 0, 255)161#endplatform162163// And then Draw the Round Name164// (Letters start at Sprite Frame 8)165TempValue0 = 8166while TempValue0 < Object.TextSize167DrawSpriteScreenXY(TempValue0, Object.TextPos, 64)168TempValue0++169loop170end if171172end sub173174175sub ObjectStartup176177// Load different sheets based on the Engine's current language178switch Engine.Language179case LANG_ENGLISH180case LANG_JAPANESE181// LANG_ENGLISH and LANG_JAPANESE share the same sheet182LoadSpriteSheet("Special/ScoreScreen.gif")183break184185case LANG_FRENCH186LoadSpriteSheet("Special/ScoreScreen_FR.gif")187break188189case LANG_ITALIAN190LoadSpriteSheet("Special/ScoreScreen_IT.gif")191break192193case LANG_DEUTSCH194LoadSpriteSheet("Special/ScoreScreen_DE.gif")195break196197case LANG_SPANISH198LoadSpriteSheet("Special/ScoreScreen_ES.gif")199break200201end switch202203// Place the Title Card object into the level and setup its values204Object[20].Type = TypeName[TitleCard]205Object[20].Timer = 384206207// Make the Title Card always active, and have it draw above everything208Object[20].Priority = PRIORITY_ACTIVE209Object[20].DrawOrder = 6210211// Set initial Bar & Text Positions212Object[20].BarPos = -216213Object[20].TextPos = 336214215216Object[20].CharPos = Screen.CenterX217Object[20].CharPos -= 160218219if Object[20].CharPos > 3220Object[20].CharPos -= 4221end if222223Object[20].CharPos &= 248224225Object[20].TextPos += Object[20].CharPos226Object[20].TextPos += Object[20].CharPos227228// "SPECIAL STAGE" is 12 letters229Object[20].TextSize = 12230231// Bump the value by 8 to correspond with the order of the Sprite Frames232Object[20].TextSize += 8233234// Preserve the color used from the last fade. Fade_Colour is stored as RRGGBB, in hex235236Object[20].FadeR = Fade_Colour237Object[20].FadeR >>= 16238239Object[20].FadeG = Fade_Colour240Object[20].FadeG &= 0x00FF00241Object[20].FadeG >>= 8242243Object[20].FadeB = Fade_Colour244Object[20].FadeB &= 0x0000FF245246// 0 - Red Bar Frame247SpriteFrame(0, 0, 32, 184, 224, 37)248249// These next few frames are unused leftovers from the maingame Title Card script250// They appear as garbage sprites here since they use values from the normal Global Display sheet,251// and not the Special Stage version of the sheet252253// 1-3 - Act Bubbles, appear as random texts with this sheet254SpriteFrame(96, 96, 48, 48, 41, 1)255SpriteFrame(96, 96, 48, 48, 90, 1)256SpriteFrame(96, 96, 48, 48, 139, 1)257258// 4 - "Zone" text, appears as part of BG with this sheet though259SpriteFrame(64, 97, 48, 16, 41, 67)260261// All the letters used by the Title Card262// They got updated a bit post-release, we're using the updated version here263264// 5 - Main part of the "SONIC THE HEGDEHOG CD" bar265266// Workaround for steam datafile to show this sprite correctly267#platform: Use_Origins268SpriteFrame(72, 81, 160, 16, 60, 227) // #5 - Sonic The Hedgehog CD269#endplatform270271#platform: Use_Standalone272#platform: Standard273SpriteFrame(64, 81, 160, 16, 52, 227)// #5 - Sonic The Hedgehog CD274#endplatform275#endplatform276277#platform: Use_Standalone278#platform: Mobile279SpriteFrame(72, 81, 160, 16, 60, 227)// #5 - Sonic The Hedgehog CD280#endplatform281#endplatform282283// 6 - Continuation of the Sonic CD bar284SpriteFrame(16, 81, 160, 16, 52, 227)285286// 7 - Set of three lines287SpriteFrame(100, 32, 24, 48, 182, 124)288289// 8-19 - Individual letters spelling out "Special Stage"290SpriteFrame(0, 0, 16, 55, 207, 124) // #8 - S291SpriteFrame(17, 32, 10, 23, 176, 180) // #9 - P292SpriteFrame(28, 32, 9, 23, 187, 180) // #10 - E293SpriteFrame(38, 32, 8, 23, 197, 180) // #11 - C294SpriteFrame(47, 32, 6, 23, 206, 180) // #12 - I295SpriteFrame(54, 32, 11, 23, 212, 180) // #13 - A296SpriteFrame(66, 32, 9, 23, 176, 203) // #14 - L297298SpriteFrame(0, 56, 16, 55, 207, 124) // #15 - S299SpriteFrame(17, 56, 10, 23, 186, 203) // #16 - T300SpriteFrame(28, 56, 11, 23, 212, 180) // #17 - A301SpriteFrame(40, 56, 10, 23, 197, 203) // #18 - G302SpriteFrame(51, 56, 9, 23, 187, 180) // #19 - E303304#platform: Use_Origins305// There aren't any Special Stage missions nor are any of them part of the Boss Rush, so god knows why this code is here306307if game.playMode == BOOT_PLAYMODE_MISSION308TempValue0 = true309else310if game.playMode == BOOT_PLAYMODE_BOSSRUSH311TempValue0 = true312else313TempValue0 = false314end if315end if316317if TempValue0 != false318PlayMusic(0)319320game.missionCondition = 0321game.missionEnd = false322323Player.ControlMode = CONTROLMODE_NORMAL324Stage.TimeEnabled = true325326ResetObjectEntity(20, TypeName[Blank Object], 0, 0, 0)327Warp.XPos = 0328end if329#endplatform330end sub331332333// ========================334// Editor Subs335// ========================336337sub RSDKDraw338Object.TextSize = 12339Object.TextSize += 8340341TempValue0 = 136342TempValue0 += Object.CharPos343TempValue0 <<= 16344345TempValue1 = 0x500000346TempValue1 += Object.YPos347348DrawSpriteXY(0, Object.XPos, Object.YPos)349DrawSpriteXY(5, Object.XPos, TempValue1)350DrawSpriteXY(6, Object.XPos, TempValue1)351DrawSpriteXY(7, Object.XPos, TempValue1)352353TempValue0 = 8354while TempValue0 < Object.TextSize355DrawSpriteXY(TempValue0, Object.XPos, TempValue1)356TempValue0++357loop358end sub359360361sub RSDKLoad362LoadSpriteSheet("Special/ScoreScreen.gif")363// 0 - Red Bar Frame364SpriteFrame(0, 0, 32, 184, 224, 37)365366// 1-3 - Act Bubbles, not used here.367SpriteFrame(96, 96, 48, 48, 41, 1)368SpriteFrame(96, 96, 48, 48, 90, 1)369SpriteFrame(96, 96, 48, 48, 139, 1)370371// 4 - "Zone" text, not used here.372SpriteFrame(64, 97, 48, 16, 41, 67)373374// 5 - Main part of the "SONIC THE HEGDEHOG CD" bar375SpriteFrame(72, 81, 160, 16, 60, 227)376377// 6 - Continuation of the Sonic CD bar378SpriteFrame(16, 81, 160, 16, 52, 227)379380// 7 - Set of three lines381SpriteFrame(100, 32, 24, 48, 182, 124)382383// 8-19 - Individual letters spelling out "Special Stage"384SpriteFrame(0, 0, 16, 55, 207, 124) // #8 - S385SpriteFrame(17, 32, 10, 23, 176, 180) // #9 - P386SpriteFrame(28, 32, 9, 23, 187, 180) // #10 - E387SpriteFrame(38, 32, 8, 23, 197, 180) // #11 - C388SpriteFrame(47, 32, 6, 23, 206, 180) // #12 - I389SpriteFrame(54, 32, 11, 23, 212, 180) // #13 - A390SpriteFrame(66, 32, 9, 23, 176, 203) // #14 - L391392SpriteFrame(0, 56, 16, 55, 207, 124) // #15 - S393SpriteFrame(17, 56, 10, 23, 186, 203) // #16 - T394SpriteFrame(28, 56, 11, 23, 212, 180) // #17 - A395SpriteFrame(40, 56, 10, 23, 197, 203) // #18 - G396SpriteFrame(51, 56, 9, 23, 187, 180) // #19 - E397398SetVariableAlias(ALIAS_VAR_PROPVAL, "unused")399end sub400401402