Path: blob/master/Sonic 1/Scripts/Global/SuperSpark.txt
1482 views
// ----------------------------------1// RSDK Project: Sonic 12// Script Description: Super Spark Object3// Script Author: Christian Whitehead/Simon Thomley4// Unpacked by Rubberduckycooly's script unpacker5// ----------------------------------67// ========================8// Aliases9// ========================1011private alias object.propertyValue : object.isChild12private alias object.value0 : object.timer1314private alias 0 : SUPERSPARK_SETUP15private alias 1 : SUPERSPARK_ANIMATE116private alias 2 : SUPERSPARK_ANIMATE217private alias 3 : SUPERSPARK_DELAY18private alias 4 : SUPERSPARK_FINISHED1920// Player Aliases21private alias object.xpos : player.xpos22private alias object.ypos : player.ypos23private alias object.speed : player.speed24private alias object.value18 : player.sortedDrawOrder25private alias object.value42 : player.prevGravity2627private alias -1 : DRAWORDER_PLAYER282930// ========================31// Events32// ========================3334event ObjectUpdate35if object.isChild == false36object.xpos = player[-playerCount].xpos37object.ypos = player[-playerCount].ypos38end if3940switch object.state41case SUPERSPARK_SETUP42if player[-playerCount].prevGravity == GRAVITY_GROUND43temp0 = player[-playerCount].speed44Abs(temp0)4546if temp0 >= 0x8000047object.drawOrder = DRAWORDER_PLAYER48object.timer = 049object.frame = 050object.state++51end if52end if53break5455case SUPERSPARK_ANIMATE1 // play the 3 frames in order56object.timer++57if object.timer >= 358object.timer = 159object.frame++60if object.frame >= 261object.state++62end if63end if64break6566case SUPERSPARK_ANIMATE2 // then, play the 3 frames in reverse67object.timer++68if object.timer >= 369object.timer = 170object.frame--71if object.frame <= 072object.state++73end if74end if75break7677case SUPERSPARK_DELAY78object.timer++79if object.timer >= 380object.timer = 981object.state++82end if83break8485case SUPERSPARK_FINISHED86if object.isChild == true87object.type = TypeName[Blank Object]88end if8990object.timer++91if object.timer >= 1392temp0 = player[-playerCount].speed93Abs(temp0)94CheckLower(temp0, 0x80000)95temp0 = checkResult96CheckEqual(player[-playerCount].prevGravity, 0)97temp0 &= checkResult9899if temp0 == true100object.state = SUPERSPARK_SETUP101else102object.timer = 0103CreateTempObject(TypeName[Super Spark], true, player[-playerCount].xpos, player[-playerCount].ypos)104object[tempObjectPos].frame = 0105object[tempObjectPos].state = SUPERSPARK_ANIMATE1106object[tempObjectPos].drawOrder = player[-playerCount].sortedDrawOrder107end if108end if109break110111end switch112end event113114115event ObjectDraw116switch object.state117default118case SUPERSPARK_SETUP119case SUPERSPARK_FINISHED120break121122case SUPERSPARK_ANIMATE1123case SUPERSPARK_ANIMATE2124case SUPERSPARK_DELAY125DrawSprite(object.frame)126break127128end switch129end event130131132event ObjectStartup133LoadSpriteSheet("Global/Items3.gif")134SpriteFrame(-8, -8, 16, 16, 168, 158)135SpriteFrame(-16, -16, 32, 32, 50, 223)136SpriteFrame(-24, -24, 48, 48, 1, 207)137end event138139140// ========================141// Editor Events142// ========================143144event RSDKDraw145DrawSprite(0)146end event147148149event RSDKLoad150LoadSpriteSheet("Global/Items3.gif")151SpriteFrame(-16, -16, 32, 32, 50, 223)152153// Although used by the object, it shouldn't be set by the editor154SetVariableAlias(ALIAS_VAR_PROPVAL, "unused")155end event156157158