using UnityEngine;
using System.Collections;

public class TV : Item {

	void Action(){
		if(GameController.inventory.Contains (items.Remote)){
			StartCoroutine (SwitchOn());
		} else {
			room.HideObjText();
			room.player.SendMessage ("UnsetInteractiveItem");
			room.SendMessage ("ShowMessage","You cannot reach the TV.\nIf only you knew where your parents hid that box with buttons.");
		}

	}
	IEnumerator SwitchOn(){
		room.player.rigidbody2D.velocity = Vector2.zero;
		Destroy(room.player);
		room.SendMessage ("ShowMessage","You press all the nice buttons on the box and the TV goes on.\nOooooooh! You're going to be spending some time here.");
		yield return new WaitForSeconds(room.msgTime +room.msgFadeTime);
		gc.Penalty (20f);
		gc.SendMessage ("ClearChildItems");
		Application.LoadLevel("ChildLandingDn");
	}

}
