SilasSpeech.cs 6 KB
Newer Older
1
2
3
4
5
6
7
8
using System.Collections;
using System.Collections.Generic;
using UnityEngine;


public class SilasSpeech : MonoBehaviour, Character {

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

11
12
    private string[] currentResponses;

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

17
18
19
20
    public string getName() {
        return "Silas";
    }

21
22
    public string GreetingMessage(){
        loadConversation();
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
        
        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;
42
43
    }
    public string GoodbyeMessage(){
44
        currentResponses = new string[] { };
45
46
47
48
        return "mime mime mime mime cya bye mime";
    }

    public string ProximityMessage(){
49
        currentResponses = new string[] { "yes, me, i did"};
50
51
52
        return "did someone enter my invivible box";
    }
    public string butthurtGoodbye(){
53
        currentResponses = new string[] { };
54
55
56
57
        return "its just white makeup, i swear!";
    }

    public string nothingMoreToSay() {
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
        if (GameManager.HasTalkedToAhava) {
            currentResponses = new string[] { "wow, tell me more", "my ears are bleeding" };
            switch (Random.Range(0, 10)) {
                case 0: return "1";
                case 1: return "2";
                case 2: return "3";
                case 3: return "4";
                case 4: return "5";
                case 5: return "6";
                case 6: return "7";
                case 7: return "8";
                case 8: return "9";
                case 9: return "10";
                default:
                    return "...";
            }
        } else {
            return "...";
76
77
78
79
80
        }
    }

    public string converse() {
        if (conversation.Count > 0) {
81
            currentResponses = responseQueue.Dequeue();
82
83
84
85
86
87
88
            return conversation.Dequeue();
        } else {
            return nothingMoreToSay();
        }
    }

    private void loadConversation() {
89
        conversation.Clear();
90
91
        responseQueue.Clear();

92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
        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() {
112
113
114
115
116
117
        if (GameManager.HasTalkedToAhava) {
            conversation.Enqueue("HaHaHa got you! Thought i was a mime didnt ya?");
            responseQueue.Enqueue(new string[] { "wow you fooled me!", "nah not really" });

            conversation.Enqueue("The names Silas, they call me the unspeakable round here");
            responseQueue.Enqueue(new string[] { "why is that", "cant think why" });
118

119
120
            conversation.Enqueue("Not really sure why they call me unspeakable but it sounds cool doesnt it.");
            responseQueue.Enqueue(new string[] { "Yes!", "people are taking the piss m8" });
121

122
123
            conversation.Enqueue("anyway have you seen my show 'Mime Mime' its the talk of the circus");
            responseQueue.Enqueue(new string[] { "not yet", "ive played it!", "isnt that just a rip off?" });
124

125
126
            conversation.Enqueue("...well its mostly just me talking about it but they say its the best");
            responseQueue.Enqueue(new string[] { "keep talking!", "okay stop now" });
127

128
129
130
131
132
            conversation.Enqueue("...well i say its the best");
            responseQueue.Enqueue(new string[] { "It is great!", "please stop talking" });
        } else{
            conversation.Enqueue("...");
            responseQueue.Enqueue(new string[] { "?" });
133

134
135
136
137
138
139
140
141
142
143
144
            conversation.Enqueue("....");
            responseQueue.Enqueue(new string[] { "?" });

            conversation.Enqueue(".......");
            responseQueue.Enqueue(new string[] { "?" });

            conversation.Enqueue("...................................");
            responseQueue.Enqueue(new string[] { "?" });
            conversation.Enqueue("....Talk to the bearded lady....");
            responseQueue.Enqueue(new string[] { "Oh right" });
        }
145
    }
146

147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
    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" });
169
    }
170
}