using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.SceneManagement;

public class Date : MonoBehaviour {


	public Slider fuckometer;
	public GameObject[] faces = new GameObject[5];

	public float[] personalities = new float[7];
	//0:kinky
	//1:dom
	//2:direct
	//3:std
	//4:serious
	//5:romantic
	//6:confidence
	public bool[] moods = new bool[4];
	//0/7:aroused
	//1/8:angry
	//2/9:sad
	//3/10:happy
	public float love = 25;

	public int curMood = -1;

	void Start()
	{
		faces [4].SetActive (true);
		fuckometer.value = love;
		for (int i = 0; i < personalities.Length; ++i) {
			personalities [i] = Random.Range (-1, 1);
		}
	}

	public void setMood(int mood)
	{
		curMood = mood;
		for (int i = 0; i < 5; ++i) {
			faces [i].SetActive (false);
		}
		if (mood == -1) {
			faces [4].SetActive (true);
		} else {
			faces [curMood].SetActive (true);
		}
	}

	public void changeLove(float diff)
	{
		love += diff;
		fuckometer.value = love;
	}

    public void Sex()
    {
		if(fuckometer.value >= 50)
        {
            SceneManager.LoadScene("victory");
        }
		if (fuckometer.value <= 0)
        {
            SceneManager.LoadScene("loser");
        }
    }

    private void FixedUpdate()
    {
        Sex();
    }
}
