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

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

// States
private alias 0 : HULL_CLOSED
private alias 1 : HULL_OPEN


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

event ObjectUpdate
	if object.state == HULL_OPEN
		object.alpha -= 8
		if object.alpha <= 0
			object.type = TypeName[Blank Object]
		end if
	end if
end event


event ObjectDraw
	if object.state == HULL_CLOSED
		DrawSprite(0)
	else
		DrawSpriteFX(0, FX_INK, object.xpos, object.ypos)
	end if
end event


event ObjectStartup
	LoadSpriteSheet("SCZ/Objects2.gif")
	SpriteFrame(-256, -96, 512, 192, 0, 0)

	foreach (TypeName[Hull], arrayPos0, ALL_ENTITIES)
		object[arrayPos0].drawOrder = 5
		object[arrayPos0].priority 	= PRIORITY_ACTIVE
	next
end event


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

event RSDKDraw
	DrawSprite(0)
end event


event RSDKLoad
	LoadSpriteSheet("SCZ/Objects2.gif")
	SpriteFrame(-256, -96, 512, 192, 0, 0)
	
	SetVariableAlias(ALIAS_VAR_PROPVAL, "unused")
end event
