Path: blob/main/Scripts/R1/BouncePole.txt
1319 views
//-----------------Sonic CD Bounce Pole Script----------------//1//--------Scripted by Christian Whitehead 'The Taxman'--------//2//-------Unpacked By Rubberduckycooly's Script Unpacker-------//34// Aliases5#alias Object.Value0 : Object.FrameTimer67// Gravity8#alias 1 : GRAVITY_AIR910// Not directly used, but added for documentation purposes11#alias 0 : DIRECTION_RIGHT12#alias 1 : DIRECTION_LEFT131415sub ObjectPlayerInteraction16// Check:17// Collision with object18// Player is in the air19// The vertical momentum goes downwards20PlayerObjectCollision(C_TOUCH, -16, -8, 16, 8)21if CheckResult == true22if Player.Gravity == GRAVITY_AIR23if Player.YVelocity > 02425#platform: Use_Origins26Player.State = Player_State_Air_NoDropDash27#endplatform2829#platform: Use_Standalone30Player.State = Player_State_Air31#endplatform32Player.Timer = 033Player.Animation = ANI_JUMPING34FlipSign(Player.YVelocity)35Player.YVelocity -= 0x200003637// Vertical velocity cap38if Player.YVelocity < -0xA000039Player.YVelocity = -0xA000040end if4142Object.Frame = 1 // Start bounce pole animation43end if44end if45end if46end sub474849sub ObjectDraw50Object.Direction = Object.PropertyValue51DrawSpriteFX(Object.Frame, FX_FLIP, Object.XPos, Object.YPos)52if Object.Frame > 05354Object.FrameTimer++55if Object.FrameTimer == 356Object.FrameTimer = 05758Object.Frame++59if Object.Frame > 2060Object.Frame = 061end if62end if63end if64end sub656667sub ObjectStartup68LoadSpriteSheet("R1/Objects.gif")6970SpriteFrame(-16, -8, 32, 16, 190, 34) // #0 - Bounce Pole Still7172SpriteFrame(-16, -8, 32, 16, 190, 34) // #1 - Bounce Pole Bounce Frame 073SpriteFrame(-16, -8, 32, 20, 190, 80) // #2 - Bounce Pole Bounce Frame 174SpriteFrame(-16, -8, 32, 16, 190, 34) // #3 - Bounce Pole Bounce Frame 275SpriteFrame(-16, -20, 32, 28, 190, 51) // #4 - Bounce Pole Bounce Frame 376SpriteFrame(-16, -8, 32, 16, 190, 34) // #5 - Bounce Pole Bounce Frame 477SpriteFrame(-16, -8, 32, 20, 190, 80) // #6 - Bounce Pole Bounce Frame 578SpriteFrame(-16, -8, 32, 16, 190, 34) // #7 - Bounce Pole Bounce Frame 679SpriteFrame(-16, -8, 32, 16, 190, 34) // #8 - Bounce Pole Bounce Frame 780SpriteFrame(-16, -8, 32, 20, 190, 80) // #9 - Bounce Pole Bounce Frame 881SpriteFrame(-16, -8, 32, 16, 190, 34) // #10 - Bounce Pole Bounce Frame 982SpriteFrame(-16, -20, 32, 28, 190, 51) // #11 - Bounce Pole Bounce Frame 1083SpriteFrame(-16, -8, 32, 16, 190, 34) // #12 - Bounce Pole Bounce Frame 1184SpriteFrame(-16, -8, 32, 20, 190, 80) // #13 - Bounce Pole Bounce Frame 1285SpriteFrame(-16, -8, 32, 16, 190, 34) // #14 - Bounce Pole Bounce Frame 1386SpriteFrame(-16, -8, 32, 16, 190, 34) // #15 - Bounce Pole Bounce Frame 1487SpriteFrame(-16, -8, 32, 20, 190, 80) // #16 - Bounce Pole Bounce Frame 1588SpriteFrame(-16, -8, 32, 16, 190, 34) // #17 - Bounce Pole Bounce Frame 1689SpriteFrame(-16, -20, 32, 28, 190, 51) // #18 - Bounce Pole Bounce Frame 1790SpriteFrame(-16, -8, 32, 16, 190, 34) // #19 - Bounce Pole Bounce Frame 1891SpriteFrame(-16, -8, 32, 20, 190, 80) // #20 - Bounce Pole Bounce Frame 1992end sub939495// ========================96// Editor Subs97// ========================9899sub RSDKEdit100if Editor.ReturnVariable == true101switch Editor.VariableID102case EDIT_VAR_PROPVAL // Property Value103CheckResult = Object.PropertyValue104CheckResult &= 1105break106case 0 // direction107CheckResult = Object.PropertyValue108CheckResult &= 1109break110end switch111else112switch Editor.VariableID113case EDIT_VAR_PROPVAL // Property Value114Object.PropertyValue = Editor.VariableValue115Object.PropertyValue &= 1116break117case 0 // direction118Object.PropertyValue = Editor.VariableValue119Object.PropertyValue &= 1120break121end switch122end if123end sub124125126sub RSDKDraw127Object.Direction = Object.PropertyValue128DrawSpriteFX(0, FX_FLIP, Object.XPos, Object.YPos)129end sub130131132sub RSDKLoad133LoadSpriteSheet("R1/Objects.gif")134135SpriteFrame(-16, -8, 32, 16, 190, 34) // #0 - Bounce Pole Still136137138AddEditorVariable("direction")139SetActiveVariable("direction")140AddEnumVariable("Right", 0)141AddEnumVariable("Left", 1)142end sub143144145