using UnityEngine;
using System.Collections;

public class NoBrush : Ritual {
    private const int DESIRED = 2;
    private Vector3 BUBBLE_OFFSET = new Vector3(0, 100, 0);

    public override float validate()
    {
        int count = 0;

        Slot slot;
        Item item;

        for (int i = 0; i < person.slots.Length; ++i)
        {
            slot = person.slots[i];
            item = slot.item;

            if (item != null)
            {
                if (item.gameObject.GetComponent<Toothbrush>() != null)
                {
                    count = 1;
                }
                else if (count == 1) {
                    if ((item.gameObject.GetComponent<Pizza>() != null) ||
                        (item.gameObject.GetComponent<Cigarette>() != null) ||
                        (item.gameObject.GetComponent<Coffee>() != null))
                    {
                        /*
                        Bubble bubble = GameObject.Instantiate(GameObject.FindObjectOfType<Level>().bubble) as Bubble;
                        bubble.setSprite(item.gameObject.GetComponent<SpriteRenderer>().sprite);
                        bubble.transform.position = slot.transform.position + BUBBLE_OFFSET;//*/

                        return -1f;
                    }
                }
            }
        }

        return count == 1 ? 1f : 0f;
    }
}
