// ----------------------------------
// RSDK Project: Sonic 2
// Script Description: Water Splash Object
// Script Author: Christian Whitehead/Simon Thomley
// Unpacked by Rubberduckycooly's script unpacker
// ----------------------------------

// ========================
// Aliases
// ========================

private alias object.value0 : object.timer


// ========================
// Events
// ========================

event ObjectUpdate
	object.iypos = stage.waterLevel

	object.timer++
	if object.timer > 3
		object.timer = 0
		object.frame++
		if object.frame > 8
			object.type = TypeName[Blank Object]
		end if
	end if
end event


event ObjectDraw
	DrawSprite(object.frame)
end event


event ObjectStartup
	// Out of all the Water-related objects in ARZ, this and Water are the only ones to correctly load the ARZ version of the Objects3 sheet
	// The rest all load "CPZ/Objects3.gif" instead, which obviously doesn't belong in ARZ, but the colours align well enough to where there's
	//  no visible palette errors, so this oversight went unnoticed by the devs
	LoadSpriteSheet("ARZ/Objects3.gif")
	
	SpriteFrame(-10, -32, 20, 32, 1, 95)
	SpriteFrame(-15, -32, 30, 32, 22, 95)
	SpriteFrame(-15, -32, 30, 32, 53, 95)
	SpriteFrame(-15, -32, 30, 32, 85, 95)
	SpriteFrame(-16, -31, 31, 31, 116, 96)
	SpriteFrame(-16, -31, 32, 31, 148, 96)
	SpriteFrame(-16, -31, 32, 31, 181, 96)
	SpriteFrame(-16, -16, 32, 16, 214, 96)
	SpriteFrame(-16, -15, 32, 15, 214, 112)
end event


// ========================
// Editor Events
// ========================

event RSDKDraw
	DrawSprite(0)
end event


event RSDKLoad
	LoadSpriteSheet("ARZ/Objects3.gif")
	SpriteFrame(-16, -31, 31, 31, 116, 96)
	
	SetVariableAlias(ALIAS_VAR_PROPVAL, "unused")
end event
