Path: blob/main/Scripts/R4/BossWaterTrigger.txt
1319 views
//-------------Sonic CD Boss Water Trigger Script-------------//1//--------Scripted by Christian Whitehead 'The Taxman'--------//2//-------Unpacked By Rubberduckycooly's Script Unpacker-------//34// Aliases5#alias Object.Value0 : Object.WaterEntity6#alias Object.YPos : Water.YPos78// Property Values9#alias 0 : BOSSWATERTRIGGER_RAISE_WATER10#alias 1 : BOSSWATERTRIGGER_SET_Y_BOUNDS111213sub ObjectMain14switch Object.PropertyValue15case BOSSWATERTRIGGER_RAISE_WATER16if Player.XPos > Object.XPos17// Y - 1172 in map coords18if Stage.NewWaterLevel > 0x494000019Stage.NewWaterLevel = 0x49400002021ArrayPos0 = Object.WaterEntity2223Water[ArrayPos0].YPos = Screen.YOffset24Water[ArrayPos0].YPos += 25625Water[ArrayPos0].YPos <<= 162627Stage.YBoundary2 = 149628end if29else30// Y - 3072 in map coords31if Stage.NewWaterLevel < 0xC00000032Stage.NewWaterLevel = 0xC00000033Stage.NewYBoundary2 = 230434end if3536ArrayPos0 = Object.WaterEntity3738TempValue0 = Screen.YOffset39TempValue0 += 25640TempValue0 <<= 1641if Water[ArrayPos0].YPos >= TempValue042Water[ArrayPos0].YPos = 0xC00000043end if44end if45break4647case BOSSWATERTRIGGER_SET_Y_BOUNDS48if Player.XPos > Object.XPos49Stage.NewYBoundary2 = 144850else51Stage.NewYBoundary2 = 149652end if53break54end switch55end sub565758sub ObjectStartup59ArrayPos0 = 3260while ArrayPos0 < 105661if Object[ArrayPos0].Type == TypeName[Water]62TempValue0 = ArrayPos063end if64ArrayPos0++65loop6667ArrayPos0 = 3268while ArrayPos0 < 105669if Object[ArrayPos0].Type == TypeName[BossWaterTrigger]70Object[ArrayPos0].WaterEntity = TempValue071end if72ArrayPos0++73loop74end sub757677// ========================78// Editor Subs79// ========================8081sub RSDKDraw82DrawSprite(0)83end sub848586sub RSDKLoad87LoadSpriteSheet("Global/Display.gif")88SpriteFrame(-16, -16, 32, 32, 1, 143) // #0 - "Script" Icon8990SetVariableAlias(ALIAS_VAR_PROPVAL, "unused")91end sub929394