JohnSmithSpeech.cs 11.7 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
using System.Collections;
using System.Collections.Generic;
using UnityEngine;


public class JohnSmithSpeech : MonoBehaviour, Character {

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

    private string[] currentResponses;

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

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

21
22
    public string GreetingMessage() {
        loadConversation();
23
24
        

25
        if ((int)GameManager.getLevel(getName()) == 1) {
26
            currentResponses = new string[] { "Hi there"};
27
            return "Hello, I'm John Smith";
28

29
        } else if ((int)GameManager.getLevel(getName()) == 2) {
astatham's avatar
astatham committed
30
            currentResponses = new string[] { "Thanks. How's it going, John Smith?", "Thanks, clown man", "It was a terrible time, funny man" };
31
            return "Nice job on the trapeze";
32

33
        } else if ((int)GameManager.getLevel(getName()) == 3) {
34
35
            currentResponses = new string[] { "Sure", "I suppose so", "Do I have a choice?" };
            return "Hey, can I ask you a question?";
36

37
        } else if ((int)GameManager.getLevel(getName()) == 4) {
astatham's avatar
astatham committed
38
39
            currentResponses = new string[] { "Hello!", "What's up?", "Here we go again" };
            return "Hi...";
40
41
        }
        return "Something has gone terribly wrong: The stage is: " + GameManager.ConversationStage;
42
43
44
    }
    public string GoodbyeMessage() {
        currentResponses = new string[] { };
45
        return "Come back anytime";
46
47
48
49
50
51
52
53
54
55
56
57
58
59
    }

    public string ProximityMessage() {
        currentResponses = new string[] { };
        return "Clowns are so underrated these days";
    }
    public string butthurtGoodbye() {
        currentResponses = new string[] { };
        return "No attention for poor John Smith?";
    }

    public string nothingMoreToSay() {
        currentResponses = new string[] { };
        if (Random.Range(0, 1f) < 0.8) {
astatham's avatar
astatham committed
60
            return "Hey";
61
        } else {
62
            return "So nice of you to stay, but I'm not that exciting";
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
        }
    }

    public string converse() {
        if (conversation.Count > 0) {
            currentResponses = responseQueue.Dequeue();
            return conversation.Dequeue();
        } else {
            return nothingMoreToSay();
        }
    }

    private void loadConversation() {
        conversation.Clear();
        responseQueue.Clear();

79
        if (GameManager.JohnTutorial) {
80
81
82
            loadTutorialConversation();

        }if ((int)GameManager.getLevel(getName()) == 1) {
83
84
            conversationStage1();

85
        } else if ((int)GameManager.getLevel(getName()) == 2) {
86
87
            conversationStage2();

88
        } else if ((int)GameManager.getLevel(getName()) == 3) {
89
90
            conversationStage3();

91
        } else if ((int)GameManager.getLevel(getName()) == 4) {
92
93
94
95
96
97
98
99
100
            conversationStage4();

        }
    }

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

101
102
103
104
105
106
107
    private void loadTutorialConversation() {
        conversation.Enqueue("Hey! Welcome to the Trapeze.");
        responseQueue.Enqueue(new string[] { "Continue" });

        conversation.Enqueue("So nice of you to SWING BY");
        responseQueue.Enqueue(new string[] { "Continue" });

astatham's avatar
astatham committed
108
        conversation.Enqueue("To swing yourself just hold A to swing left and D to swing right");
109
110
        responseQueue.Enqueue(new string[] { "Continue" });

astatham's avatar
astatham committed
111
        conversation.Enqueue("Well Done! I'll give you a bit more power");
112
113
        responseQueue.Enqueue(new string[] { "Continue" });

astatham's avatar
astatham committed
114
        conversation.Enqueue("Cool! Now press SPACEABR to let go and fly!");
115
116
        responseQueue.Enqueue(new string[] { "Continue" });

astatham's avatar
astatham committed
117
        conversation.Enqueue("Don't worry, Simon will catch you! Use A and D to rotate in the air");
118
        responseQueue.Enqueue(new string[] { "Continue" });
119
120
121
122
123
124
125

        conversation.Enqueue("Nice Job! Try and manoeuvre yourself across these platforms");
        responseQueue.Enqueue(new string[] { "Continue" });

        conversation.Enqueue("Good one! PIES give you points and boost your time!");
        responseQueue.Enqueue(new string[] { "Continue" });

astatham's avatar
astatham committed
126
        conversation.Enqueue("I'm so proud of you! You'll be the best trapezeist ever!");
127
128
129
130
131
132
133
134
        responseQueue.Enqueue(new string[] { "Continue" });

        conversation.Enqueue("Feel free to keep playing here or you could give it a go for real now!");
        responseQueue.Enqueue(new string[] { "Play" });

        conversation.Enqueue("Feel free to keep playing here or you could give it a go for real now!");
        responseQueue.Enqueue(new string[] { "Play" });

135
136
    }

137
    private void conversationStage1() {
138
        if (GameManager.HasTalkedToAhava) {
astatham's avatar
astatham committed
139
            conversation.Enqueue("Welcome to the circus.");
140
            responseQueue.Enqueue(new string[] { "Thanks", "It's an interesting place", "What do you do?"});
141

astatham's avatar
astatham committed
142
            conversation.Enqueue("If you ever wanna try a really unique performance you should try the trapezing, Ahava lets me take care of that.");
143
            responseQueue.Enqueue(new string[] { "I already have", "I'll give it a go", "Sorry, I don't swing that way" });
144

astatham's avatar
astatham committed
145
            conversation.Enqueue("I mean if you don't want to it's fine, I guess. I'm John Smith, by the way.");
146
            responseQueue.Enqueue(new string[] { "My name is Dennnnnis", "My name is " + GameManager.playerName, "I'm sure I can find time" });
147

148
            conversation.Enqueue("It's nice to meet a new face here, maybe you'll be different from the rest.");
astatham's avatar
astatham committed
149
            responseQueue.Enqueue(new string[] { "What do you mean?", "Different?", "It's nice to meet you too" });
150

151
            conversation.Enqueue("Not that I mean anything by that of course, just nice to have a few more ummmm... clowns around here.");
astatham's avatar
astatham committed
152
            responseQueue.Enqueue(new string[] { "You do seem a few short of a car", "Surely as long as you all get on well?", "Something about you seems funny" });
153

astatham's avatar
astatham committed
154
155
            conversation.Enqueue("You're not wrong, I should probably head back into the tent shortly. See you around");
            responseQueue.Enqueue(new string[] { "See you in there", "cya", "*Just backs away*" });
156
        } else {
astatham's avatar
astatham committed
157
158
            conversation.Enqueue("Talk to the bearded lady before you start clowning around");
            responseQueue.Enqueue(new string[] { "Okay", "That was a terrible joke", "*Backs away*" });
159
        }
160
161
    }

162
    private void conversationStage2() {
astatham's avatar
astatham committed
163
        conversation.Enqueue("Just remember to keep practising, wouldn't want someone with a name like yours to waste their talent");
164
165
        responseQueue.Enqueue(new string[] { "I will", "What does that have to do with it?", "My name is pretty lame" });

astatham's avatar
astatham committed
166
167
        conversation.Enqueue("Say, do you wanna hear a joke?");
        responseQueue.Enqueue(new string[] { "Wouldn't miss it", "Yes", "No" });
168

astatham's avatar
astatham committed
169
170
        conversation.Enqueue("You'll love it");
        responseQueue.Enqueue(new string[] { "I'm waiting", "Hurry up", "Please, no" });
171

astatham's avatar
astatham committed
172
173
        conversation.Enqueue("An accountant asks a trapeze artist what is their net worth. The trapeze artist says 'Every penny'");
        responseQueue.Enqueue(new string[] { "I wish I had a penny for every time I heard a joke that bad", "*Chuckles slightly*", "That was terrible" });
174

astatham's avatar
astatham committed
175
176
        conversation.Enqueue("AHAHAHAHHAHAHAHAHHAHAHAHHAHAHHAHAHAHHAHAHHHAHHAHAHHAHHHAHAHHAHAHAHAHHAHAHAHHAHAHAHAHHAHAHAHAHAHAHHAHA/n" + " You feel like he took your rejection well");
        responseQueue.Enqueue(new string[] { "I wish I had a penny for every time I heard a joke that bad", "*Chuckles slightly*", "That was terrible" });
177

astatham's avatar
astatham committed
178
179
        conversation.Enqueue("*Struggles to catch his breath* It's cool having you around, kid. Maybe I'll tell that one to the others. Looking forward to seeing you in the tent");
        responseQueue.Enqueue(new string[] { "Can't wait", "Looking forward to flying again, cya", "*Feigns interest*" });
180
181
182
    }

    private void conversationStage3() {
astatham's avatar
astatham committed
183
184
        conversation.Enqueue("What do you think of trapezing?");
        responseQueue.Enqueue(new string[] { "What do you mean?", "Uhh...", "Well..." });
185

astatham's avatar
astatham committed
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
        conversation.Enqueue("Like...do you think it's fun?");
        responseQueue.Enqueue(new string[] { "Absolutely! It's the best part of the circus", "It's pretty good", "It's okay, I guess" });

        conversation.Enqueue("Glad to hear it! I just worry that people don't like it: it's not as showy as Simon's stuff and doesn't have Silas' catchy tunes");
        responseQueue.Enqueue(new string[] { "Who needs that other stuff?", "Throwing pies is kinda cathartic...", "To be honest, I like getting my dance on" });

        conversation.Enqueue("There's something so much more...primal and natural about trapezing, don't you think?");
        responseQueue.Enqueue(new string[] { "I'm not sure...", "Huh?", "What?" });

        conversation.Enqueue("It's like we're monkies again! Swinging from branch to branch, tree to tree");
        responseQueue.Enqueue(new string[] { "Oh! That's true!", "I'd rather keep my feet on the ground", "I'm not into 'primal'" });

        conversation.Enqueue("Maybe it would be better if we were monkies again, no talking about people behind their backs...");
        responseQueue.Enqueue(new string[] { "You might have a point there", "Are you implying something?", "I'd miss my creature comforts" });

        conversation.Enqueue("Anyway, I should probably get to rigging the platforms up for tonight");
        responseQueue.Enqueue(new string[] { "Catch you later!", "Okay, bye", "At least there were no jokes this time" });
203
204
205
    }

    private void conversationStage4() {
astatham's avatar
astatham committed
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
        conversation.Enqueue("What do you think of me?");
        responseQueue.Enqueue(new string[] { "What do you mean?", "Uhh...", "Well..." });

        conversation.Enqueue("Like...am I funny? Am I special?");
        responseQueue.Enqueue(new string[] { "Umm...", "Err...", "Well..." });

        conversation.Enqueue("Some people think I'm 'just another clown'. A lot of people...most people...");
        responseQueue.Enqueue(new string[] { "I wouldn't say that", "*Stares awkwardly*", "But you ARE just another clown" });

        conversation.Enqueue("Apparently old John Smith is...generic *sniffs*");
        responseQueue.Enqueue(new string[] { "Not in the slightest!", "You're a trapezist! That's not generic at all!", "John Smith is a pretty generic name..." });

        conversation.Enqueue("I just want to entertain the people with amazing feats of trapeze! *sobs*");
        responseQueue.Enqueue(new string[] { "You already do that!", "I'm amazed, at least!", "You've taught me so much!" });

        conversation.Enqueue("*Wipes eyes* You really mean that?");
        responseQueue.Enqueue(new string[] { "I don't say things I don't mean", "Of course! You're great!", "Sure! *crosses fingers*" });

        conversation.Enqueue("I thought...for a moment...that I might hang up my trapezing boots");
        responseQueue.Enqueue(new string[] { "Don't even think about it!", "You're the best trapezist I've ever seen!", "I mean, if you're getting old..." });

        conversation.Enqueue("No, I couldn't do that: trapezing is my life! It's what I live for!");
        responseQueue.Enqueue(new string[] { "That's what I like to hear!", "Keep on swinging, John!", "Living's pretty cool, I hear" });

        conversation.Enqueue("Thank you... What you've said means a lot: no one else has been so kind to me before");
        responseQueue.Enqueue(new string[] { "You deserve better!", "A friend in need, you know?", "If I'm kind, what kind of jerks do you know?" });
232

astatham's avatar
astatham committed
233
234
        conversation.Enqueue("You'll always be welcome to come trapezing with me, friend. I'll see you later!");
        responseQueue.Enqueue(new string[] { "Take care up there!", "It's always a pleasure!", "Yeah, sure, bye!" });
235
236
    }
}