using UnityEngine;
using UnityEngine.UI;
using System.Collections;

public class DialogueSystem : MonoBehaviour {

	public int storyInd = 0;
	public Text playerTxt, socTxt;
	public Sprite pSprite, slSprite, sm1Sprite, sm2Sprite;

	// Use this for initialization
	void Start () {
		int storyInd = 0;
	}
	
	// Update is called once per frame
	void Update () {
		switch(storyInd)
		{
		case 0:
			playerTxt.text = "";
			socTxt.text = "Society Leader: Greetings initiate, welcome to the Lovecraft Appreciation Society.";
			GetComponent<SpriteRenderer>().sprite = slSprite;
			break;
		case 1:
			playerTxt.text = "You: Uhh… thanks? Nice to meet you guys, I’m…";
			socTxt.text = "";
			GetComponent<SpriteRenderer>().sprite = pSprite;
			break;
		case 2:
			playerTxt.text = "You: Uhh… thanks? Nice to meet you guys, I’m…";
			socTxt.text = "";
			GetComponent<SpriteRenderer>().sprite = pSprite;
			break;
		case 3:
			playerTxt.text = "";
			socTxt.text = "Society Leader: Silence!";
			GetComponent<SpriteRenderer>().sprite = slSprite;
			break;
		case 4:
			playerTxt.text = "You: Umm…";
			socTxt.text = "";
			GetComponent<SpriteRenderer>().sprite = pSprite;
			break;
		case 5:
			playerTxt.text = "";
			socTxt.text = "Society Leader: Membership to our society does not come without cost. In order to join our esteemed ranks, you must complete your initiation ritual.";
			GetComponent<SpriteRenderer>().sprite = slSprite;
			break;
		case 6:
			playerTxt.text = "You: Sweet… is this sort of like what the frats do? There’s going to be beer, right?";
			socTxt.text = "";
			GetComponent<SpriteRenderer>().sprite = pSprite;
			break;
		case 7:
			playerTxt.text = "";
			socTxt.text = "Society Member 1: I could go for some beer…";
			GetComponent<SpriteRenderer>().sprite = sm1Sprite;
			break;
		case 8:
			playerTxt.text = "";
			socTxt.text = "Society Leader: Silence, Lauren!";
			GetComponent<SpriteRenderer>().sprite = slSprite;
			break;
		case 9:
			playerTxt.text = "";
			socTxt.text = "Society Leader: There will be no beer at this initiation. You must seek out seven unholy lovecraftian tomes which have been scattered to the four winds.";
			GetComponent<SpriteRenderer>().sprite = slSprite;
			break;
		case 10:
			playerTxt.text = "You: Four winds?";
			socTxt.text = "";
			GetComponent<SpriteRenderer>().sprite = pSprite;
			break;
		case 11:
			playerTxt.text = "";
			socTxt.text = "Lauren: She means on campus, Kian dropped them everywhere. He’s a bit clumsy.";
			GetComponent<SpriteRenderer>().sprite = sm1Sprite;
			break;
		case 12:
			playerTxt.text = "";
			socTxt.text = "Kian: Look, I said I’m sorry guys...";
			GetComponent<SpriteRenderer>().sprite = sm2Sprite;
			break;
		case 13:
			playerTxt.text = "";
			socTxt.text = "Society Leader: Silence! -and anyway, the four winds sounds cool.";
			GetComponent<SpriteRenderer>().sprite = slSprite;
			break;
		case 14:
			playerTxt.text = "";
			socTxt.text = "Kian: Whatever... Alex";
			GetComponent<SpriteRenderer>().sprite = sm2Sprite;
			break;
		case 15:
			playerTxt.text = "";
			socTxt.text = "Alex: *Sigh* Retrieve these seven artefacts and bring them to us. Then, your initiation will be complete.";
			GetComponent<SpriteRenderer>().sprite = slSprite;
			break;
		case 16:
			playerTxt.text = "You: Then will there be beer?";
			socTxt.text = "";
			GetComponent<SpriteRenderer>().sprite = pSprite;
			break;
		case 17:
			playerTxt.text = "";
			socTxt.text = "Alex: Ugh… okay, we’ll go to the student bar afterwards, alright?";
			GetComponent<SpriteRenderer>().sprite = slSprite;
			break;
		case 18:
			playerTxt.text = "You: Sweet.";
			socTxt.text = "";
			GetComponent<SpriteRenderer>().sprite = pSprite;
			break;
		case 19:
			playerTxt.text = "";
			socTxt.text = "Kian: Be warned, there are those who do not understand our ways.";
			GetComponent<SpriteRenderer>().sprite = sm2Sprite;
			break;
		case 20:
			playerTxt.text = "";
			socTxt.text = "Lauren: Stupid jocks...";
			GetComponent<SpriteRenderer>().sprite = sm1Sprite;
			break;
		case 21:
			playerTxt.text = "";
			socTxt.text = "Alex: Yeah, they don’t like us. Try to avoid them.";
			GetComponent<SpriteRenderer>().sprite = slSprite;
			break;
		case 22:
			playerTxt.text = "You: So... avoid people and get the books?";
			socTxt.text = "";
			GetComponent<SpriteRenderer>().sprite = pSprite;
			break;
		case 23:
			playerTxt.text = "";
			socTxt.text = "Alex: Tomes, but yes.";
			GetComponent<SpriteRenderer>().sprite = slSprite;
			break;
		case 24:
			playerTxt.text = "You: Alright, I’m off. See you when I get back.";
			socTxt.text = "";
			GetComponent<SpriteRenderer>().sprite = pSprite;
			break;
		case 25:
			playerTxt.text = "";
			socTxt.text = "Alex: Indeed, now. We must prepare.";
			GetComponent<SpriteRenderer>().sprite = slSprite;
			break;
		case 26:
			playerTxt.text = "";
			socTxt.text = "Kian: You’re talking about pre-drinks before we go to the bar right? It’s expensive there.";
			GetComponent<SpriteRenderer>().sprite = sm2Sprite;
			break;
		case 27:
			playerTxt.text = "";
			socTxt.text = "Lauren: No Kian she means the summoning ritual.";
			GetComponent<SpriteRenderer>().sprite = sm1Sprite;
			break;
		case 28:
			playerTxt.text = "";
			socTxt.text = "Kian: Oh. Right, of course.";
			GetComponent<SpriteRenderer>().sprite = sm2Sprite;
			break;
		case 29:
			//load game
			Application.LoadLevel (2);
			break;
		}
		if(Input.GetMouseButtonDown(0))
		{
			storyInd++;
		}

	}
}
