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

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

private alias object.value0 : object.timer

private alias 0 : LAVASPLASH_START
private alias 1 : LAVASPLASH_MAIN

event ObjectUpdate
	switch object.state
	case LAVASPLASH_START
		object.frame = object.animationTimer
		object.frame /= 3
		object.animationTimer++
		if object.animationTimer == 6
			object.animationTimer = 0
			object.timer++
			if object.timer == 6
				object.timer = 0
				object.state++
			end if
		end if
		break

	case LAVASPLASH_MAIN
		object.frame = object.animationTimer
		object.frame /= 3
		object.frame += 2
		object.animationTimer++
		if object.animationTimer == 6
			object.animationTimer = 0
			object.timer++
			if object.timer == 2
				object.type = TypeName[Blank Object]
			end if
		end if
		break
		
	end switch
end event


event ObjectDraw
	DrawSprite(object.frame)
end event


event ObjectStartup
	LoadSpriteSheet("MZ/Objects.gif")
	SpriteFrame(-56, -18, 112, 30, 288, 332)
	SpriteFrame(-55, -18, 110, 30, 401, 332)
	SpriteFrame(-24, -18, 48, 30, 268, 1)
	SpriteFrame(-23, -18, 46, 30, 270, 32)
end event


event RSDKDraw
	DrawSprite(0)
end event


event RSDKLoad
	LoadSpriteSheet("MZ/Objects.gif")
	SpriteFrame(-56, -18, 112, 30, 288, 332)
	SpriteFrame(-55, -18, 110, 30, 401, 332)
	SpriteFrame(-24, -18, 48, 30, 268, 1)
	SpriteFrame(-23, -18, 46, 30, 270, 32)
	
	SetVariableAlias(ALIAS_VAR_PROPVAL, "unused")
end event
