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

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

private alias object.value0 : object.timer


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

event ObjectUpdate
	object.timer++
	if object.timer == 12
		object.type = TypeName[Blank Object]
	end if
end event


event ObjectDraw
	temp0 = object.timer
	temp0 >>= 1
	DrawSpriteFX(temp0, FX_FLIP, object.xpos, object.ypos)
end event


event ObjectStartup
	// Check which sprites to load based on current folder
	
		// Currently in GHZ (or a mission)
		LoadSpriteSheet("GHZ/Objects.gif")
		SpriteFrame(-2, -2, 4, 4, 143, 235)
		SpriteFrame(-2, -2, 0, 0, 143, 235)
		SpriteFrame(-2, -2, 4, 4, 143, 235)
		SpriteFrame(-2, -2, 0, 0, 143, 235)
		SpriteFrame(-4, -4, 8, 8, 148, 235)
		SpriteFrame(-4, -4, 0, 0, 148, 235)
		SpriteFrame(-4, -4, 8, 8, 148, 235)
		SpriteFrame(-4, -4, 0, 0, 148, 235)
		SpriteFrame(-4, -4, 8, 8, 157, 235)
		SpriteFrame(-4, -4, 0, 0, 157, 235)
		SpriteFrame(-4, -4, 8, 8, 157, 235)
		SpriteFrame(-4, -4, 0, 0, 157, 235)
	
end event


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

event RSDKDraw
	DrawSprite(0)
end event


event RSDKLoad
	// Since Origins uses Motobugs everywhere, just use GHZ sprites as a fallback whenever not in MBZ
		LoadSpriteSheet("GHZ/Objects.gif")
		SpriteFrame(-2, -2, 4, 4, 143, 235)

	SetVariableAlias(ALIAS_VAR_PROPVAL, "unused")
end event
