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

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

private alias 1 : BODYPART_DESTROYED


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

event ObjectUpdate
	if object.state == BODYPART_DESTROYED
		// Update falling movements
		
		object.xpos += object.xvel
		object.ypos += object.yvel
		object.yvel += 0x3800

		if object.outOfBounds == true
			object.type = TypeName[Blank Object]
		end if
	end if
end event


event ObjectDraw
	DrawSpriteFX(object.frame, FX_FLIP, object.xpos, object.ypos)
end event


event ObjectStartup
	CheckCurrentStageFolder("Zone12")
	if checkResult == true
		LoadSpriteSheet("DEZ/Objects.gif")
		SpriteFrame(-12, -12, 24, 24, 487, 125)
	else
		LoadSpriteSheet("MBZ/Objects.gif")
		SpriteFrame(-12, -12, 24, 24, 999, 125)
	end if
end event


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

event RSDKDraw
	DrawSprite(0)
end event


event RSDKLoad
	CheckCurrentStageFolder("Zone12")
	if checkResult == true
		LoadSpriteSheet("DEZ/Objects.gif")
		SpriteFrame(-12, -12, 24, 24, 487, 125)
	else
		LoadSpriteSheet("MBZ/Objects.gif")
		SpriteFrame(-12, -12, 24, 24, 999, 125)
	end if

	SetVariableAlias(ALIAS_VAR_PROPVAL, "unused")
end event
