AhavaSpeech.cs 2.34 KB
Newer Older
1
2
3
4
5
using System.Collections;
using System.Collections.Generic;
using UnityEngine;


6
public class AhavaSpeech : MonoBehaviour, Character {
7
8

    private Queue<string> conversation = new Queue<string>();
9
10
11
    private Queue<string[]> responseQueue = new Queue<string[]>();

    private string[] currentResponses;
12

13
14
15
16
17
    public float getLevel() {
        return GameManager.AhavaLevel;
    }


18
    public string GreetingMessage(){
19
        loadConversation();
20
        currentResponses = new string[] { "Hi there", "Who are you", "what is this place" };
21
22
23
        return "Hello Player, I am Ahava";
    }
    public string GoodbyeMessage(){
24
        currentResponses = new string[] {};
25
26
27
28
        return "See you soon!";
    }

    public string ProximityMessage(){
29
        currentResponses = new string[] {};
30
31
32
        return "My beard sense is tingling...";
    }
    public string butthurtGoodbye(){
33
        currentResponses = new string[] {};
34
35
36
37
        return "Didnt want to admire my glorious beard?";
    }

    public string nothingMoreToSay() {
38
        currentResponses = new string[] { };
39
40
41
42
43
44
45
46
47
        if (Random.Range(0, 1f) < 0.8) {
            return "my beard grows tired of your chitter chatter";
        } else {
            return "begone thot!";
        }
    }

    public string converse() {
        if (conversation.Count > 0) {
48
            currentResponses = responseQueue.Dequeue();
49
50
51
52
53
54
55
            return conversation.Dequeue();
        } else {
            return nothingMoreToSay();
        }
    }

    private void loadConversation() {
56
        conversation.Clear();
57
58
        responseQueue.Clear();

59
        conversation.Enqueue("welcome to the circus");
60
61
        responseQueue.Enqueue(new string[] { "response 1"});

62
        conversation.Enqueue("line 2");
63
64
        responseQueue.Enqueue(new string[] { "response 2", "response 2" });

65
        conversation.Enqueue("line 3");
66
67
        responseQueue.Enqueue(new string[] { "response 3", "response 3", "response 3" });

68
        conversation.Enqueue("line 4");
69
70
        responseQueue.Enqueue(new string[] { "response 4", "response 4" });

71
        conversation.Enqueue("line 5");
72
73
        responseQueue.Enqueue(new string[] { "response 5", "response 5", "response 5" });

74
        conversation.Enqueue("line 6");
75
76
77
78
79
        responseQueue.Enqueue(new string[] { "response 6" });
    }

    public string[] getResponses() {
        return currentResponses;
80
81
    }
}