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

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

private alias object.value0 : object.interval


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

event ObjectUpdate
	// empty :(
end event


event ObjectDraw
	temp0 = oscillation
	temp0 += object.propertyValue
	temp0 &= 1
	temp0 &= object.interval
	if temp0 == 1
		DrawSprite(0)
	end if
end event


event ObjectStartup
	LoadSpriteSheet("SCZ/Objects.gif")
	SpriteFrame(-16, -14, 32, 28, 203, 90)

	foreach (TypeName[Eggman Thruster], arrayPos0, ALL_ENTITIES)
		if object[arrayPos0].propertyValue == 0
			object[arrayPos0].interval = 1
		end if
	next
end event


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

event RSDKEdit
	if editor.returnVariable == true
		switch editor.variableID
		case EDIT_VAR_PROPVAL // property value
			checkResult = object.propertyValue
			break
			
		case 0 // type
			checkResult = object.propertyValue
			break
			
		end switch
	else
		switch editor.variableID
		case EDIT_VAR_PROPVAL // property value
			object.propertyValue = editor.variableValue
			break
			
		case 0 // type
			object.propertyValue = editor.variableValue
			break
			
		end switch
	end if
end event


event RSDKDraw
	DrawSprite(0)
end event


event RSDKLoad
	LoadSpriteSheet("SCZ/Objects.gif")
	SpriteFrame(-16, -14, 32, 28, 203, 90)

	AddEditorVariable("type")
	SetActiveVariable("type")
	AddEnumVariable("Start Active", 0)
	AddEnumVariable("Start Inactive", 1)
end event
