Path: blob/main/Scripts/R1/SpinTop.txt
1319 views
//----------------Sonic CD Spinning Top Script----------------//1//--------Scripted by Christian Whitehead 'The Taxman'--------//2//-------Unpacked By Rubberduckycooly's Script Unpacker-------//34// Aliases5#alias Object.Value0 : Object.Rotation6#alias Object.Value1 : Object.OnObject78// Player Alias9#alias Player.Value6 : Player.MinRollSpeed1011// Gravity12#alias 0 : GRAVITY_GROUND13#alias 1 : GRAVITY_AIR1415// Stage SFX16#alias 1 : SFX_S_SHOT171819sub ObjectPlayerInteraction20PlayerObjectCollision(C_BOX, -16, -8, 16, 24)21TempValue1 = Object.Rotation // This doesn't do anything...22if CheckResult == true23if Player.State != Player_State_SpinningTop24Player.Speed = 025Object.OnObject = true26Player.MinRollSpeed = 0x10002728if Player.XPos > Object.XPos29Player.Timer = Player.XPos30Player.Timer -= Object.XPos3132Object.Rotation = 12833else34Player.Timer = Object.XPos35Player.Timer -= Player.XPos3637Object.Rotation = 38438end if3940end if4142if Player.XPos > Object.XPos43if Player.Left == true44Player.Timer -= 0x100045end if4647if Player.Right == true48Player.Timer += 0x100049end if50else51if Player.Left == true52Player.Timer += 0x100053end if5455if Player.Right == true56Player.Timer -= 0x100057end if58end if5960Player.State = Player_State_SpinningTop6162Player.Animation = ANI_SPINNING_TOP6364Sin(Player.XPos, Object.Rotation)65Player.XPos *= Player.Timer66Player.XPos >>= 967Player.XPos += Object.XPos6869TempValue0 = Object.Rotation70TempValue0 -= 12871TempValue0 /= 8672Player.Frame = TempValue07374Object.Rotation += 1675if Object.Rotation > 63976Object.Rotation -= 51277end if7879if Player.JumpPress == true80CallFunction(Player_Action_Jump)81Player.Speed = Player.XPos82Player.Speed -= Object.XPos83Player.Speed >>= 28485#platform: Use_Origins86Player.State = Player_State_Air_NoDropDash87#endplatform8889#platform: Use_Standalone90Player.State = Player_State_Air91#endplatform9293Player.Timer = 094PlayStageSfx(SFX_S_SHOT, false)95end if96else97if Object.OnObject == true98if Player.State == Player_State_SpinningTop99if Player.Gravity == GRAVITY_GROUND100Player.State = Player_State_Ground101Object.OnObject = false102Player.Timer = 0103end if104end if105end if106end if107end sub108109110sub ObjectDraw111DrawSprite(Object.Frame)112113TempValue0 = Ring.AniCount114TempValue0 &= 1115116if TempValue0 == 0117Object.Frame++118if Object.Frame > 2119Object.Frame = 0120end if121end if122end sub123124125sub ObjectStartup126LoadSpriteSheet("R1/Objects.gif")127128SpriteFrame(-16, -8, 32, 16, 101, 76) // #0 - Spin Top Frame 0129SpriteFrame(-16, -8, 32, 16, 101, 76) // #1 - Spin Top Frame 1130SpriteFrame(-16, -8, 32, 16, 134, 76) // #2 - Spin Top Frame 2131end sub132133134// ========================135// Editor Subs136// ========================137138sub RSDKDraw139DrawSprite(0)140end sub141142143sub RSDKLoad144LoadSpriteSheet("R1/Objects.gif")145146SpriteFrame(-16, -8, 32, 16, 101, 76) // #0 - Spin Top Frame 0147148SetVariableAlias(ALIAS_VAR_PROPVAL, "unused")149end sub150151152