Path: blob/main/Scripts/R6/PoleTrigger.txt
1319 views
//---------------Sonic CD Pole Trigger Script-----------------//1//--------Scripted by Christian Whitehead 'The Taxman'--------//2//-------Unpacked By Rubberduckycooly's Script Unpacker-------//34// Aliases5#alias Object.Value0 : Object.CollisionTop6#alias Object.Value1 : Object.CollisionBottom7#alias Object.Value2 : Object.Angle8#alias Object.Value3 : Object.JumpCheck910// States11#alias 0 : POLETRIGGER_IDLE12#alias 1 : POLETRIGGER_PLAYER_ROT131415sub ObjectPlayerInteraction16if Object.State == POLETRIGGER_IDLE17PlayerObjectCollision(C_TOUCH, -4, Object.CollisionTop, 4, Object.CollisionBottom)18if CheckResult == true19if Player.State != Player_State_Hurt20Object.State = POLETRIGGER_PLAYER_ROT21Object.JumpCheck = false2223Player.State = Player_State_Static24Player.Animation = ANI_JUMPING25Player.XPos = Object.XPos26Player.XVelocity = 027Player.Speed = 028Player.DrawOrder = 52930if Player.YVelocity > 031Player.YVelocity = 0x2000032else33Player.YVelocity = -0x2000034end if35end if36end if37else38if Player.State == Player_State_Static39if Player.JumpPress == true40Object.JumpCheck = true41end if4243Object.Angle += 1644Object.Angle &= 51145Sin(Player.XPos, Object.Angle)46Player.XPos *= -0xC0047Player.XPos += Object.XPos4849Player.DrawOrder = 450if Object.Angle < 12951Player.DrawOrder = 552end if53if Object.Angle > 38354Player.DrawOrder = 555end if5657TempValue0 = Player.YPos58TempValue0 -= Object.YPos59TempValue0 >>= 1660if TempValue0 < 061if TempValue0 < Object.CollisionTop62Player.YVelocity = 0x2000063end if64else65if TempValue0 > Object.CollisionBottom66Player.YVelocity = -0x2000067end if68end if6970if Object.JumpCheck == true71if Object.Angle == 12872Player.DrawOrder = 47374#platform: Use_Origins75Player.State = Player_State_Air_NoDropDash76#endplatform7778#platform: Use_Standalone79Player.State = Player_State_Air80#endplatform8182Player.Speed = -0xC000083Player.XVelocity = -0xC000084Object.State = POLETRIGGER_IDLE85end if8687if Object.Angle == 38488Player.DrawOrder = 48990#platform: Use_Origins91Player.State = Player_State_Air_NoDropDash92#endplatform9394#platform: Use_Standalone95Player.State = Player_State_Air96#endplatform9798Player.Speed = 0xC000099Player.XVelocity = 0xC0000100Object.State = POLETRIGGER_IDLE101end if102end if103else104if Player.DrawOrder == 5105Player.DrawOrder = 4106end if107Object.State = POLETRIGGER_IDLE108end if109end if110end sub111112113sub ObjectStartup114ArrayPos0 = 32115while ArrayPos0 < 1056116if Object[ArrayPos0].Type == TypeName[Pole Trigger]117ArrayPos1 = ArrayPos0118ArrayPos1++119Object[ArrayPos0].CollisionTop = Object[ArrayPos0].PropertyValue120Object[ArrayPos0].CollisionTop <<= 3121Object[ArrayPos0].CollisionBottom = Object[ArrayPos0].CollisionTop122FlipSign(Object[ArrayPos0].CollisionTop)123Object[ArrayPos0].CollisionTop -= 8124Object[ArrayPos0].CollisionBottom += 8125end if126ArrayPos0++127loop128end sub129130131// ========================132// Editor Subs133// ========================134135sub RSDKDraw136DrawSprite(0)137if Editor.ShowGizmos == true138Editor.DrawingOverlay = true139TempValue0 = Object.XPos140TempValue0 -= 0x40000141TempValue1 = Object.PropertyValue142TempValue1 <<= 3143TempValue2 = TempValue1144FlipSign(TempValue1)145TempValue1 -= 8146TempValue2 += 8147TempValue2 *= 2148TempValue1 <<= 16149TempValue1 += Object.YPos150DrawRectOutline(TempValue0, TempValue1, 8, TempValue2, 255, 255, 0, 255)151Editor.DrawingOverlay = false152end if153end sub154155156sub RSDKLoad157LoadSpriteSheet("Players/Sonic1.gif")158SpriteFrame(-16, -16, 32, 32, 75, 118) // #0 - Sonic spin159160SetVariableAlias(ALIAS_VAR_PROPVAL, "verticalLength")161end sub162163164