Path: blob/main/Scripts/R4/BGEffectsA1.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_WATER141516// Function declarations17#function BGEffects_Deform_Left18#function BGEffects_Deform_Right192021function BGEffects_Deform_Left22Stage[ArrayPos0].DeformationData1 = 123ArrayPos0++24Stage[ArrayPos0].DeformationData1 = 125ArrayPos0++26Stage[ArrayPos0].DeformationData1 = 227ArrayPos0++28Stage[ArrayPos0].DeformationData1 = 229ArrayPos0++30Stage[ArrayPos0].DeformationData1 = 331ArrayPos0++32Stage[ArrayPos0].DeformationData1 = 333ArrayPos0++34Stage[ArrayPos0].DeformationData1 = 335ArrayPos0++36Stage[ArrayPos0].DeformationData1 = 337ArrayPos0++38Stage[ArrayPos0].DeformationData1 = 239ArrayPos0++40Stage[ArrayPos0].DeformationData1 = 241ArrayPos0++42Stage[ArrayPos0].DeformationData1 = 143ArrayPos0++44Stage[ArrayPos0].DeformationData1 = 145ArrayPos0++46end function474849function BGEffects_Deform_Right50Stage[ArrayPos0].DeformationData1 = -151ArrayPos0++52Stage[ArrayPos0].DeformationData1 = -153ArrayPos0++54Stage[ArrayPos0].DeformationData1 = -255ArrayPos0++56Stage[ArrayPos0].DeformationData1 = -257ArrayPos0++58Stage[ArrayPos0].DeformationData1 = -359ArrayPos0++60Stage[ArrayPos0].DeformationData1 = -361ArrayPos0++62Stage[ArrayPos0].DeformationData1 = -363ArrayPos0++64Stage[ArrayPos0].DeformationData1 = -365ArrayPos0++66Stage[ArrayPos0].DeformationData1 = -267ArrayPos0++68Stage[ArrayPos0].DeformationData1 = -269ArrayPos0++70Stage[ArrayPos0].DeformationData1 = -171ArrayPos0++72Stage[ArrayPos0].DeformationData1 = -173ArrayPos0++74end function757677sub ObjectDraw78Object.Timer++79if Object.Timer > 180TileLayer[0].DeformationOffsetW++81TileLayer[2].DeformationOffsetW++82Object.Timer = 083end if8485TempValue0 = Stage.WaterLevel86TempValue0 -= Screen.YOffset8788if TempValue0 < 089TempValue0 = 090end if9192if TempValue0 > Screen.YSize93TempValue0 = Screen.YSize94end if9596#platform: SW_Rendering97SetActivePalette(BGAnimation.CurrentPal, 0, TempValue0)98SetActivePalette(7, TempValue0, Screen.YSize)99#endplatform100101#platform: HW_Rendering102SetActivePalette(BGAnimation.CurrentPal, 0, TempValue0)103DrawRect(0, TempValue0, Screen.XSize, Screen.YSize, 0, 96, 48, 128)104#endplatform105end sub106107108sub ObjectStartup109ArrayPos0 = 32110while ArrayPos0 < 1056111if Object[ArrayPos0].Type == TypeName[BGEffects]112Object[ArrayPos0].Priority = PRIORITY_ACTIVE113Object[ArrayPos0].DrawOrder = 5114// This looks dumb, and is dumb, but it's like that115#platform: HW_Rendering116Object[ArrayPos0].DrawOrder = 5117#endplatform118#platform: SW_Rendering119Object[ArrayPos0].DrawOrder = 0120#endplatform121end if122ArrayPos0++123loop124125#platform: SW_Rendering126ArrayPos0 = 0127CallFunction(BGEffects_Deform_Left)128129ArrayPos0 = 128130CallFunction(BGEffects_Deform_Left)131132ArrayPos0 = 160133CallFunction(BGEffects_Deform_Right)134135ArrayPos0 = 256136while ArrayPos0 < 576137ArrayPos1 = ArrayPos0138ArrayPos1 -= 256139Stage[ArrayPos0].DeformationData1 = Stage[ArrayPos1].DeformationData1140ArrayPos0++141loop142#endplatform143144SetLayerDeformation(DEFORM_BG_WATER, 128, 4, 0, 0, 0)145146LoadPalette("R4A_WaterPal.act", 7, 0, 0, 256)147end sub148149150// ========================151// Editor Subs152// ========================153154sub RSDKDraw155DrawSprite(0)156end sub157158159sub RSDKLoad160LoadSpriteSheet("Global/Display.gif")161SpriteFrame(-16, -16, 32, 32, 1, 143) // #0 - "Script" Icon162163SetVariableAlias(ALIAS_VAR_PROPVAL, "unused")164end sub165166167168