Path: blob/master/Sonic 2/Scripts/Continue/Continue.txt
1479 views
// ----------------------------------1// RSDK Project: Sonic 22// Script Description: Continue Screen Object3// Script Author: Christian Whitehead/Simon Thomley4// Unpacked by Rubberduckycooly's script unpacker5// ----------------------------------67// ========================8// Aliases9// ========================1011private alias object.value0 : object.timerSeconds12private alias object.value1 : object.timerFrames1314private alias 1 : STATE_COUNTING1516// Continue Setup states17private alias 2 : CONTINUE_DISPLAY18private alias 4 : CONTINUE_RUN19private alias 6 : CONTINUE_TIMEDOUT202122// ========================23// Events24// ========================2526event ObjectUpdate27if object.state == STATE_COUNTING28object.timerFrames--2930if object.timerFrames <= 031if object.timerSeconds == 032// Make this object stop counting33object.state++3435// Tell the main object that time is up36object[+1].state = CONTINUE_TIMEDOUT37else38// Time's not up yet, progress to the next second39object.timerSeconds--40object.timerFrames = 6041end if42end if43end if44end event454647event ObjectDraw48// Draw the constant sprites ("Continue" & stars)49DrawSprite(0)50DrawSprite(1)5152// Draw the countdown53temp0 = object.xpos54temp0 >>= 1655DrawNumbers(2, temp0, 126, object.timerSeconds, 2, 8, true)5657// Draw the continue line of mini-Sonics5859// First find the base X pos to draw them at60temp0 = player.continues61temp1 = temp062temp0 -= 263temp0 *= 2164temp0 >>= 165FlipSign(temp0)66temp0 += screen.xcenter6768// Then get the sprite to use69GetBit(object.frame, oscillation, 4)70object.frame += 127172temp3 = true7374// (temp1 is number of mini-Sonics to draw)75while temp1 > 176temp2 = true7778if temp3 == true79temp3 = false80if object[+1].state >= CONTINUE_RUN81if object[+1].state != CONTINUE_TIMEDOUT82// Don't draw83temp2 = false84end if85else86if object[+1].state > CONTINUE_DISPLAY87// Flash88GetBit(temp2, oscillation, 0)89end if90end if91end if9293if temp2 == true94DrawSpriteScreenXY(object.frame, temp0, 100)95end if9697temp0 += 2198temp1--99loop100end event101102103event ObjectStartup104LoadSpriteSheet("Continue/Objects.gif")105106// #0 - "CONTINUE" text107SpriteFrame(-59, 64, 119, 16, 1, 1)108109// #1 - Stars110SpriteFrame(-21, 128, 41, 9, 1, 42)111112// #2 -> #11 - Numbers113SpriteFrame(0, 0, 8, 11, 1, 52)114SpriteFrame(0, 0, 8, 11, 10, 52)115SpriteFrame(0, 0, 8, 11, 19, 52)116SpriteFrame(0, 0, 8, 11, 28, 52)117SpriteFrame(0, 0, 8, 11, 37, 52)118SpriteFrame(0, 0, 8, 11, 46, 52)119SpriteFrame(0, 0, 8, 11, 55, 52)120SpriteFrame(0, 0, 8, 11, 64, 52)121SpriteFrame(0, 0, 8, 11, 73, 52)122SpriteFrame(0, 0, 8, 11, 82, 52)123124// Character icons are dependant on the main player125switch stage.playerListPos126case PLAYER_SONIC_A127case PLAYER_SONIC_TAILS_A128// #12 -> #13 - Sonic foot tapping129SpriteFrame(-8, -11, 16, 23, 1, 18)130SpriteFrame(-8, -11, 16, 23, 18, 18)131break132133case PLAYER_TAILS_A134// #12 -> #13 - Tails tapping his foot135SpriteFrame(-8, -11, 16, 23, 35, 18)136SpriteFrame(-8, -11, 16, 23, 52, 18)137break138139case PLAYER_KNUCKLES_A140#platform: USE_ORIGINS141case PLAYER_KNUCKLES_TAILS_A142#endplatform143// #12 -> #13 - Knuckles tapping his foot (he has a hole in his feet!)144SpriteFrame(-8, -11, 16, 23, 69, 18)145SpriteFrame(-8, -11, 16, 23, 86, 18)146break147148#platform: USE_ORIGINS149case PLAYER_AMY_A150case PLAYER_AMY_TAILS_A151// #12 -> #13 - Amy tapping her foot152SpriteFrame(-8, -11, 17, 22, 103, 18)153SpriteFrame(-8, -11, 17, 22, 103, 41)154break155#endplatform156end switch157158foreach (TypeName[Continue Screen], arrayPos0, ALL_ENTITIES)159object[arrayPos0].drawOrder = 5160object[arrayPos0].xpos = screen.xcenter161object[arrayPos0].xpos <<= 16162object[arrayPos0].ypos = 0163object[arrayPos0].timerSeconds = 10164object[arrayPos0].timerFrames = 60165next166end event167168169// ========================170// Editor Events171// ========================172173event RSDKDraw174DrawSprite(0)175end event176177178event RSDKLoad179LoadSpriteSheet("Continue/Objects.gif")180SpriteFrame(-59, 64, 119, 16, 1, 1)181182SetVariableAlias(ALIAS_VAR_PROPVAL, "unused")183end event184185186