using UnityEngine;
using System.Collections;

public class Taurus : Graph {

    public Controller controller;
	// Use this for initialization
	void Awake () {
        currentState = startState;
	}
	
	// Update is called once per frame
	void Update () {
        ChangeState();
	}

    void ChangeState() {
        
        switch (currentState)
        {
            case Constants.Colors.CYAN: {
                    ControlCyan();
                    break;
            }
            case Constants.Colors.BLUE: {
                    ControlBlue();
                    break;
                }
            case Constants.Colors.PURPLE: {
                    ControlPurple();
                    break;
                }
            case Constants.Colors.DARKGREEN: {
                    ControlDarkGreen();
                    break;
                }
            case Constants.Colors.MOUSTARD: {
                    ControlMoustard();
                    break;
                }

        }
    }

    void ControlMoustard() {
        if(controller.ings.Count==2 && controller.ings[1] == "Bone Dust" && controller.ings[0] == "SR") {
            currentState = Constants.Colors.CYAN;
            controller.ings.Clear();
        }
    }

    void ControlDarkGreen() {
        if (controller.ings.Count == 1 && controller.ings[0] == "Dragon's Claw") {
            currentState = Constants.Colors.CYAN;
            controller.ings.Clear();
        }
    }

    void ControlPurple() {
        if (controller.ings.Count == 1 && controller.ings[0] == "Troll Snot") {
            currentState = Constants.Colors.CYAN;
            controller.ings.Clear();
        }
    }
    
    void ControlCyan() {
        if (controller.ings.Count == 1 && controller.ings[0] == "Poppy Seeds") {
            currentState = Constants.Colors.PURPLE;
            controller.ings.Clear();
        }
        else if(controller.ings.Count == 1 && controller.ings[0] == "Eye of The Tiger") {
            currentState = Constants.Colors.DARKGREEN;
            controller.ings.Clear();
        }
        else if (controller.ings.Count == 2 && controller.ings[1] == "SL" && controller.ings[0] == "SL") {
            currentState = Constants.Colors.BLUE;
            controller.ings.Clear();
        }
        else if (controller.ings.Count == 2 && controller.ings[1] == "SL" && controller.ings[0] == "Dragon's Blood") {
            currentState = Constants.Colors.MOUSTARD;
            controller.ings.Clear();
        }
    }

    void ControlBlue() {
        if (controller.ings.Count == 2 && controller.ings[1] == "SR" && controller.ings[0] == "SR") {
            currentState = Constants.Colors.CYAN;
            controller.ings.Clear();
        }
    }
}
