Path: blob/main/Scripts/Special/WaterSplash.txt
1319 views
//----------------Sonic CD WaterSplash Script-----------------//1//--------Scripted by Christian Whitehead 'The Taxman'--------//2//-------Unpacked By Rubberduckycooly's Script Unpacker-------//34// Aliases56// HUD Alias7#alias Object.Value7 : HUD.WaterTimer89// Player Alises10#alias Player.XPos : SSSonic.XPos11#alias Player.YPos : SSSonic.YPos12#alias Object.Value0 : SSSonic.ZPos1314// Stage SFX15#alias 1 : SFX_S_WATERSPLASH1617// Tile Info18#alias 6 : TILEINFO_ANGLEA192021sub ObjectDraw22if SSSonic.YPos > 023// If Sonic's in the air, he certainly isn't splashing around anymore so unload24ResetObjectEntity(3, TypeName[Blank Object], 0, 0, 0)25else2627// Find the player's truncated X and Z pos2829TempValue0 = SSSonic.XPos30TempValue0 >>= 163132TempValue1 = SSSonic[-1].ZPos33TempValue1 >>= 163435// Get the tile type Sonic's currently standing on36Get16x16TileInfo(CheckResult, TempValue0, TempValue1, TILEINFO_ANGLEA)3738// Is it a water tile?39if CheckResult == 24041if Object.Frame == 042PlayStageSfx(SFX_S_WATERSPLASH, false)4344if Stage.TimeEnabled == true45HUD[4].WaterTimer = 4046end if47end if4849// Animate the object50Object.Frame++51if Object.Frame == 4052Object.Frame = 2853end if5455// Get the frame it should draw56TempValue0 = Object.Frame57TempValue0 >>= 25859// Draw the sprite around the center of the screen60DrawSpriteScreenXY(TempValue0, Screen.CenterX, 224)6162else63// Sonic's not on a water tile, erase the Water Splash object64ResetObjectEntity(3, TypeName[Blank Object], 0, 0, 0)65HUD[4].WaterTimer = 066end if67end if6869end sub707172sub ObjectStartup7374LoadSpriteSheet("Special/Objects.gif")7576// Water Splash Frames77SpriteFrame(-20, -32, 40, 32, 1, 84)78SpriteFrame(-20, -32, 40, 32, 42, 84)79SpriteFrame(-20, -32, 40, 32, 83, 84)80SpriteFrame(-20, -48, 40, 48, 124, 58)81SpriteFrame(-20, -64, 40, 64, 165, 58)82SpriteFrame(-20, -8, 40, 8, 124, 107)83SpriteFrame(-20, -8, 40, 8, 124, 116)84SpriteFrame(-20, -32, 40, 32, 42, 84)85SpriteFrame(-20, -32, 40, 32, 83, 84)86SpriteFrame(-20, -32, 40, 32, 1, 84)8788end sub899091// ========================92// Editor Subs93// ========================9495sub RSDKDraw96DrawSprite(0)97end sub9899100sub RSDKLoad101LoadSpriteSheet("Special/Objects.gif")102SpriteFrame(-20, -32, 40, 32, 42, 84)103104SetVariableAlias(ALIAS_VAR_PROPVAL, "unused")105end sub106107108