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

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

event ObjectUpdate
	foreach (TypeName[Water], arrayPos0, ALL_ENTITIES)
		object[arrayPos0].state = 1
		object[arrayPos0].ypos = stage.newWaterLevel
	next
	
	object.type = TypeName[Blank Object]
end event


event ObjectStartup
	foreach (TypeName[PullUpWater], arrayPos0, ALL_ENTITIES)
		object[arrayPos0].priority = PRIORITY_ACTIVE
	next
end event


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

event RSDKDraw
	object.inkEffect = INK_BLEND
	
	//GetObjectType(temp2, "Water")
	// wanna draw a line from the water y pos, but there's no good way to find where that is :(
	// TODO: do
	
	temp0 = object.xpos
	temp1 = 700
	temp1 += object.ypos
	while temp0 < temp1
		DrawSpriteFX(0, FX_INK, temp0, object.ypos)
		temp0 += 0x1000000
	loop
end event


event RSDKLoad
	LoadSpriteSheet("CPZ/Objects2.gif")
	SpriteFrame(0, -8, 256, 16, 0, 0)
	
	SetVariableAlias(ALIAS_VAR_PROPVAL, "unused")
end event
