Path: blob/master/Sonic 2/Scripts/DEZ/DEZSetup.txt
1482 views
// ----------------------------------1// RSDK Project: Sonic 22// Script Description: DEZ Setup Object3// Script Author: Christian Whitehead/Simon Thomley4// Unpacked by Rubberduckycooly's script unpacker5// ----------------------------------67// ========================8// Aliases9// ========================1011private alias object.value0 : object.aniTileTimer12private alias object.value14 : object.palTimer13private alias object.value15 : object.bgTowerLightPalIndex14private alias object.value16 : object.rainbowLightPalIndex15private alias object.value17 : object.chemLiquidPalIndex116private alias object.value18 : object.chemLiquidPalIndex217private alias object.value19 : object.chemLiquidPalIndex31819// Player Aliases20private alias object.type : player.type2122// Reserved object slots23private alias 10 : SLOT_ZONESETUP2425// Tracks26private alias 0 : TRACK_STAGE2728// Music Loops29private alias 1 : MUSIC_LOOP_DEZ303132// ========================33// Tables34// ========================3536private table DEZSetup_bgTowerLightPalTable370xE00000, 0xC00000, 0xA00000, 0x800000, 0x600000, 0x400000, 0x200000, 0x400000380x600000, 0x800000, 0xA00000, 0xC00000, 0xE00000, 0xE02000, 0xE04000, 0xE0200039end table4041private table DEZSetup_rainbowLightPalTable420x00E000, 0x20C000, 0x40A000, 0x608000, 0x806000, 0xA04000, 0xC02000430xE00000, 0xC00020, 0xA00040, 0x800060, 0x600080, 0x4000A0, 0x2000C0440x0000E0, 0x0020C0, 0x0040A0, 0x006080, 0x008060, 0x00A040, 0x00C02045end table4647private table DEZSetup_chemLiquidPalTable480x0040E0, 0x0000C0, 0x0000C0490x0060E0, 0x0020C0, 0x0000C0500x0040E0, 0x0040E0, 0x0000C0510x0020C0, 0x0060E0, 0x0020C0520x0000C0, 0x0040E0, 0x0040C0530x0000C0, 0x0020C0, 0x0040E0540x0000C0, 0x0000C0, 0x0060E0550x0020C0, 0x0000C0, 0x0040E0560x0020E0, 0x0000C0, 0x0020C057end table5859// Unused palette table, also found in CPZSetup and EndSetup and even Mania's CPZ!60// These are actually colors for one of WFZ's palette cycles61// However, you won't find this in WFZSetup because in this 2013 remake, WFZ only uses 1 of the 3 palette cycles it had in the original game,62// this one being among the 2 that were cut63// Why they were cut, I have no idea, but at the very least, it's certainly a mystery how one of them ended up here of all places...64private table DEZSetup_unusedPalette650x00E000, 0x00A000, 0x006000, 0x002000, 0x000000, 0x000020, 0x000060, 0x0020A0660x0060E0, 0x0020A0, 0x000060, 0x000020, 0x000000, 0x200000, 0x600000, 0xA00000670xE00000, 0xE04000, 0xE00000, 0xA00000, 0x600000, 0x200000, 0x000000, 0x202000680x606000, 0xA0A000, 0xE0E000, 0xA0A000, 0x606000, 0x202000, 0x000000, 0x002000690x006000, 0x00A00070end table717273// ========================74// Events75// ========================7677event ObjectUpdate78// Animate the converyor belts in the background79object.aniTileTimer++80if object.aniTileTimer == 581object.aniTileTimer = 082object.frame++83object.frame &= 78485temp0 = object.frame86temp0 += 76887Copy16x16Tile(767, temp0)88end if8990// Manage the various cycling palettes throughout the stage91object.palTimer++92if object.palTimer == 893object.palTimer = 09495object.bgTowerLightPalIndex++96object.bgTowerLightPalIndex &= 1597GetTableValue(temp0, object.bgTowerLightPalIndex, DEZSetup_bgTowerLightPalTable)98SetPaletteEntry(0, 175, temp0)99100object.rainbowLightPalIndex++101object.rainbowLightPalIndex %= 21102GetTableValue(temp0, object.rainbowLightPalIndex, DEZSetup_rainbowLightPalTable)103SetPaletteEntry(0, 191, temp0)104105object.chemLiquidPalIndex1 += 3106object.chemLiquidPalIndex1 %= 27107GetTableValue(temp0, object.chemLiquidPalIndex1, DEZSetup_chemLiquidPalTable)108SetPaletteEntry(0, 188, temp0)109110object.chemLiquidPalIndex2 += 3111object.chemLiquidPalIndex2 %= 27112GetTableValue(temp0, object.chemLiquidPalIndex2, DEZSetup_chemLiquidPalTable)113SetPaletteEntry(0, 189, temp0)114115object.chemLiquidPalIndex3 += 3116object.chemLiquidPalIndex3 %= 27117GetTableValue(temp0, object.chemLiquidPalIndex3, DEZSetup_chemLiquidPalTable)118SetPaletteEntry(0, 190, temp0)119end if120end event121122123event ObjectStartup124// Set the stage music125SetMusicTrack("DeathEgg.ogg", TRACK_STAGE, MUSIC_LOOP_DEZ)126127// No speed up/slow down functions need to be set since Speed Shoes shouldn't exist in DEZ at all128129// Reset the boss flash color to be black130SetPaletteEntry(0, 192, 0x000000)131132// Start the Conveyor Belt tiles, set them to frame 1133Copy16x16Tile(767, 768)134135// There shouldn't be any animals in DEZ, reset them136// (though, since there aren't any they could just go left unchanged...)137animalType1 = TypeName[Blank Object]138animalType2 = TypeName[Blank Object]139140// Remove player 2, only P1 should be active here141player[1].type = TypeName[Blank Object]142playerCount = 1143144// Place a DEZ object into the scene145object[SLOT_ZONESETUP].type = TypeName[DEZ Setup]146object[SLOT_ZONESETUP].priority = PRIORITY_ACTIVE147object[SLOT_ZONESETUP].drawOrder = 0 // This is just a leftover from this script being copied from CPZSetup, it doesn't actually do anything since this object doesn't have an ObjectDraw event148object[SLOT_ZONESETUP].chemLiquidPalIndex2 = 1149object[SLOT_ZONESETUP].chemLiquidPalIndex3 = 2150151// Set stage bounds152temp0 = stage.curYBoundary2153temp0 -= screen.ysize154stage.newYBoundary1 = temp0155end event156157158// ========================159// Editor Events160// ========================161162event RSDKDraw163DrawSprite(0)164end event165166167event RSDKLoad168LoadSpriteSheet("Global/Display.gif")169SpriteFrame(-16, -16, 32, 32, 1, 143)170171SetVariableAlias(ALIAS_VAR_PROPVAL, "unused")172end event173174175