Path: blob/main/Scripts/R7/InvisibleBarrier.txt
1319 views
//---------------Sonic CD Tails Barrier Script----------------//1//--------Scripted by Christian Whitehead 'The Taxman'--------//2//-------Unpacked By Rubberduckycooly's Script Unpacker-------//34// Aliases56// Player Aliases7#alias 0 : PLAYER_SONIC_A8910sub ObjectPlayerInteraction11// This collision box is only for the first layer12if PathSwap_Flag == 013PlayerObjectCollision(C_TOUCH, -16, -14, 16, 16)1415if CheckResult == true16if Player.XPos < Object.XPos17// The player is to the left of the barrier, push the player out to the left18Player.XPos = Player.CollisionLeft19Player.XPos <<= 1620Player.XPos += Object.XPos21Player.XPos -= 0x100000 // moving the player 16 pixels left22else23// Player's to the right of the barrier, puch them to the right instead24Player.XPos = Player.CollisionRight25Player.XPos <<= 1626Player.XPos += Object.XPos27Player.XPos += 0x100000 // move the player 16 pixels right28end if2930Player.Speed = 031Player.XVelocity = 032end if33end if3435end sub363738sub ObjectStartup3940if Stage.PlayerListPos == PLAYER_SONIC_A // PLAYER_SONIC in origins4142// I have no idea what this is doing to be honest43// It's formatted like an object setup but... there's no setup actually happening...44// And the fact it's only for Sonic too for whatever reason... certainly strange4546ArrayPos0 = 3247while ArrayPos0 < 105648// something???49// Given that the name of the object is "*Tails* Barrier" though, perhaps it was just gonna unload itself here?50ArrayPos0++51loop5253end if5455end sub565758// ========================59// Editor Subs60// ========================6162sub RSDKDraw63DrawSprite(0)6465// Draw the hitbox for the object6667TempValue0 = Object.iXPos68TempValue0 -= 1669TempValue1 = Object.iYPos70TempValue1 -= 1471DrawRectOutline(TempValue0, TempValue1, 32, 30, 255, 255, 255, 255)72end sub737475sub RSDKLoad76LoadSpriteSheet("Global/Display.gif")77SpriteFrame(-16, -14, 32, 30, 1, 145) // "Script" Icon - I don't feel like it's an ideal fit here, but I can't think of anything else...7879SetVariableAlias(ALIAS_VAR_PROPVAL, "unused")80end sub818283