Path: blob/master/Sonic 2/Scripts/Title/KLogo.txt
1483 views
// ----------------------------------1// RSDK Project: Sonic 22// Script Description: K Logo Object3// Script Author: Christian Whitehead/Simon Thomley4// Unpacked by Rubberduckycooly's script unpacker5// ----------------------------------67// ========================8// Aliases9// ========================1011private alias object.frame : object.knuxFrame1213private alias object.value0 : object.timer14private alias object.value1 : object.knuxPos.x15private alias object.value2 : object.knuxPos.y16private alias object.value3 : object.levelSelectCheatPos // not used in this script, used in "STLogo_CheckButtonCheatCodes"17private alias object.value4 : object.regionSwitchCheatPos // not used in this script, used in "STLogo_CheckButtonCheatCodes"18private alias object.value5 : object.handFrame19private alias object.value6 : object.handPos.x20private alias object.value7 : object.handPos.y21private alias object.value8 : object.knuxInPos.y2223// States24private alias 0 : KLOGO_SETUP25private alias 1 : KLOGO_FADEIN26private alias 2 : KLOGO_SHOWEMBLEM27private alias 3 : KLOGO_ENTERKNUX28private alias 4 : KLOGO_KNUXANIMATE29private alias 5 : KLOGO_ENTERHAND30private alias 6 : KLOGO_HANDANIMATE31private alias 7 : KLOGO_FINISHHANDANIM32private alias 8 : KLOGO_MOVEKNUXINTOPLACE33private alias 9 : KLOGO_MOVEHAND234private alias 10 : KLOGO_HANDANIMATE235private alias 11 : KLOGO_FINISHHANDANIM236private alias 12 : KLOGO_ENTERKNUXIN37private alias 13 : KLOGO_FINISHEDANIMS3839// ShootingStar Aliases40private alias object.value0 : shootingStar.delay4142// Game Modes43private alias 0 : MODE_NOSAVE444546// ========================47// Events48// ========================4950event ObjectUpdate51if options.gameMode == MODE_NOSAVE52if object.state > KLOGO_SHOWEMBLEM53CallFunction(STLogo_CheckButtonCheatCodes)54end if55end if5657switch object.state58case KLOGO_SETUP59if object.timer == 3060object[+1].type = TypeName[Twinkle Stars]61object[+1].priority = PRIORITY_ACTIVE62end if6364if object.timer < 6065object.timer++66else67object.timer = 068object.alpha = 25669stage.player2Enabled = false70object.state++71end if72break7374case KLOGO_FADEIN75if object.alpha > 076object.alpha -= 877else78object.state++79end if80break8182case KLOGO_SHOWEMBLEM83if object.timer < 3284object.timer++85else86object.timer = 087object.knuxPos.x = -0x2C000088object.knuxPos.x += object.xpos89object.knuxPos.y = -0x16000090object.knuxPos.y += object.ypos91object.knuxFrame = 292PlayMusic(0)93object.state++94end if95break9697case KLOGO_ENTERKNUX98object.knuxPos.y -= 0x8000099if object.knuxPos.y <= 0x1A0000100object.state++101end if102103if object.knuxPos.y == 0x3A0000104object.knuxFrame++105object.handFrame = 8106object.handPos.x = -0x2C0000107object.handPos.x += object.xpos108object.handPos.y = -0x2E0000109object.handPos.y += object.ypos110end if111break112113case KLOGO_KNUXANIMATE114object.timer++115if object.timer == 8116object.knuxFrame++117if object.knuxFrame >= 7118object.knuxFrame = 7119object.state++120end if121object.timer = 0122end if123break124125case KLOGO_ENTERHAND126object.handPos.y -= 0x10000127object.timer++128if object.timer == 4129object.timer = 0130object.state++131end if132break133134case KLOGO_HANDANIMATE135object.timer++136if object.timer == 4137object.timer = 0138object.handFrame++139if object.handFrame == 13140object.handFrame = 8141object.state++142end if143end if144break145146case KLOGO_FINISHHANDANIM147object.handPos.y += 0x10000148149object.timer++150if object.timer == 4151object.timer = 0152object.state++153end if154break155156case KLOGO_MOVEKNUXINTOPLACE157object.yvel += 0x4000158object.ypos += object.yvel159160object.knuxPos.y += object.yvel161object.handPos.y += object.yvel162if object.yvel > 0163if object.ypos >= 0x900000164object.yvel >>= 1165temp0 = object.yvel166temp0 >>= 1167object.yvel += temp0168object.timer++169if object.timer != 3170FlipSign(object.yvel)171else172object.timer = 0173object.yvel = 0174stage.activeLayer[0] = 2 // Show Title BG175object.alpha = 0x100176object.state++177end if178end if179end if180break181182case KLOGO_MOVEHAND2183object.handPos.y -= 0x10000184185object.timer++186if object.timer == 4187object.timer = 0188object.state++189end if190191if object.alpha > 0192object.alpha -= 12193end if194break195196case KLOGO_HANDANIMATE2197object.timer++198if object.timer == 4199object.timer = 0200object.handFrame++201if object.handFrame == 13202object.handFrame = 8203object.state++204end if205end if206207if object.alpha > 0208object.alpha -= 12209end if210break211212case KLOGO_FINISHHANDANIM2213if object.timer < 4214object.handPos.y += 0x10000215216object.timer++217if object.alpha > 0218object.alpha -= 12219end if220else221if object.alpha > 0222object.alpha -= 12223else224object.timer = 0225object.state++226227object[+1].type = TypeName[Start Message]228object[+1].priority = PRIORITY_ACTIVE229object[+1].xpos = screen.xcenter230object[+1].ypos = 200231232CreateTempObject(TypeName[Shooting Star], 0, object.xpos, object.ypos)233object[tempObjectPos].drawOrder = 2234object[tempObjectPos].xpos += 0x1600000235object[tempObjectPos].ypos -= 0x1000000236shootingStar[tempObjectPos].delay = 150237end if238end if239break240241case KLOGO_ENTERKNUXIN242object.yvel += 0x4000243object.knuxInPos.y += object.yvel244245if object.yvel > 0246if object.knuxInPos.y >= 0x5A0000247object.yvel >>= 2248temp0 = object.yvel249temp0 >>= 1250object.yvel += temp0251object.timer++252if object.timer != 2253FlipSign(object.yvel)254else255object.timer = 0256object.yvel = 0257object.state++258end if259end if260end if261262object.animationTimer++263if object.animationTimer > 7264tileLayer[2].deformationOffset++265object.animationTimer = 0266end if267break268269case KLOGO_FINISHEDANIMS270object.animationTimer++271if object.animationTimer > 7272tileLayer[2].deformationOffset++273object.animationTimer = 0274end if275break276277end switch278279temp0 = screen.xcenter280FlipSign(temp0)281temp0 += 256282screen.xoffset = temp0283end event284285286event ObjectDraw287switch object.state288case KLOGO_SETUP289ClearScreen(1)290break291292case KLOGO_FADEIN293ClearScreen(1)294295// Draw Emblem (Top)296DrawSprite(0)297298// Draw Emblem (Bottom)299DrawSprite(1)300301DrawRect(0, 0, screen.xsize, screen.ysize, 0x00, 0x00, 0x00, object.alpha)302break303304case KLOGO_SHOWEMBLEM305ClearScreen(1)306307// Draw Emblem (Top)308DrawSprite(0)309310// Draw Emblem (Bottom)311DrawSprite(1)312break313314case KLOGO_ENTERKNUX315ClearScreen(1)316317// Draw Emblem (Top)318DrawSprite(0)319320// Draw Knux321DrawSpriteXY(object.knuxFrame, object.knuxPos.x, object.knuxPos.y)322323// Draw Emblem (Bottom)324DrawSprite(1)325break326327case KLOGO_KNUXANIMATE328ClearScreen(1)329330// Draw Emblem (Top)331DrawSprite(0)332333// Draw Knux334DrawSpriteXY(object.knuxFrame, object.knuxPos.x, object.knuxPos.y)335if object.knuxFrame >= 7336DrawSpriteXY(object.handFrame, object.handPos.x, object.handPos.y)337end if338339// Draw Emblem (Bottom)340DrawSprite(1)341break342343case KLOGO_ENTERHAND344case KLOGO_HANDANIMATE345case KLOGO_FINISHHANDANIM346case KLOGO_MOVEKNUXINTOPLACE347ClearScreen(1)348349// Draw Emblem (Top)350DrawSprite(0)351352// Draw Knux353DrawSpriteXY(object.knuxFrame, object.knuxPos.x, object.knuxPos.y)354DrawSpriteXY(object.handFrame, object.handPos.x, object.handPos.y)355356// Draw Emblem (Bottom)357DrawSprite(1)358break359360case KLOGO_MOVEHAND2361case KLOGO_HANDANIMATE2362case KLOGO_FINISHHANDANIM2363DrawRect(0, 0, screen.xsize, screen.ysize, 0xE0, 0xE0, 0xE0, object.alpha)364365// Draw Emblem (Top)366DrawSprite(0)367368// Draw Knux369DrawSpriteXY(object.knuxFrame, object.knuxPos.x, object.knuxPos.y)370DrawSpriteXY(object.handFrame, object.handPos.x, object.handPos.y)371372// Draw Emblem (Bottom)373DrawSprite(1)374375temp0 = screen.xsize376temp0 -= 96377DrawSpriteScreenXY(15, temp0, 216)378break379380case KLOGO_ENTERKNUXIN381case KLOGO_FINISHEDANIMS382// Draw Emblem (Top)383DrawSprite(0)384385// Draw Knux386DrawSpriteXY(object.knuxFrame, object.knuxPos.x, object.knuxPos.y)387DrawSpriteXY(object.handFrame, object.handPos.x, object.handPos.y)388389// Draw Emblem (Bottom)390DrawSprite(1)391392// Knux In393DrawSpriteXY(14, object.xpos, object.knuxInPos.y)394395// Copyright396temp0 = screen.xsize397temp0 -= 96398DrawSpriteScreenXY(15, temp0, 216)399break400401end switch402end event403404405event ObjectStartup406LoadSpriteSheet("Title/Title.gif")407SpriteFrame(-128, -78, 256, 82, 255, 67) // Emblem (Top) - #0408SpriteFrame(-128, -8, 256, 87, 255, 150) // Emblem (Bottom) - #1409SpriteFrame(3, 15, 101, 47, 1, 438) // Knux - Frame 1 - #2410SpriteFrame(3, 15, 101, 73, 1, 438) // Knux - Frame 2 - #3411SpriteFrame(0, 9, 95, 79, 103, 432) // Knux - Frame 3 - #4412SpriteFrame(1, 6, 105, 82, 199, 429) // Knux - Frame 4 - #5413SpriteFrame(1, 4, 102, 84, 305, 427) // Knux - Frame 5 - #6414SpriteFrame(5, 2, 91, 86, 408, 425) // Knux - Frame 6 - #7415SpriteFrame(8, 5, 42, 43, 180, 138) // Knux Hand - Frame 1 - #8416SpriteFrame(8, 3, 40, 53, 465, 1) // Knux Hand - Frame 2 - #9417SpriteFrame(8, 8, 40, 39, 149, 182) // Knux Hand - Frame 3 - #10418SpriteFrame(8, 8, 40, 39, 149, 182) // Knux Hand - Frame 4 - #11419SpriteFrame(8, 3, 40, 53, 465, 1) // Knux Hand - Frame 5 - #12420SpriteFrame(8, 5, 42, 43, 180, 138) // Knux Hand - Frame 6 - #13421SpriteFrame(-124, -66, 248, 65, 263, 359) // Knux IN - #14422SpriteFrame(0, 0, 88, 16, 1, 421) // Copyright - #15423end event424425426// ========================427// Editor Events428// ========================429430event RSDKDraw431DrawSprite(0)432DrawSprite(1)433end event434435436event RSDKLoad437LoadSpriteSheet("Title/Title.gif")438SpriteFrame(-128, -78, 256, 82, 255, 67) // Emblem (Top) - #0439SpriteFrame(-128, -8, 256, 87, 255, 150) // Emblem (Bottom) - #1440441SetVariableAlias(ALIAS_VAR_PROPVAL, "unused")442end event443444445