Path: blob/main/Scripts/R5/BossSpark.txt
1319 views
//-----------------Sonic CD Boss Spark Script-----------------//1//--------Scripted by Christian Whitehead 'The Taxman'--------//2//-------Unpacked By Rubberduckycooly's Script Unpacker-------//34// Aliases5#alias Object.Value0 : Object.Timer6#alias Object.Value1 : Object.XVelocity7#alias Object.Value2 : Object.YVelocity89#alias 0 : BOSSSPARK_GRIND10#alias 1 : BOSSSPARK_LAND111213sub ObjectMain1415// Have a horizontal deceleration value of 0.125 pixels per frame16Object.XVelocity -= 0x20001718// Enforce a maximum left velocity of 3 pixels per frame19if Object.XVelocity < -0x3000020Object.XVelocity = -0x3000021end if2223// Update X movement24Object.XPos += Object.XVelocity2526if Object.PropertyValue == BOSSSPARK_LAND2728// Move the Spark down by 0.125 pixels29Object.YVelocity += 0x20003031// Update the Spark's Y Position32Object.YPos += Object.YVelocity3334// Unload when no longer needed35if Object.OutOfBounds == true36Object.Type = TypeName[Blank Object]37end if3839else40// For a grinding-generated Spark, just show for around half a second and disappear after that4142if Object.Timer < 3643Object.Timer++44else45Object.Type = TypeName[Blank Object]46end if4748end if4950end sub515253sub ObjectDraw5455TempValue0 = Object.Frame56TempValue0 >>= 25758DrawSprite(TempValue0)5960// Object animation is progressed here61Object.Frame++62Object.Frame %= 206364end sub656667sub ObjectStartup68LoadSpriteSheet("R5/Objects2.gif")6970// Boss Spark Frames71// Their offset isn't in the center, these sprites are actually offset to the left a bit72SpriteFrame(-2, -4, 16, 8, 131, 155)73SpriteFrame(-2, -4, 16, 8, 131, 164)74SpriteFrame(-2, -4, 16, 8, 131, 173)75SpriteFrame(-2, -4, 16, 8, 131, 182)76SpriteFrame(-2, -4, 16, 8, 148, 182)7778end sub798081// ========================82// Editor Subs83// ========================8485sub RSDKDraw86DrawSprite(0)87end sub888990sub RSDKLoad91LoadSpriteSheet("R5/Objects2.gif")92SpriteFrame(-2, -4, 16, 8, 131, 155)9394// Although used by the object, it shouldn't be set from the editor95SetVariableAlias(ALIAS_VAR_PROPVAL, "unused")96end sub979899