using UnityEngine;
using System.Collections;

public class DoorTeenGarden : Door {

	void Start () {
		room = FindObjectOfType<Room>();
		gc = GameController.instance;
		if(GameController.hasUnlockedTeenGardenDoor){
			locked = false;
		}
	}
	void OnTriggerEnter2D(){
		if(locked){
			if(GameController.inventory.Contains(items.Key)){
				gc.SendMessage ("LoseItem",items.Key);
				room.SendMessage ("ShowMessage","You use the key to unlock the front door.");
				locked = false;
				GameController.hasUnlockedTeenGardenDoor = true;
			} else{
				room.ShowObjText(lockedTxt);
			}
		} else {
			if(!GameController.hasMakeup || !GameController.inventory.Contains (items.Boots)){
				room.SendMessage ("ShowMessage","You're not going out without makeup and your boots!");
			} else{
				room.ShowObjText(activeTxt);
				room.player.SendMessage ("SetExit",exit);
				GameController.roomStart = otherRoomStart;
			}
		}
	}
}
