Path: blob/main/Scripts/R6/ElectricWeb.txt
1319 views
//---------------Sonic CD Electric Web Script-----------------//1//--------Scripted by Christian Whitehead 'The Taxman'--------//2//-------Unpacked By Rubberduckycooly's Script Unpacker-------//34// Aliases5#alias Object.Value1 : Object.VWebFrame6#alias Object.Value2 : Object.HWebFrame7#alias Object.Value3 : Object.DWebFrame89// R6 Setup Aliases10#alias Object[19].Value0 : R6Setup.Timer11#alias Object[19].State : R6Setup.State12#alias Object[19].Frame : R6Setup.Frame13#alias Object[19].Direction : R6Setup.Direction1415// States16#alias 0 : R6_SETUP_PREPARE_CHARGE1718// Property Values19#alias 0 : WEB_PARENT_OBJECT20#alias 1 : WEB_CHILD_OBJECT21#alias 2 : WEB_DELAYER2223// Directions24#alias 2 : FACING_UPEND_RIGHT252627sub ObjectDraw28switch Object.PropertyValue29case WEB_PARENT_OBJECT30DrawSprite(R6Setup.Frame)31TempValue0 = Object.XPos32TempValue1 = Object.YPos33TempValue1 -= 0x80000034DrawSpriteXY(R6Setup.Frame, TempValue0, TempValue1)3536TempValue1 += 0x100000037DrawSpriteXY(R6Setup.Frame, TempValue0, TempValue1)3839if R6Setup.State > R6_SETUP_PREPARE_CHARGE40switch R6Setup.Direction41case 042Object.HWebFrame = 943Object.HWebFrame += R6Setup.Frame44DrawSprite(Object.HWebFrame)4546Object.Direction = FACING_UPEND_RIGHT47DrawSpriteXY(Object.HWebFrame, Object.XPos, TempValue1)48break4950case 151Object.VWebFrame = 1852Object.VWebFrame += R6Setup.Frame53DrawSprite(Object.VWebFrame)5455Object.Direction = FACING_LEFT56TempValue0 += 0x80000057DrawSpriteXY(Object.VWebFrame, TempValue0, Object.YPos)58break5960case 261TempValue0 += 0x8000006263Object.DWebFrame = 2764Object.DWebFrame += R6Setup.Frame65Object.Direction = FACING_LEFT6667TempValue2 = Object.XPos68TempValue2 -= 0x8000006970DrawSprite(Object.DWebFrame)71DrawSpriteFX(Object.DWebFrame, FX_FLIP, Object.XPos, Object.YPos)72DrawSpriteXY(Object.DWebFrame, TempValue0, TempValue1)73DrawSpriteFX(Object.DWebFrame, FX_FLIP, TempValue2, TempValue1)7475Object.DWebFrame += 976DrawSprite(Object.DWebFrame)77DrawSpriteFX(Object.DWebFrame, FX_FLIP, Object.XPos, Object.YPos)78DrawSpriteXY(Object.DWebFrame, TempValue0, TempValue1)79DrawSpriteFX(Object.DWebFrame, FX_FLIP, TempValue2, TempValue1)8081Object.DWebFrame += 982DrawSprite(Object.DWebFrame)83DrawSpriteFX(Object.DWebFrame, FX_FLIP, Object.XPos, Object.YPos)84DrawSpriteXY(Object.DWebFrame, TempValue0, TempValue1)85DrawSpriteFX(Object.DWebFrame, FX_FLIP, TempValue2, TempValue1)8687Object.DWebFrame += 988DrawSprite(Object.DWebFrame)89DrawSpriteFX(Object.DWebFrame, FX_FLIP, Object.XPos, Object.YPos)90DrawSpriteXY(Object.DWebFrame, TempValue0, TempValue1)91DrawSpriteFX(Object.DWebFrame, FX_FLIP, TempValue2, TempValue1)92break93end switch94end if95break9697case WEB_CHILD_OBJECT98DrawSprite(R6Setup.Frame)99break100101case WEB_DELAYER102if R6Setup.State == R6_SETUP_PREPARE_CHARGE103R6Setup.Timer = 0104end if105break106end switch107end sub108109110111sub ObjectStartup112LoadSpriteSheet("R6/Objects3.gif")113// Web Core Frames114SpriteFrame(-24, -24, 48, 48, 73, 34)115SpriteFrame(-24, -24, 48, 48, 122, 34)116SpriteFrame(-24, -24, 48, 48, 73, 34)117SpriteFrame(-24, -24, 48, 48, 73, 83)118SpriteFrame(-24, -24, 48, 48, 73, 34)119SpriteFrame(-24, -24, 48, 48, 122, 83)120SpriteFrame(-24, -24, 48, 48, 73, 34)121SpriteFrame(-24, -24, 48, 48, 73, 34)122SpriteFrame(-24, -24, 48, 48, 122, 132)123124// Vertical Web Frames125SpriteFrame(-8, -104, 16, 80, 171, 119)126SpriteFrame(-8, -104, 16, 80, 188, 119)127SpriteFrame(-8, -104, 16, 80, 171, 119)128SpriteFrame(-8, -104, 16, 80, 205, 119)129SpriteFrame(-8, -104, 16, 80, 171, 119)130SpriteFrame(-8, -104, 16, 80, 222, 119)131SpriteFrame(-8, -104, 16, 80, 171, 119)132SpriteFrame(-8, -104, 16, 80, 171, 119)133SpriteFrame(-8, -104, 16, 80, 239, 119)134135// Horizontal Web Frames136SpriteFrame(-104, -8, 80, 16, 175, 34)137SpriteFrame(-104, -8, 80, 16, 175, 51)138SpriteFrame(-104, -8, 80, 16, 175, 34)139SpriteFrame(-104, -8, 80, 16, 175, 68)140SpriteFrame(-104, -8, 80, 16, 175, 34)141SpriteFrame(-104, -8, 80, 16, 175, 85)142SpriteFrame(-104, -8, 80, 16, 175, 34)143SpriteFrame(-104, -8, 80, 16, 175, 34)144SpriteFrame(-104, -8, 80, 16, 175, 102)145146// Diagonal Web Frames147SpriteFrame(-43, -116, 32, 32, 66, 1)148SpriteFrame(-43, -116, 32, 32, 99, 1)149SpriteFrame(-43, -116, 32, 32, 66, 1)150SpriteFrame(-43, -116, 32, 32, 132, 1)151SpriteFrame(-43, -116, 32, 32, 66, 1)152SpriteFrame(-43, -116, 32, 32, 165, 1)153SpriteFrame(-43, -116, 32, 32, 66, 1)154SpriteFrame(-43, -116, 32, 32, 66, 1)155SpriteFrame(-43, -116, 32, 32, 198, 1)156157SpriteFrame(-67, -92, 32, 32, 66, 1)158SpriteFrame(-67, -92, 32, 32, 99, 1)159SpriteFrame(-67, -92, 32, 32, 66, 1)160SpriteFrame(-67, -92, 32, 32, 132, 1)161SpriteFrame(-67, -92, 32, 32, 66, 1)162SpriteFrame(-67, -92, 32, 32, 165, 1)163SpriteFrame(-67, -92, 32, 32, 66, 1)164SpriteFrame(-67, -92, 32, 32, 66, 1)165SpriteFrame(-67, -92, 32, 32, 198, 1)166167SpriteFrame(-91, -68, 32, 32, 66, 1)168SpriteFrame(-91, -68, 32, 32, 99, 1)169SpriteFrame(-91, -68, 32, 32, 66, 1)170SpriteFrame(-91, -68, 32, 32, 132, 1)171SpriteFrame(-91, -68, 32, 32, 66, 1)172SpriteFrame(-91, -68, 32, 32, 165, 1)173SpriteFrame(-91, -68, 32, 32, 66, 1)174SpriteFrame(-91, -68, 32, 32, 66, 1)175SpriteFrame(-91, -68, 32, 32, 198, 1)176177SpriteFrame(-115, -44, 32, 32, 66, 1)178SpriteFrame(-115, -44, 32, 32, 99, 1)179SpriteFrame(-115, -44, 32, 32, 66, 1)180SpriteFrame(-115, -44, 32, 32, 132, 1)181SpriteFrame(-115, -44, 32, 32, 66, 1)182SpriteFrame(-115, -44, 32, 32, 165, 1)183SpriteFrame(-115, -44, 32, 32, 66, 1)184SpriteFrame(-115, -44, 32, 32, 66, 1)185SpriteFrame(-115, -44, 32, 32, 198, 1)186end sub187188189// ========================190// Editor Subs191// ========================192193sub RSDKEdit194if Editor.ReturnVariable == true195switch Editor.VariableID196case EDIT_VAR_PROPVAL // Property Value197CheckResult = Object.PropertyValue198break199case 0 // Type200CheckResult = Object.PropertyValue201CheckResult %= 3202break203end switch204else205switch Editor.VariableID206case EDIT_VAR_PROPVAL // Property Value207Object.PropertyValue = Editor.VariableValue208break209case 0 // Type210Object.PropertyValue = Editor.VariableValue211Object.PropertyValue %= 3212break213end switch214end if215end sub216217218sub RSDKDraw219LoadSpriteSheet("R6/Objects3.gif")220switch object.PropertyValue221case WEB_PARENT_OBJECT222DrawSprite(0)223TempValue0 = Object.XPos224TempValue1 = Object.YPos225TempValue1 -= 0x800000226DrawSpriteXY(0, TempValue0, TempValue1)227228TempValue1 += 0x1000000229DrawSpriteXY(0, TempValue0, TempValue1)230DrawSprite(1)231Object.Direction = FACING_UPEND_RIGHT232DrawSpriteXY(1, Object.XPos, TempValue1)233break234case WEB_CHILD_OBJECT235DrawSprite(0)236break237case WEB_DELAYER238Object.InkEffect = 1239DrawSpriteFX(0, FX_INK, Object.XPos, Object.YPos)240RemoveSpriteSheet("R6/Objects3.gif")241LoadSpriteSheet("Global/Items.gif")242DrawSpriteFX(2, FX_INK, Object.XPos, Object.YPos)243break244end switch245end sub246247248sub RSDKLoad249LoadSpriteSheet("R6/Objects3.gif")250// Web Core Frames251SpriteFrame(-24, -24, 48, 48, 122, 34)252// Web V253SpriteFrame(-8, -104, 16, 80, 171, 119)254255LoadSpriteSheet("Global/Items.gif")256SpriteFrame(-7, -6, 14, 12, 27, 174)257AddEditorVariable("type")258SetActiveVariable("type")259AddEnumVariable("Parent Object", WEB_PARENT_OBJECT)260AddEnumVariable("Child Object", WEB_CHILD_OBJECT)261AddEnumVariable("Shock Delayer", WEB_DELAYER)262end sub263264265266