Path: blob/main/Scripts/Global/GoalPost.txt
1319 views
//-----------------Sonic CD Goal Post Script------------------//1//--------Scripted by Christian Whitehead 'The Taxman'--------//2//-------Unpacked By Rubberduckycooly's Script Unpacker-------//34// States5#alias 0 : GOALPOST_IDLE6#alias 1 : GOALPOST_BLANK78// Warp Destination9#alias 0 : WARPDEST_NONE1011// Property Values12#alias 1 : UPPERGOAL1314// Player15#alias 0 : PLAYER_SONIC_A16#alias 1 : PLAYER_TAILS_A171819sub ObjectMain20if Object.State == GOALPOST_IDLE21TempValue0 = Object.YPos22TempValue0 += 0x6000002324if Player.YPos < TempValue025if Player.XPos > Object.XPos26// Block the player from going back into the stage, reset time warps27Stage.NewXBoundary1 = Object.XPos28Stage.NewXBoundary1 >>= 1629Stage.NewXBoundary1 -= 1603031Warp.Destination = WARPDEST_NONE32Warp.Timer = 03334Object.State = GOALPOST_BLANK3536if Object.PropertyValue == UPPERGOAL37PlayerObjectCollision(C_TOUCH, -32, -256, 32, 16)38if CheckResult == true39// Take The High Road Unlock Criteria40if Stage.PlayerListPos == PLAYER_SONIC_A // PLAYER_SONIC in Origins41if Stage.DebugMode == false42SetAchievement(3, 100)43end if44end if45end if46end if47end if48end if49end if50end sub515253sub ObjectDraw54DrawSprite(0)55end sub565758sub ObjectStartup59if Stage.PlayerListPos == PLAYER_SONIC_A // PLAYER_SONIC in origins60LoadSpriteSheet("Global/Items2.gif")61end if62if Stage.PlayerListPos == PLAYER_TAILS_A // PLAYER_TAILS in origins63LoadSpriteSheet("Global/Items2_t.gif")64end if65#platform: Use_Origins66if Stage.PlayerListPos == PLAYER_KNUCKLES67LoadSpriteSheet("Global/Items2_k.gif")68end if69if Stage.PlayerListPos == PLAYER_AMY70LoadSpriteSheet("Global/Items2_a.gif")71end if72#endplatform73SpriteFrame(-20, -44, 40, 56, 34, 165) // #0 - Goal Post74end sub757677// ========================78// Editor Subs79// ========================8081sub RSDKEdit82if Editor.ReturnVariable == true83switch Editor.VariableID84case EDIT_VAR_PROPVAL // Property Value85CheckResult = Object.PropertyValue86break87case 0 // AwardAchievement88CheckResult = Object.PropertyValue89break90end switch91else92switch Editor.VariableID93case EDIT_VAR_PROPVAL // Property Value94Object.PropertyValue = Editor.VariableValue95break96case 0 // AwardAchievement97Object.PropertyValue = Editor.VariableValue98break99end switch100end if101end sub102103104sub RSDKDraw105DrawSprite(0)106end sub107108109sub RSDKLoad110LoadSpriteSheet("Global/Items2.gif")111SpriteFrame(-20, -44, 40, 56, 34, 165) // #0 - Goal Post112113AddEditorVariable("AwardAchievement")114SetActiveVariable("AwardAchievement")115AddEnumVariable("false", false)116AddEnumVariable("true", true)117end sub118119120