SilasSpeech.cs 9.07 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
        if ((int)GameManager.getLevel(getName()) == 1) {
25
26
27
            currentResponses = new string[] { "Hi there", "Umm hello?", "was geht ab?" };
            return "...";

28
        } else if ((int)GameManager.getLevel(getName()) == 2) {
29
30
31
            currentResponses = new string[] { "stage 2 greeting response" };
            return "stage 2 greeetiong";

32
        } else if ((int)GameManager.getLevel(getName()) == 3) {
33
34
35
            currentResponses = new string[] { "stage 3 greeting response" };
            return "stage 3 greeting";

36
        } else if ((int)GameManager.getLevel(getName()) == 4) {
37
38
39
40
41
            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
        if (GameManager.HasTalkedToAhava) {
            currentResponses = new string[] { "wow, tell me more", "my ears are bleeding" };
60
61
62
63
64
65
66
67
68
69
70
71
            switch (Random.Range(0, 11)) {
                case 0: return "According to circus superstition, it's unlucky to wear green in the ring.";
                case 1: return "A 'josser' is an outsider who joins the circus.";
                case 2: return "The word clown is believed to come from the Icelandic word klunni, meaning a clumsy person.";
                case 3: return "A street mime was so committed that he actually got stuck in his imaginary box and died of starvation";
                case 4: return "Banging your head against the wall burns 150 calories";
                case 5: return "29th May is oficially 'Put a Pillow on your Fridge Day'.";
                case 6: return "in 2017 more people were kiled from injuries caused by taking a selfie than by shark attacks";
                case 7: return "Did you know Honey Bees can recognise human faces";
                case 8: return "A small child could swim through the veins of a Blue Whale";
                case 9: return "pirates wore earings because they believed it improved their eyesight";
                case 10: return "20th March is Snowman Burning day to celebrate the end of winter";
72
73
74
75
                default:
                    return "...";
            }
        } else {
76
            currentResponses = new string[] { };
77
            return "...";
78
79
80
81
82
        }
    }

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

    private void loadConversation() {
91
        conversation.Clear();
92
93
        responseQueue.Clear();

94
95
96
97
        if (GameManager.SilasTutorial)
        {
            loadTutorialConversation();

98
        }else if ((int)GameManager.getLevel(getName()) == 1) {
99
100
            conversationStage1();

101
        } else if ((int)GameManager.getLevel(getName()) == 2) {
102
103
            conversationStage2();

104
        } else if ((int)GameManager.getLevel(getName()) == 3) {
105
106
            conversationStage3();

107
        } else if ((int)GameManager.getLevel(getName()) == 4) {
108
109
110
111
112
113
114
115
116
117
            conversationStage4();

        }
    }

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

    private void conversationStage1() {
118
119
120
121
122
123
        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" });
124

125
126
            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" });
127

128
129
            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?" });
130

131
132
            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" });
133

134
135
136
137
138
            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[] { "?" });
139

140
141
142
143
144
145
146
147
148
149
150
            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" });
        }
151
    }
152

153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
    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" });
175
    }
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220

   private void loadTutorialConversation()
    {
        conversation.Enqueue("Oh hey, so nice of you to come perform with me!");
        responseQueue.Enqueue(new string[] { "okay" });

        conversation.Enqueue("We're gonna have so much fun!");
        responseQueue.Enqueue(new string[] { "okay" });

        conversation.Enqueue("Or at least, I'll have so much fun!");
        responseQueue.Enqueue(new string[] { "Get on with it" });

        conversation.Enqueue("All you have to do to perform with me is dance, for me it's pretty natural!");
        responseQueue.Enqueue(new string[] { "I don't know how" });

        conversation.Enqueue("but if it wasn't natural I'd know that anyone can use the Q W E or R keys to daaaaannceee.");
        responseQueue.Enqueue(new string[] { "okay" });

        conversation.Enqueue("WOW, your dancing is so good it made fireworks in those convenient looking boxes!");
        responseQueue.Enqueue(new string[] { "okay" });

        conversation.Enqueue("How about I let you know what amazing moves I'm going to do? And you can copy me!");
        responseQueue.Enqueue(new string[] { "okay" });

        conversation.Enqueue("I'll use my super secret mime sign language by sending instructions from those mimetastic pillars to your right. Ready?!");
        responseQueue.Enqueue(new string[] { "okay" });

        conversation.Enqueue("Here I go, hit it when it's in it's square, I'll go easy this time!");
        responseQueue.Enqueue(new string[] { "okay" });

        conversation.Enqueue("Hit it now!");
        responseQueue.Enqueue(new string[] { "okay" });

        conversation.Enqueue("Nice job!");
        responseQueue.Enqueue(new string[] { "okay" });

        conversation.Enqueue("let's try a few more of my definitely different moves!");
        responseQueue.Enqueue(new string[] { "okay" });

        conversation.Enqueue("This time I've gotta go fast, you can do it!");
        responseQueue.Enqueue(new string[] { "okay" });

        conversation.Enqueue("I think you've got the idea now! Time for us to do this for real!");
        responseQueue.Enqueue(new string[] { "okay" });
    }
221
}