Path: blob/main/Scripts/R5/R5AGlowEffect.txt
1319 views
//----------------Sonic CD Glow Effect Script-----------------//1//--------Scripted by Christian Whitehead 'The Taxman'--------//2//-------Unpacked By Rubberduckycooly's Script Unpacker-------//34// Aliases5#alias Object.Value0 : Object.Timer67// Layer Aliases8#alias 1 : LAYER_INSIDE910// Priority11#alias 1 : PRIORITY_ACTIVE121314sub ObjectDraw1516// Only animate when the currently active BG is the Cave17if Stage.ActiveLayer[0] == LAYER_INSIDE1819// Get the Palette Animation Frame to use20TempValue0 = Object.Timer21TempValue0 /= 62223// From this Frame, jump as needed to the Palette ID needed24switch TempValue025case 026// Cases 0/3 are all the same and could probably be combined,27// akin to 4/8 or 5/7, but I suppose they just didn't feel like doing that...28SetActivePalette(0, 0, Screen.YSize)29break30case 131SetActivePalette(0, 0, Screen.YSize)32break33case 234SetActivePalette(0, 0, Screen.YSize)35break36case 337SetActivePalette(0, 0, Screen.YSize)38break39case 440case 841SetActivePalette(1, 0, Screen.YSize)42break43case 544case 745SetActivePalette(2, 0, Screen.YSize)46break47case 648SetActivePalette(3, 0, Screen.YSize)49break50end switch5152// Animate as needed53Object.Timer++54Object.Timer %= 545556end if5758end sub596061sub ObjectStartup6263// This object is only for when Software rendering is active64// That's because both this and the Conveyors use palette effects, and due to how the HW render works only one can be active at a time65// The Conveyors take precedence since they're part of the actual gameplay, these BG rocks are just a visual effect so they're stuffed in the BG and left unanimated in that case66#platform: SW_Rendering6768// Place a Glow Effect Object into the level69Object[21].Type = TypeName[Glow Effect]7071// Make it active, since BG rocks should always glow throughout the stage72Object[21].Priority = PRIORITY_ACTIVE7374// Give it the lowest Draw Order possible, so that it only effects the BG Rocks75// This Draw Order is intentionally set to be lower than the Conveyor Belt Object,76// which is Draw Order 1 and does Palette trickery too77Object[21].DrawOrder = 07879// Setup all the Palettes8081// There's no need to copy palette bank 0 into all the others,82// because that's already been done by the Conveyor Belt Object, which comes before this one8384TempValue0 = 085TempValue1 = 086TempValue2 = 1687while TempValue0 < 588LoadPalette("R5A_GlowEffect.act", TempValue0, 176, TempValue1, TempValue2)89TempValue1 += 1690TempValue2 += 169192TempValue0++93loop9495#endplatform9697end sub9899100// ========================101// Editor Subs102// ========================103104sub RSDKDraw105DrawSprite(0)106end sub107108109sub RSDKLoad110LoadSpriteSheet("Global/Display.gif")111SpriteFrame(-16, -16, 32, 32, 1, 143) // #0 - "Script" Icon112113SetVariableAlias(ALIAS_VAR_PROPVAL, "unused")114end sub115116117