Path: blob/main/Scripts/R5/KWeb.txt
1319 views
//---------------Sonic CD Kumo Kumo Web Script----------------//1//--------Scripted by Christian Whitehead 'The Taxman'--------//2//-------Unpacked By Rubberduckycooly's Script Unpacker-------//34// Aliases5#alias 0 : KUMOKUMOWEB_THROWN6#alias 1 : KUMOKUMOWEB_ATTACHED78#alias Object.Value0 : Object.Timer9#alias Object.Value1 : Object.XVelocity101112sub ObjectMain1314if Object.State == KUMOKUMOWEB_THROWN1516// Fly through the air17Object.XPos += Object.XVelocity1819if Object.OutOfBounds == true20// Unload if out of bounds21Object.Type = TypeName[Blank Object]22else2324// If far vertically too, then unload too25TempValue0 = Screen.YOffset26TempValue0 -= 827TempValue0 <<= 1628if Object.YPos < TempValue029Object.Type = TypeName[Blank Object]30end if3132end if33else3435// Attached to a Player3637if Object.Timer < 12038Object.Timer++3940// Slow the Player down to a maximum speed of 0.25 pixels a second4142// Right-wards limit43if Player.Speed > 0x400044Player.Speed = 0x400045end if4647// Left-wards limit48if Player.Speed < -0x400049Player.Speed = -0x400050end if5152else5354// The Web's sticky time is over, unload now55Object.Type = TypeName[Blank Object]5657end if58end if5960end sub616263sub ObjectPlayerInteraction6465// Check to see if the Web should attach to Sonic66// (Although it doesn't matter too much anyway, this check continues to run even if the Web is already in its ATTACHED state)67PlayerObjectCollision(C_TOUCH, -6, -6, 6, 6)68if CheckResult == true69Object.State = KUMOKUMOWEB_ATTACHED70end if7172end sub737475sub ObjectDraw7677if Object.State == KUMOKUMOWEB_ATTACHED78// Attached Webs should stick to the Player7980Object.XPos = Player.XPos81Object.YPos = Player.YPos82end if8384TempValue0 = Object.Frame85TempValue0 /= 38687DrawSprite(TempValue0)8889Object.Frame++90Object.Frame %= 69192end sub939495sub ObjectStartup96LoadSpriteSheet("R5/Objects.gif")9798// Kumo Kumo Web Frames99SpriteFrame(-12, -8, 24, 16, 69, 1)100SpriteFrame(-12, -8, 24, 16, 94, 1)101102end sub103104105// ========================106// Editor Subs107// ========================108109sub RSDKDraw110DrawSprite(0)111end sub112113114sub RSDKLoad115LoadSpriteSheet("R5/Objects.gif")116SpriteFrame(-12, -8, 24, 16, 69, 1)117118SetVariableAlias(ALIAS_VAR_PROPVAL, "unused")119end sub120121122