"use strict";

// Special-event mirror not-door-per-se
var GO_Mirror = function(checkEvent,broken){
	this.sprite = new Sprite(GO_Mirror.spriteSheet,"Mirror");
	this.sprite.collision_flags = 
		DEFINE_SPRITE_COLLISION_FLAGS.SPRITES_PASSIVE;
	this.sprite.setBoundingBox(4,4,27,27);
	this.sprite.game_object = this; // no longer a generic GO

	this.name = "Mirror";

	// note this event will only really work right
	// as the 1-time-use chain in Catacombs 5
	//this._makeCheckable(checkEvent || "Reflecting");
	// the Reflecting event will trigger a room change based on player choice,
	// so still kinda a door

	this.checkEventName = checkEvent || "Reflecting";
	this.broken = broken ? true : false;

	this.sprite.frame = broken ? 1 : 0;
};
GO_Mirror.spriteImg = SDS_Load_Image("art/sheets/sprite/mirror.png");
GO_Mirror.spriteSheet = new TileSheet(5, 5, 1, 0, GO_Mirror.spriteImg);

GO_Mirror.prototype = new GameObject(
	new Sprite(
		GO_Mirror.spriteSheet,
		"Mirror"
	),
	"Mirror"
	);

	GO_Mirror.prototype.interactions = 
		DEFINE_GAMEOBJECT_INTERACTIONS.CHECK;

	GO_Mirror.prototype.Update = function(){

	};

	GO_Mirror.prototype.checkEvent = function(){
		if (this.broken){
			return "GD_Cat5_cloudy";
		}
		else{
			return this.checkEventName;
		}
	};