Path: blob/main/Scripts/Global/LoseRing.txt
1319 views
//----------------Sonic CD Lose Ring Script-------------------//1//--------Scripted by Christian Whitehead 'The Taxman'--------//2//-------Unpacked By Rubberduckycooly's Script Unpacker-------//34// Aliases5#alias Object.Value0 : Object.XVelocity6#alias Object.Value1 : Object.YVelocity7#alias Object.Value2 : Object.Timer8#alias Object.PropertyValue : Object.CollisionPlane910// Player Aliases11#alias Player.Value0 : Player.Rings1213// Panning14#alias 0 : PAN_RIGHT15#alias 1 : PAN_LEFT1617// Collision Sides18#alias 0 : CSIDE_FLOOR1920// Property Values21#alias 0 : DRAWING_PLANE_A22#alias 1 : DRAWING_PLANE_B2324// Players25#alias 0 : PLAYER_SONIC_A2627// Game Mode Aliases28#alias 2 : MODE_TIMEATTACK293031sub ObjectMain32Object.YVelocity += 0x180033Object.XPos += Object.XVelocity34Object.YPos += Object.YVelocity3536if Object.YVelocity >= 037ObjectTileCollision(CSIDE_FLOOR, 0, 8, 0)3839if CheckResult == true40TempValue0 = Object.YVelocity41TempValue0 >>= 242Object.YVelocity -= TempValue043FlipSign(Object.YVelocity)44if Object.YVelocity > -0x1000045Object.YVelocity = -0x1000046end if47end if48end if4950Object.Timer++51if Object.Timer == 25652Object.Type = TypeName[Blank Object]5354Object.XVelocity = 055Object.YVelocity = 056Object.Timer = 057else58Object.AnimationTimer += Object.AnimationSpeed59if Object.AnimationTimer > 2556061Object.AnimationTimer -= 25662Object.Frame++63if Object.Frame == 86465Object.Frame = 066if Object.AnimationSpeed > 1667Object.AnimationSpeed -= 1668end if69end if70end if71end if72end sub737475sub ObjectPlayerInteraction76if Player.State != Player_State_Hurt77if Player.CollisionPlane == Object.CollisionPlane78PlayerObjectCollision(C_TOUCH, -8, -8, 8, 8)79if CheckResult == true80Object.Type = TypeName[Ring Sparkle]81if Object.CollisionPlane == DRAWING_PLANE_A82Object.DrawOrder = 483else84Object.DrawOrder = 285end if8687Object.XVelocity = 088Object.YVelocity = 08990Object.Timer = 091Object.Frame = 09293Player.Rings++94if Player.Rings > 99995Player.Rings = 99996end if9798if Player.Rings >= Ring.ExtraLife99if Options.GameMode != MODE_TIMEATTACK100101#platform: Use_Origins102if game.coinMode == false103Player.Lives++104else105game.callbackParam0 = 1 // Set the amount of coins to add106EngineCallback(NOTIFY_ADD_COIN)107end if108#endplatform109110#platform: Use_Standalone111Player.Lives++112#endplatform113114Ring.ExtraLife += 100115if Ring.ExtraLife > 300116Ring.ExtraLife = 1000117end if118end if119120// King of the Rings Unlock Criteria121if Player.Rings >= 200122if Stage.PlayerListPos == PLAYER_SONIC_A // PLAYER_SONIC in origins123if Stage.DebugMode == false124SetAchievement(4, 100)125end if126end if127end if128end if129130if Ring.Pan == PAN_RIGHT131SetSfxAttributes(1, -1, -100)132Ring.Pan = PAN_LEFT133else134SetSfxAttributes(2, -1, 100)135Ring.Pan = PAN_RIGHT136end if137138end if139end if140end if141end sub142143144sub ObjectDraw145DrawSprite(Object.Frame)146end sub147148149sub ObjectStartup150LoadSpriteSheet("Global/Items.gif")151152SpriteFrame(-8, -8, 16, 16, 1, 1) // #0 - Ring Frame 0153SpriteFrame(-8, -8, 16, 16, 1, 18) // #1 - Ring Frame 1154SpriteFrame(-8, -8, 16, 16, 1, 35) // #2 - Ring Frame 2155SpriteFrame(-8, -8, 16, 16, 1, 52) // #3 - Ring Frame 3156SpriteFrame(-8, -8, 16, 16, 1, 69) // #4 - Ring Frame 4157SpriteFrame(-8, -8, 16, 16, 1, 86) // #5 - Ring Frame 5158SpriteFrame(-8, -8, 16, 16, 1, 103) // #6 - Ring Frame 6159SpriteFrame(-8, -8, 16, 16, 1, 120) // #7 - Ring Frame 7160end sub161162163// ========================164// Editor Subs165// ========================166167sub RSDKDraw168DrawSprite(0)169end sub170171172sub RSDKLoad173LoadSpriteSheet("Global/Items.gif")174SpriteFrame(-8, -8, 16, 16, 1, 1) // #0 - Ring Frame 0175176SetVariableAlias(ALIAS_VAR_PROPVAL, "unused")177end sub178179180