Path: blob/master/Sonic 1/Scripts/Title/Start.txt
1480 views
// ----------------------------------1// RSDK Project: Sonic 12// Script Description: Start Message Object3// Script Author: Christian Whitehead/Simon Thomley4// Unpacked by Rubberduckycooly's script unpacker5// ----------------------------------67// ========================8// Aliases9// ========================1011private alias object.value0 : object.timer12// Not sure why it skips from 0 to 4, guess there must've been a revision or smth13private alias object.value4 : object.attractTimer1415private alias 0 : START_FLASH16private alias 1 : START_STARTGAME17private alias 2 : START_STARTLVLSEL18private alias 3 : START_STARTLVLSEL_OLD19private alias 4 : START_STARTATTRACT20private alias 5 : START_NOTIFYCALLBACK21private alias 6 : START_WAITFORCALLBACK22private alias 7 : START_FADETOEXIT23private alias 8 : START_EXIT242526// ========================27// Events28// ========================2930event ObjectUpdate31switch object.state32case START_FLASH33CheckTouchRect(0, 0, screen.xsize, screen.ysize)3435#platform: USE_STANDALONE36if keyPress[0].start == true37checkResult = true38end if3940if keyPress[0].buttonA == true41checkResult = true42end if43#endplatform4445if keyPress[0].buttonB == true46checkResult = true47end if4849#platform: USE_STANDALONE50if keyPress[0].buttonC == true51checkResult = true52end if53#endplatform5455#platform: USE_ORIGINS56if keyPress[0].start == true57checkResult = true58end if5960if keyPress[0].buttonA == true61checkResult = true62end if6364if input.pressButton == true65checkResult = true66end if67#endplatform6869if checkResult > -170#platform: USE_STANDALONE71if options.stageSelectFlag == true72if checkResult > 0 // This is a fancy way of seeing if two (or more) fingers are on the screen73object.state = START_STARTLVLSEL74else75object.state = START_STARTGAME76end if77else78object.state = START_STARTGAME79end if8081PlaySfx(SfxName[Menu Select], false)82StopMusic()83#endplatform8485#platform: USE_ORIGINS86if options.stageSelectFlag == true87if checkResult > 088object.state = START_STARTLVLSEL89StopMusic()90else91object.state = START_NOTIFYCALLBACK92end if93else94if keyPress[0].buttonB == true95CallNativeFunction2(NotifyCallback, NOTIFY_BACK_TO_MAINMENU, 1)96else97object.state = START_NOTIFYCALLBACK98end if99end if100#endplatform101else102object.attractTimer++103if object.attractTimer == 360104object.state = START_STARTATTRACT105end if106end if107break108109case START_STARTGAME110object.timer += 8111if object.timer == 320112options.attractMode = false113player.lives = 3114player.continues = 0115player.score = 0116player.scoreBonus = 50000117lampPostID = 0118specialStage.listPos = 0119specialStage.emeralds = 0120specialStage.nextZone = 0121122// New Game - to GHZ1 you go!123stage.activeList = REGULAR_STAGE124stage.listPos = 0125#platform: USE_ORIGINS126recWaterState = 0127recWaterLevel = 0128recMilliSeconds = 0129recRing = 0130recScore = 0131#endplatform132133LoadStage()134end if135SetScreenFade(0x00, 0x00, 0x00, object.timer)136break137138case START_STARTLVLSEL139object.timer += 8140if object.timer == 320141options.attractMode = false142player.lives = 3143player.continues = 0144player.score = 0145player.scoreBonus = 50000146lampPostID = 0147specialStage.listPos = 0148specialStage.emeralds = 0149specialStage.nextZone = 0150151// Level Select!!152stage.activeList = PRESENTATION_STAGE153stage.listPos = 5154155LoadStage()156end if157SetScreenFade(0, 0, 0, object.timer)158break159160case START_STARTLVLSEL_OLD // Unused state161object.timer += 8162if object.timer == 320163// The Continue scene...?164// This state seems to be a leftover from CD, where its level select code was pretty much the same as this, including going to stage list pos 4165options.attractMode = false166stage.listPos = 4167LoadStage()168end if169SetScreenFade(0, 0, 0, object.timer)170break171172case START_STARTATTRACT173object.timer += 8174if object.timer == 320175player.lives = 3176player.continues = 0177player.score = 0178player.scoreBonus = 50000179lampPostID = 0180specialStage.listPos = 0181specialStage.emeralds = 0182specialStage.nextZone = 0183184if attract.stage == 3185stage.activeList = SPECIAL_STAGE186stage.listPos = 0187else188stage.activeList = REGULAR_STAGE189stage.listPos = attract.stage190stage.listPos *= 3191end if192attract.stage++193attract.stage &= 3194195options.attractMode = true196credits.screen = 0197#platform: USE_ORIGINS198if stage.playerListPos == PLAYER_AMY199stage.playerListPos = PLAYER_SONIC200end if201#endplatform202203LoadStage()204end if205SetScreenFade(0x00, 0x00, 0x00, object.timer)206break207208#platform:USE_ORIGINS209case START_NOTIFYCALLBACK210game.continueFlag = false211game.callbackResult = -1212if game.playMode == BOOT_PLAYMODE_CLASSIC213CallNativeFunction2(NotifyCallback, NOTIFY_CHARACTER_SELECT, true)214else215CallNativeFunction2(NotifyCallback, NOTIFY_CHARACTER_SELECT, false)216end if217object.state = START_WAITFORCALLBACK218break219220case START_WAITFORCALLBACK221if game.callbackResult > 0222if game.continueFlag != false223game.continueFlag = false224object.state = START_FADETOEXIT225else226object.state = START_STARTGAME227end if228object.timer = 0229StopMusic()230else231if game.callbackResult == 0232object.state = START_FLASH233end if234end if235break236237case START_FADETOEXIT238object.timer += 4239if object.timer >= 384240object.state = START_EXIT241end if242SetScreenFade(0, 0, 0, object.timer)243break244245case START_EXIT246engine.state = RESET_GAME247SetScreenFade(0, 0, 0, 255)248break249#endplatform250251end switch252end event253254255event ObjectDraw256object.animationTimer++257if object.animationTimer > 59258object.animationTimer = 0259end if260261if object.animationTimer > 29262DrawSpriteScreenXY(0, object.xpos, object.ypos)263end if264end event265266267event ObjectStartup268#platform: USE_ORIGINS269CallNativeFunction2(NotifyCallback, NOTIFY_LEVEL_SELECT_MENU, false)270#endplatform271272LoadSpriteSheet("Title/Title.gif")273274// In the original S1 releases this was instead a engine.language switch for different languages, although all cases led to the same path275276switch engine.deviceType277case STANDARD278SpriteFrame(-48, -4, 96, 8, 1, 283)279break280281case MOBILE282SpriteFrame(-56, -4, 112, 8, 1, 292)283break284285end switch286end event287288289// ========================290// Editor Events291// ========================292293event RSDKDraw294DrawSprite(0)295end event296297298event RSDKLoad299LoadSpriteSheet("Title/Title.gif")300SpriteFrame(-48, -4, 96, 8, 1, 283)301302SetVariableAlias(ALIAS_VAR_PROPVAL, "unused")303end event304305