using UnityEngine;
using System.Collections;

public class Vase : Item {

	GameObject whole, pieces;
	void Start () {
		gc = GameController.instance;
		room = FindObjectOfType<Room>();
		whole = GameObject.Find ("Whole");
		pieces = GameObject.Find ("Pieces");
		if(GameController.brokenVase){
			whole.SetActive (false);
			collider2D.enabled = false;
			pieces.SetActive (true);
		} else {
			whole.SetActive (true);
			pieces.SetActive (false);
		}
	}

	void Action(){
		if(GameController.hasDog){
			whole.SetActive (false);
			collider2D.enabled = false;
			pieces.SetActive (true);
			GameController.brokenVase=true;
			audio.Play ();

			room.player.SendMessage ("UnsetInteractiveItem");
			room.SendMessage("HideObjText");
			room.SendMessage ("ShowMessage","Oops!\nOh look! The TV button box!");
			gc.SendMessage ("PickItem",items.Remote);
		} else{
			room.player.SendMessage ("UnsetInteractiveItem");
			room.SendMessage("HideObjText");
			room.SendMessage ("ShowMessage","The vase is too high up.");
		}
	}

}
