Commit 483f446f authored by Mitchie Maluschnig's avatar Mitchie Maluschnig
Browse files

characters levels affect ahavas level and the Stage of the game. characters...

characters levels affect ahavas level and the Stage of the game. characters have different dialogue based on the stage of the game
parent 34231a79
......@@ -68,7 +68,12 @@ public class CharacterInteractions : MonoBehaviour {
}
}
} else {//if the player is currently interacting
if (Input.GetKeyDown(KeyCode.W) || Input.GetKeyDown(KeyCode.UpArrow) || Input.GetKeyDown(KeyCode.E)) {
if (Input.GetKeyDown(KeyCode.W) || Input.GetKeyDown(KeyCode.UpArrow) || Input.GetKeyDown(KeyCode.E)) {//conversing
//stage 1, ahava asks player for name
if (characterScript.getName() == "Ahava" && GameManager.ConversationStage == 1 && GameManager.speechState == 4) {
//create input field
print("GetMame");
}
setText(speechBox, characterScript.converse(), Mathf.Infinity, characterScript.getResponses());
}
}
......@@ -121,7 +126,7 @@ public class CharacterInteractions : MonoBehaviour {
DialogueUI.gameObject.SetActive(true);
updateFaceCamDisplay();
box.text = text;
LevelMeter.fillAmount = characterScript.getLevel();
LevelMeter.fillAmount = characterScript.getLevel() % 1;
print(text);
//setting player reply options
for (int i = 0; i < playerResponses.Length; i++) {
......
......@@ -9,17 +9,39 @@ public class AhavaSpeech : MonoBehaviour, Character {
private Queue<string[]> responseQueue = new Queue<string[]>();
private string[] currentResponses;
private bool AskingForName;
public float getLevel() {
return GameManager.AhavaLevel;
}
public string getName() {
return "Ahava";
}
public string GreetingMessage(){
loadConversation();
currentResponses = new string[] { "Hi there", "Who are you", "what is this place" };
return "Hello Player, I am Ahava";
if (GameManager.ConversationStage == 1) {
currentResponses = new string[] { "Hi there", "Who are you", "what is this place" };
return "Hello Player, I am Ahava";
} else if (GameManager.ConversationStage == 2) {
currentResponses = new string[] { "stage 2 greeting response" };
return "well done on your performances!";
} else if (GameManager.ConversationStage == 3) {
currentResponses = new string[] { "stage 3 greeting response" };
return "stage 3 greeting";
} else if (GameManager.ConversationStage == 4) {
currentResponses = new string[] { "stage 4 greeting response" };
return "stage 4 greeting";
}
return "Something has gone terribly wrong: The stage is: " + GameManager.ConversationStage;
}
public string GoodbyeMessage(){
currentResponses = new string[] {};
return "See you soon!";
......@@ -39,12 +61,13 @@ public class AhavaSpeech : MonoBehaviour, Character {
if (Random.Range(0, 1f) < 0.8) {
return "my beard grows tired of your chitter chatter";
} else {
return "begone thot!";
return "Dennis the mennis!";
}
}
public string converse() {
if (conversation.Count > 0) {
GameManager.speechState = conversation.Count;
currentResponses = responseQueue.Dequeue();
return conversation.Dequeue();
} else {
......@@ -56,27 +79,59 @@ public class AhavaSpeech : MonoBehaviour, Character {
conversation.Clear();
responseQueue.Clear();
conversation.Enqueue("welcome to the circus");
responseQueue.Enqueue(new string[] { "response 1"});
if(GameManager.ConversationStage == 1) {
conversationStage1();
conversation.Enqueue("line 2");
responseQueue.Enqueue(new string[] { "response 2", "response 2" });
}else if(GameManager.ConversationStage == 2) {
conversationStage2();
conversation.Enqueue("line 3");
responseQueue.Enqueue(new string[] { "response 3", "response 3", "response 3" });
} else if (GameManager.ConversationStage == 3) {
conversationStage3();
conversation.Enqueue("line 4");
responseQueue.Enqueue(new string[] { "response 4", "response 4" });
} else if (GameManager.ConversationStage == 4) {
conversationStage4();
conversation.Enqueue("line 5");
responseQueue.Enqueue(new string[] { "response 5", "response 5", "response 5" });
}
conversation.Enqueue("line 6");
responseQueue.Enqueue(new string[] { "response 6" });
}
public string[] getResponses() {
return currentResponses;
}
private void conversationStage1() {
conversation.Enqueue("welcome to the circus");
responseQueue.Enqueue(new string[] { "response 1" });
//GameManager.speechState will be the size of the queue when this is in front
//make sure to change the check integer in CharacterInteractins when changing dialogue
conversation.Enqueue("What Is Your Name");
responseQueue.Enqueue(new string[] {});
conversation.Enqueue("Great Name! How about we call you John Smith instead");
responseQueue.Enqueue(new string[] { "I Love it!", "I Hate it!", "I know a guy called John Smith" });
conversation.Enqueue("Maybe We'll just call you Dennnis");
responseQueue.Enqueue(new string[] { "fine", "not Dennis!" });
conversation.Enqueue("No Takebacksies");
responseQueue.Enqueue(new string[] { "" });
}
private void conversationStage2() {
conversation.Enqueue("youre fitting in nicely here, you remind me of Myself when i was younger");
responseQueue.Enqueue(new string[] { "great", "you were young once?", "thanks mum" });
}
private void conversationStage3() {
conversation.Enqueue("Stage 3 conversation stuff");
responseQueue.Enqueue(new string[] { "Stage 3 response 1", "stage 3 resposne 2" });
}
private void conversationStage4() {
conversation.Enqueue("Stage 4 conversation stuff");
responseQueue.Enqueue(new string[] { "Stage 4 response 1", "stage 4 resposne 2" });
}
}
......@@ -5,6 +5,7 @@ using UnityEngine;
public interface Character {
float getLevel();
string getName();
string GreetingMessage();
string GoodbyeMessage();
......
......@@ -14,10 +14,32 @@ public class JohnSmithSpeech : MonoBehaviour, Character {
return GameManager.JohnLevel;
}
public string getName() {
return "John";
}
public string GreetingMessage() {
loadConversation();
currentResponses = new string[] { "Hi there", "Who are you" };
return "Hello, im John Smith";
if (GameManager.ConversationStage == 1) {
currentResponses = new string[] { "Hi there"};
return "Hello, im John Smith";
} else if (GameManager.ConversationStage == 2) {
currentResponses = new string[] { "stage 2 greeting response" };
return "stage 2 (hello) grr";
} else if (GameManager.ConversationStage == 3) {
currentResponses = new string[] { "stage 3 greeting response" };
return "stage 3 (hello) grr";
} else if (GameManager.ConversationStage == 4) {
currentResponses = new string[] { "stage 4 greeting response" };
return "stage 4 (hello) grr";
}
return "Something has gone terribly wrong: The stage is: " + GameManager.ConversationStage;
}
public string GoodbyeMessage() {
currentResponses = new string[] { };
......@@ -55,6 +77,26 @@ public class JohnSmithSpeech : MonoBehaviour, Character {
conversation.Clear();
responseQueue.Clear();
if (GameManager.ConversationStage == 1) {
conversationStage1();
} else if (GameManager.ConversationStage == 2) {
conversationStage2();
} else if (GameManager.ConversationStage == 3) {
conversationStage3();
} else if (GameManager.ConversationStage == 4) {
conversationStage4();
}
}
public string[] getResponses() {
return currentResponses;
}
private void conversationStage1() {
conversation.Enqueue("welcome to the circus");
responseQueue.Enqueue(new string[] { "response 1" });
......@@ -74,7 +116,27 @@ public class JohnSmithSpeech : MonoBehaviour, Character {
responseQueue.Enqueue(new string[] { "response 6" });
}
public string[] getResponses() {
return currentResponses;
private void conversationStage2() {
conversation.Enqueue("Stage 2 conversation stuff");
responseQueue.Enqueue(new string[] { "Stage 2 response 1", "stage 2 resposne 2" });
conversation.Enqueue("Stage 2 conversation stuff 2");
responseQueue.Enqueue(new string[] { "Stage 2 response 1", "stage 2 resposne 2" });
}
private void conversationStage3() {
conversation.Enqueue("Stage 3 conversation stuff");
responseQueue.Enqueue(new string[] { "Stage 3 response 1", "stage 3 resposne 2" });
conversation.Enqueue("Stage 3 conversation stuff 2");
responseQueue.Enqueue(new string[] { "Stage 3 response 1", "stage 3 resposne 2" });
}
private void conversationStage4() {
conversation.Enqueue("Stage 4 conversation stuff");
responseQueue.Enqueue(new string[] { "Stage 4 response 1", "stage 4 resposne 2" });
conversation.Enqueue("Stage 4 conversation stuff 2");
responseQueue.Enqueue(new string[] { "Stage 4 response 1", "stage 4 resposne 2" });
}
}
......@@ -14,10 +14,31 @@ public class SilasSpeech : MonoBehaviour, Character {
return GameManager.SilasLevel;
}
public string getName() {
return "Silas";
}
public string GreetingMessage(){
loadConversation();
currentResponses = new string[] { "Hi there", "Umm hello?", "was geht ab?" };
return "...";
if (GameManager.ConversationStage == 1) {
currentResponses = new string[] { "Hi there", "Umm hello?", "was geht ab?" };
return "...";
} else if (GameManager.ConversationStage == 2) {
currentResponses = new string[] { "stage 2 greeting response" };
return "stage 2 greeetiong";
} else if (GameManager.ConversationStage == 3) {
currentResponses = new string[] { "stage 3 greeting response" };
return "stage 3 greeting";
} else if (GameManager.ConversationStage == 4) {
currentResponses = new string[] { "stage 4 greeting response" };
return "stage 4 greeting";
}
return "Something has gone terribly wrong: The stage is: " + GameManager.ConversationStage;
}
public string GoodbyeMessage(){
currentResponses = new string[] { };
......@@ -64,6 +85,26 @@ public class SilasSpeech : MonoBehaviour, Character {
conversation.Clear();
responseQueue.Clear();
if (GameManager.ConversationStage == 1) {
conversationStage1();
} else if (GameManager.ConversationStage == 2) {
conversationStage2();
} else if (GameManager.ConversationStage == 3) {
conversationStage3();
} else if (GameManager.ConversationStage == 4) {
conversationStage4();
}
}
public string[] getResponses() {
return currentResponses;
}
private void conversationStage1() {
conversation.Enqueue("HaHaHa got you! Thought i was a mime didnt ya?");
responseQueue.Enqueue(new string[] { "wow you fooled me!", "nah not really" });
......@@ -83,7 +124,27 @@ public class SilasSpeech : MonoBehaviour, Character {
responseQueue.Enqueue(new string[] { "It is great!", "please stop talking" });
}
public string[] getResponses() {
return currentResponses;
private void conversationStage2() {
conversation.Enqueue("Stage 2 conversation stuff");
responseQueue.Enqueue(new string[] { "Stage 2 response 1", "stage 2 resposne 2" });
conversation.Enqueue("Stage 2 conversation stuff 2");
responseQueue.Enqueue(new string[] { "Stage 2 response 1", "stage 2 resposne 2" });
}
private void conversationStage3() {
conversation.Enqueue("Stage 3 conversation stuff");
responseQueue.Enqueue(new string[] { "Stage 3 response 1", "stage 3 resposne 2" });
conversation.Enqueue("Stage 3 conversation stuff 2");
responseQueue.Enqueue(new string[] { "Stage 3 response 1", "stage 3 resposne 2" });
}
private void conversationStage4() {
conversation.Enqueue("Stage 4 conversation stuff");
responseQueue.Enqueue(new string[] { "Stage 4 response 1", "stage 4 resposne 2" });
conversation.Enqueue("Stage 4 conversation stuff 2");
responseQueue.Enqueue(new string[] { "Stage 4 response 1", "stage 4 resposne 2" });
}
}
......@@ -14,10 +14,31 @@ public class SimonSpeech : MonoBehaviour, Character {
return GameManager.SimonLevel;
}
public string getName() {
return "Simon";
}
public string GreetingMessage(){
loadConversation();
currentResponses = new string[] { "Hi there", "Who are you", "what is this place" };
return "(happy) grr";
if (GameManager.ConversationStage == 1) {
currentResponses = new string[] { "Wow a bear" };
return "(happy) grr";
} else if (GameManager.ConversationStage == 2) {
currentResponses = new string[] { "stage 2 greeting response" };
return "stage 2 (hello) grr";
} else if (GameManager.ConversationStage == 3) {
currentResponses = new string[] { "stage 3 greeting response" };
return "stage 3 (hello) grr";
} else if (GameManager.ConversationStage == 4) {
currentResponses = new string[] { "stage 4 greeting response" };
return "stage 4 (hello) grr";
}
return "Something has gone terribly wrong: The stage is: " + GameManager.ConversationStage;
}
public string GoodbyeMessage(){
currentResponses = new string[] { };
......@@ -55,6 +76,23 @@ public class SimonSpeech : MonoBehaviour, Character {
conversation.Clear();
responseQueue.Clear();
if (GameManager.ConversationStage == 1) {
conversationStage1();
} else if (GameManager.ConversationStage == 2) {
conversationStage2();
} else if (GameManager.ConversationStage == 3) {
conversationStage3();
} else if (GameManager.ConversationStage == 4) {
conversationStage4();
}
}
private void conversationStage1() {
conversation.Enqueue("grR");
responseQueue.Enqueue(new string[] { "GRR", "..." });
......@@ -74,6 +112,21 @@ public class SimonSpeech : MonoBehaviour, Character {
responseQueue.Enqueue(new string[] { "GRR", "..." });
}
private void conversationStage2() {
conversation.Enqueue("grr (in stage 2)");
responseQueue.Enqueue(new string[] { "stage 2 grr?" });
}
private void conversationStage3() {
conversation.Enqueue("Stage 3 conversation grr");
responseQueue.Enqueue(new string[] { "Stage 3 response 1", "stage 3 resposne 2" });
}
private void conversationStage4() {
conversation.Enqueue("Stage 4 conversation grr");
responseQueue.Enqueue(new string[] { "Stage 4 response 1", "stage 4 resposne 2" });
}
public string[] getResponses() {
return currentResponses;
}
......
......@@ -13,6 +13,14 @@ public class DaytimeManager : MonoBehaviour {
void Start() {
pauseMenu.gameObject.SetActive(false);
GameManager.AhavaLevel = 1
+ GameManager.JohnLevel - 1
+ GameManager.SilasLevel - 1
+ GameManager.SimonLevel - 1;
GameManager.ConversationStage = (int)GameManager.AhavaLevel;
print("ahava Lvl" + GameManager.AhavaLevel);
}
void Update() {
......
......@@ -4,10 +4,13 @@ using UnityEngine;
public class GameManager : MonoBehaviour {
public static float AhavaLevel = 0.5f;
public static float SilasLevel = 0.3f;
public static float SimonLevel = 0.9f;
public static float JohnLevel = 0.8f;
public static float AhavaLevel;
public static float SilasLevel = 1.3f;
public static float SimonLevel = 1.3f;
public static float JohnLevel = 2.1f;
public static int ConversationStage;
public static int speechState;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment