Path: blob/main/Scripts/R4/BGEffectsB.txt
1319 views
//-----------------Sonic CD BG Effects Script-----------------//1//--------Scripted by Christian Whitehead 'The Taxman'--------//2//-------Unpacked By Rubberduckycooly's Script Unpacker-------//34// Aliases5#alias Object.Value0 : Object.Timer6// BG Animation alias7#alias Object[19].Value1 : BGAnimation.CurrentPal89// Priority10#alias 1 : PRIORITY_ACTIVE1112// Deformation Layer13#alias 3 : DEFORM_BG_WATER1415// Function declarations16#function BGEffects_Deform_Left17#function BGEffects_Deform_Right181920function BGEffects_Deform_Left21Stage[ArrayPos0].DeformationData1 = 122ArrayPos0++23Stage[ArrayPos0].DeformationData1 = 124ArrayPos0++25Stage[ArrayPos0].DeformationData1 = 226ArrayPos0++27Stage[ArrayPos0].DeformationData1 = 228ArrayPos0++29Stage[ArrayPos0].DeformationData1 = 330ArrayPos0++31Stage[ArrayPos0].DeformationData1 = 332ArrayPos0++33Stage[ArrayPos0].DeformationData1 = 334ArrayPos0++35Stage[ArrayPos0].DeformationData1 = 336ArrayPos0++37Stage[ArrayPos0].DeformationData1 = 238ArrayPos0++39Stage[ArrayPos0].DeformationData1 = 240ArrayPos0++41Stage[ArrayPos0].DeformationData1 = 142ArrayPos0++43Stage[ArrayPos0].DeformationData1 = 144ArrayPos0++45end function464748function BGEffects_Deform_Right49Stage[ArrayPos0].DeformationData1 = -150ArrayPos0++51Stage[ArrayPos0].DeformationData1 = -152ArrayPos0++53Stage[ArrayPos0].DeformationData1 = -254ArrayPos0++55Stage[ArrayPos0].DeformationData1 = -256ArrayPos0++57Stage[ArrayPos0].DeformationData1 = -358ArrayPos0++59Stage[ArrayPos0].DeformationData1 = -360ArrayPos0++61Stage[ArrayPos0].DeformationData1 = -362ArrayPos0++63Stage[ArrayPos0].DeformationData1 = -364ArrayPos0++65Stage[ArrayPos0].DeformationData1 = -266ArrayPos0++67Stage[ArrayPos0].DeformationData1 = -268ArrayPos0++69Stage[ArrayPos0].DeformationData1 = -170ArrayPos0++71Stage[ArrayPos0].DeformationData1 = -172ArrayPos0++73end function747576sub ObjectDraw77Object.Timer++78if Object.Timer > 179TileLayer[0].DeformationOffsetW++80TileLayer[1].DeformationOffsetW++81Object.Timer = 082end if8384TempValue0 = Stage.WaterLevel85TempValue0 -= Screen.YOffset86if TempValue0 < 087TempValue0 = 088end if8990if TempValue0 > Screen.YSize91TempValue0 = Screen.YSize92end if9394SetActivePalette(BGAnimation.CurrentPal, 0, TempValue0)9596#platform: SW_Rendering97SetActivePalette(7, TempValue0, Screen.YSize)98#endplatform99100#platform: HW_Rendering101DrawRect(0, TempValue0, Screen.XSize, Screen.YSize, 8, 0, 8, 96)102#endplatform103end sub104105106sub ObjectStartup107ArrayPos0 = 32108while ArrayPos0 < 1056109if Object[ArrayPos0].Type == TypeName[BGEffects]110Object[ArrayPos0].Priority = PRIORITY_ACTIVE111Object[ArrayPos0].DrawOrder = 5112// This looks dumb, and is dumb, but it's like that113#platform: HW_Rendering114Object[ArrayPos0].DrawOrder = 5115#endplatform116#platform: SW_Rendering117Object[ArrayPos0].DrawOrder = 0118#endplatform119end if120ArrayPos0++121loop122123#platform: SW_Rendering124ArrayPos0 = 0125CallFunction(BGEffects_Deform_Left)126127ArrayPos0 = 128128CallFunction(BGEffects_Deform_Left)129130ArrayPos0 = 160131CallFunction(BGEffects_Deform_Right)132133ArrayPos0 = 256134while ArrayPos0 < 576135ArrayPos1 = ArrayPos0136ArrayPos1 -= 256137Stage[ArrayPos0].DeformationData1 = Stage[ArrayPos1].DeformationData1138ArrayPos0++139loop140#endplatform141SetLayerDeformation(DEFORM_BG_WATER, 128, 4, 0, 0, 0)142143LoadPalette("R4B_WaterPal.act", 7, 0, 0, 256)144end sub145146147// ========================148// Editor Subs149// ========================150151sub RSDKDraw152DrawSprite(0)153end sub154155156sub RSDKLoad157LoadSpriteSheet("Global/Display.gif")158SpriteFrame(-16, -16, 32, 32, 1, 143) // #0 - "Script" Icon159160SetVariableAlias(ALIAS_VAR_PROPVAL, "unused")161end sub162163164165