Path: blob/main/Scripts/R6/Launcher.txt
1319 views
//------------------Sonic CD Launcher 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.XOriginPos78// States9#alias 0 : LAUNCHER_IDLE10#alias 1 : LAUNCHER_DASH11#alias 2 : LAUNCHER_EJECT_PLAYER12#alias 3 : LAUNCHER_RECOIL13#alias 4 : LAUNCHER_RESET1415// Collision Sides16#alias 0 : CSIDE_FLOOR1718// Priority19#alias 0 : PRIORITY_BOUNDS20#alias 1 : PRIORITY_ACTIVE2122// Gravity23#alias 1 : GRAVITY_AIR2425// Stage SFX26#alias 6 : SFX_S_LAUNCHER272829sub ObjectMain30if Player.State != Player_State_Static31Object.State = LAUNCHER_IDLE32Object.Timer = 033end if3435switch Object.State36case LAUNCHER_DASH37Object.XPos += 0xC000038Player.XPos = Object.XPos3940Player.iYPos = Player.CollisionBottom41FlipSign(Player.YPos)42Player.YPos -= 0x3000043Player.YPos += Object.YPos4445ObjectTileGrip(CSIDE_FLOOR, 32, 4, 0)46if CheckResult == false47Object.State++48end if49break5051case LAUNCHER_EJECT_PLAYER52Player.XPos += 0xC00005354Player.iYPos = Player.CollisionBottom55FlipSign(Player.YPos)56Player.YPos -= 0x3000057Player.YPos += Object.YPos58Object.State++59break6061case LAUNCHER_RECOIL62if Object.Timer == 063Player.XPos += 0xC000064end if6566#platform: Use_Origins67Player.State = Player_State_Air_NoDropDash68#endplatform6970#platform: Use_Standalone71Player.State = Player_State_Air72#endplatform7374Player.Animation = ANI_WALKING7576Player.Speed = 0xC200077Player.XVelocity = 0xC20007879Player.iYPos = Player.CollisionBottom80FlipSign(Player.YPos)81Player.YPos -= 0x3000082Player.YPos += Object.YPos8384if Object.Timer < 285Object.Timer++86else87Object.State++88end if8990Object.XPos -= 0x4000091if Object.XPos < Object.XOriginPos92Object.XPos = Object.XOriginPos93Object.Priority = PRIORITY_BOUNDS94Object.State = LAUNCHER_IDLE95end if9697if Object.OutOfBounds == true98Object.XPos = Object.XOriginPos99Object.Priority = PRIORITY_BOUNDS100Object.State = LAUNCHER_IDLE101end if102break103104case LAUNCHER_RESET105Object.XPos -= 0x40000106if Object.XPos < Object.XOriginPos107Object.XPos = Object.XOriginPos108Object.Priority = PRIORITY_BOUNDS109Object.State = LAUNCHER_IDLE110end if111112if Object.OutOfBounds == true113Object.XPos = Object.XOriginPos114Object.Priority = PRIORITY_BOUNDS115Object.State = LAUNCHER_IDLE116end if117break118end switch119end sub120121122sub ObjectPlayerInteraction123if Object.State == LAUNCHER_IDLE124PlayerObjectCollision(C_BOX, -24, -26, -18, 4)125PlayerObjectCollision(C_TOUCH, -20, -16, 20, 4)126if CheckResult == true127Object.State = LAUNCHER_DASH128Player.State = Player_State_Static129130Player.Animation = ANI_LAUNCHER131Player.Direction = FACING_RIGHT132133Player.XPos = Object.XPos134Player.iYPos = Player.CollisionBottom135FlipSign(Player.YPos)136Player.YPos -= 0x30000137Player.YPos += Object.YPos138139Player.YVelocity = 0140141Object.Priority = PRIORITY_ACTIVE142143Player.TrackScroll = false144Player.Gravity = GRAVITY_AIR145146PlayStageSfx(SFX_S_LAUNCHER, false)147148#platform: Use_Haptics149HapticEffect(30, 0, 0, 0)150#endplatform151152end if153end if154end sub155156157sub ObjectDraw158DrawSprite(0)159end sub160161162sub ObjectStartup163LoadSpriteSheet("R6/Objects.gif")164165SpriteFrame(-28, -28, 56, 32, 83, 1) // #0 - Launcher166167ArrayPos0 = 32168while ArrayPos0 < 1056169if Object[ArrayPos0].Type == TypeName[Launcher]170Object[ArrayPos0].XOriginPos = Object[ArrayPos0].XPos171Object[ArrayPos0].DrawOrder = 4172end if173ArrayPos0++174loop175end sub176177178// ========================179// Editor Subs180// ========================181182sub RSDKDraw183DrawSprite(0)184end sub185186187sub RSDKLoad188LoadSpriteSheet("R6/Objects.gif")189190SpriteFrame(-28, -28, 56, 32, 83, 1) // #0 - Launcher191192SetVariableAlias(ALIAS_VAR_PROPVAL, "unused")193end sub194195196