using UnityEngine;
using System.Collections;

public class Cupboard : Item {

	void Action(){
		if(GameController.inventory.Contains(items.Knife)){
			audio.Play ();
			gc.SendMessage("LoseItem",items.Knife);
			room.SendMessage ("ShowMessage","You prise the drawer open with the knife.\nAha! You find the key to the front door.");
			gc.SendMessage("PickItem", items.Key);
			room.player.SendMessage ("UnsetInteractiveItem");
			room.SendMessage("HideObjText");
			Destroy (gameObject);
		} else{
			if(!GameController.inventory.Contains(items.Key)){
				room.SendMessage ("ShowMessage","Hmmm. Can't open it. Seems to be stuck.");
			}
		}
	}
}
