Path: blob/main/Scripts/R8/R81ASetup.txt
1319 views
//---------------Sonic CD R8 1 A Setup Script-----------------//1//--------Scripted by Christian Whitehead 'The Taxman'--------//2//-------Unpacked By Rubberduckycooly's Script Unpacker-------//34// Aliases5#alias Object.Value0 : Object.PaletteTimer6#alias Object.Value1 : Object.CurrentPalette7#alias Object.Value2 : Object.VGearFrame8#alias Object.Value3 : Object.HCylinderFrame9#alias Object.Value4 : Object.VCylinderFrame10#alias Object.Value5 : Object.LightsFrame11#alias Object.Value6 : Object.BGSphereTimer12#alias Object.Value7 : Object.BGSphereCoolDown1314// Priority15#alias 1 : PRIORITY_ACTIVE161718sub ObjectMain19Object.Rotation++20Object.Rotation %= 1442122TempValue0 = Object.VGearFrame23TempValue0 %= 724if TempValue0 == 025TempValue0 = Object.VGearFrame26TempValue0 /= 727TempValue0 <<= 128TempValue0 += 60029Copy16x16Tile(444, TempValue0)30TempValue0++31Copy16x16Tile(445, TempValue0)32end if33Object.VGearFrame++34Object.VGearFrame %= 283536TempValue0 = Object.HCylinderFrame37TempValue0 &= 338if TempValue0 == 039TempValue0 = Object.HCylinderFrame40TempValue0 >>= 241TempValue0 <<= 142TempValue0 += 60843Copy16x16Tile(446, TempValue0)44TempValue0++45Copy16x16Tile(447, TempValue0)46end if4748Object.HCylinderFrame++49Object.HCylinderFrame &= 155051TempValue0 = Object.VCylinderFrame52TempValue0 %= 553if TempValue0 == 054TempValue0 = Object.VCylinderFrame55TempValue0 /= 556TempValue0 <<= 257TempValue0 += 61658Copy16x16Tile(448, TempValue0)59TempValue0++60Copy16x16Tile(449, TempValue0)61TempValue0++62Copy16x16Tile(450, TempValue0)63TempValue0++64Copy16x16Tile(451, TempValue0)65end if66Object.VCylinderFrame++67Object.VCylinderFrame %= 206869TempValue0 = Object.LightsFrame70TempValue0 &= 771if TempValue0 == 072TempValue0 = Object.LightsFrame73TempValue0 >>= 374TempValue0 += 63275Copy16x16Tile(452, TempValue0)76end if77Object.LightsFrame++78Object.LightsFrame %= 567980if Object.BGSphereTimer == 081switch Object.Frame82case 083Object.BGSphereTimer = 4484Object.Frame++85Copy16x16Tile(440, 484)86Copy16x16Tile(441, 485)87Copy16x16Tile(442, 486)88Copy16x16Tile(443, 487)89break90case 191Object.BGSphereTimer = 492Object.Frame++93Copy16x16Tile(440, 488)94Copy16x16Tile(441, 489)95Copy16x16Tile(442, 490)96Copy16x16Tile(443, 491)97break98case 299Object.BGSphereTimer = 13100Object.Frame++101Copy16x16Tile(440, 492)102Copy16x16Tile(441, 493)103Copy16x16Tile(442, 494)104Copy16x16Tile(443, 495)105break106case 3107Object.BGSphereTimer = 4108Object.Frame++109Copy16x16Tile(440, 496)110Copy16x16Tile(441, 497)111Copy16x16Tile(442, 498)112Copy16x16Tile(443, 499)113break114case 4115Object.BGSphereTimer = 4116if Object.BGSphereCoolDown < 4117Object.Frame = 1118Object.BGSphereCoolDown++119else120Object.BGSphereCoolDown = 0121Object.Frame = 0122end if123Copy16x16Tile(440, 484)124Copy16x16Tile(441, 485)125Copy16x16Tile(442, 486)126Copy16x16Tile(443, 487)127break128end switch129Object.BGSphereTimer--130else131Object.BGSphereTimer--132end if133134Object.PaletteTimer++135if Object.PaletteTimer == 5136Object.PaletteTimer = 0137if Object.CurrentPalette > 2138Object.CurrentPalette = 1139else140Object.CurrentPalette++141end if142Object.CurrentPalette %= 3143if Object.CurrentPalette == 0144switch Object.AnimationTimer145case 3146Object.CurrentPalette += 3147break148case 4149Object.CurrentPalette += 4150break151case 5152Object.CurrentPalette += 5153break154end switch155Object.AnimationTimer++156Object.AnimationTimer %= 6157end if158end if159SetActivePalette(Object.CurrentPalette, 0, Screen.YSize)160end sub161162163sub ObjectStartup164Object[19].Type = TypeName[R8 Setup]165Object[19].Priority = PRIORITY_ACTIVE166167CopyPalette(0, 1)168CopyPalette(0, 2)169CopyPalette(0, 3)170CopyPalette(0, 4)171CopyPalette(0, 5)172173TempValue0 = 0174TempValue1 = 0175TempValue2 = 32176while TempValue0 < 6177LoadPalette("R81A_PalCycle.act", TempValue0, 160, TempValue1, TempValue2)178TempValue0++179TempValue1 += 32180TempValue2 += 32181loop182end sub183184185// ========================186// Editor Subs187// ========================188189sub RSDKDraw190DrawSprite(0)191end sub192193194sub RSDKLoad195LoadSpriteSheet("Global/Display.gif")196SpriteFrame(-16, -16, 32, 32, 1, 143) // #0 - "Script" Icon197198SetVariableAlias(ALIAS_VAR_PROPVAL, "unused")199end sub200201202