Path: blob/main/Scripts/Secrets/TailsUnlock.txt
1319 views
//----------------Sonic CD Tails Unlock Script----------------//1//--------Scripted by Christian Whitehead 'The Taxman'--------//2//-------Unpacked By Rubberduckycooly's Script Unpacker-------//34// Aliases5#alias Object.Value0 : Object.Timer67// States8#alias 0 : TAILSUNLOCK_SETUP9#alias 1 : TAILSUNLOCK_FADE_IN10#alias 2 : TAILSUNLOCK_CONTROL_DELAY11#alias 3 : TAILSUNLOCK_CONTROL_CHECK12#alias 4 : TAILSUNLOCK_EXIT1314// Stage SFX15#alias 41 : SFX_S_EVENT1617// Presentation Stage18#alias 1 : STAGE_P_MENU1920// Engine callbacks21#alias 1 : ENGINE_MAINGAME22#alias 8 : ENGINE_WAIT232425sub ObjectMain26switch Object.State27case TAILSUNLOCK_SETUP28if Object.Timer < 1629// Yield on the black screen for a few moments30Object.Timer++31else32if Stage.DebugMode == false33// Set the All Stages Clear Achievement34SetAchievement(7, 100)35end if3637Object.Timer = 28838Object.State++39end if4041// Solid Black screen42SetScreenFade(0, 0, 0, 255)43break4445case TAILSUNLOCK_FADE_IN46if Object.Timer > 047Object.Timer -= 848else49// Fully faded in now, play the special SFX50PlayStageSfx(SFX_S_EVENT, false)5152Object.State++53end if5455SetScreenFade(0, 0, 0, Object.Timer)56break5758case TAILSUNLOCK_CONTROL_DELAY59if Object.Timer < 6060Object.Timer++61else62Object.Timer = 063Object.State++64end if65break6667case TAILSUNLOCK_CONTROL_CHECK68if KeyPress[0].ButtonA == true69Object.State++70end if7172if KeyPress[0].ButtonB == true73Object.State++74end if7576if KeyPress[0].ButtonC == true77Object.State++78end if7980if KeyPress[0].Start == true81Object.State++82end if8384CheckTouchRect(0, 0, Screen.XSize, Screen.YSize)85if CheckResult > -186Object.State++87end if8889if Object.Timer < 30090Object.Timer++91else92Object.Timer = 093Object.State = TAILSUNLOCK_EXIT94end if95break9697case TAILSUNLOCK_EXIT98if Object.Timer < 28899// Fade the screen out100Object.Timer += 8101else102#platform: Use_Origins103Engine.State = ENGINE_WAIT104#endplatform105106#platform: Use_Decomp107// Actually can we not softlock the game thanks108if Engine.State == ENGINE_WAIT109Engine.State = ENGINE_MAINGAME110Stage.ActiveList = PRESENTATION_STAGE111Stage.ListPos = STAGE_P_MENU112LoadStage()113end if114#endplatform115116#platform: Use_Standalone117// The Player's looked enough at the screen by now, send them back to the Menu118Stage.ActiveList = PRESENTATION_STAGE119Stage.ListPos = STAGE_P_MENU120LoadStage()121#endplatform122end if123124TempValue0 = Object.Timer125if TempValue0 > 255126TempValue0 = 255127end if128SetScreenFade(0, 0, 0, TempValue0)129break130131end switch132end sub133134135sub ObjectDraw136137// The scene doesn't have a background, so draw a black rectangle one here138DrawRect(0, 0, Screen.XSize, Screen.YSize, 0, 0, 0, 255)139140// And then draw the actual See You Next Game sprite141DrawSpriteScreenXY(0, Screen.CenterX, Screen.CenterY)142143end sub144145146sub ObjectStartup147LoadSpriteSheet("Secrets/SecretImages.gif")148149SpriteFrame(-117, -36, 234, 64, 0, 900) // #0 - See You Next Game150end sub151152153// ========================154// Editor Subs155// ========================156157sub RSDKDraw158DrawSprite(0)159end sub160161162sub RSDKLoad163LoadSpriteSheet("Secrets/SecretImages.gif")164SpriteFrame(-117, -36, 234, 64, 0, 900) // #0 - See You Next Game165166SetVariableAlias(ALIAS_VAR_PROPVAL, "unused")167end sub168169170