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

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

// Player Aliases
private alias 0 : SLOT_PLAYER1

// Achievement Aliases
private alias 2 : ACHIEVEMENT_SECRETOFMZ


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

event ObjectUpdate
	// Check interaction with player 1
	BoxCollisionTest(C_TOUCH, object.entityPos, -16, -64, 16, 64, SLOT_PLAYER1, C_BOX, C_BOX, C_BOX, C_BOX)
	if checkResult == true
		if stage.debugMode == false
			// Grant the "Secret of Marble Zone" Achievement
			CallNativeFunction2(SetAchievement, ACHIEVEMENT_SECRETOFMZ, 100)
		end if
		
		// This object serves no purpose anymore, so we may as well clear it now
		object.type = TypeName[Blank Object]
	end if
end event


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

event RSDKDraw
	DrawSprite(0)
	
	if editor.showGizmos == true
		editor.drawingOverlay = true
		
		// Draw the sensor hitbox
		temp0 = -16; temp1 = -64; temp2 = 16; temp3 = 64;
		CallFunction(EditorHelpers_DrawHitbox)
		
		editor.drawingOverlay = false
	end if
end event


event RSDKLoad
	LoadSpriteSheet("Global/Display.gif")
	SpriteFrame(-8, -8, 16, 16, 239, 239) // "Trigger"
	
	SetVariableAlias(ALIAS_VAR_PROPVAL, "unused")
end event
