SilasSpeech.cs 2.99 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
    public string GreetingMessage(){
        loadConversation();
19
        currentResponses = new string[] { "Hi there", "Umm hello?", "was geht ab?" };
20
21
22
        return "...";
    }
    public string GoodbyeMessage(){
23
        currentResponses = new string[] { };
24
25
26
27
        return "mime mime mime mime cya bye mime";
    }

    public string ProximityMessage(){
28
        currentResponses = new string[] { "yes, me, i did"};
29
30
31
        return "did someone enter my invivible box";
    }
    public string butthurtGoodbye(){
32
        currentResponses = new string[] { };
33
34
35
36
        return "its just white makeup, i swear!";
    }

    public string nothingMoreToSay() {
37
        currentResponses = new string[] {"wow, tell me more", "my ears are bleeding" };
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
        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 "...";
        }
    }

    public string converse() {
        if (conversation.Count > 0) {
56
            currentResponses = responseQueue.Dequeue();
57
58
59
60
61
62
63
            return conversation.Dequeue();
        } else {
            return nothingMoreToSay();
        }
    }

    private void loadConversation() {
64
        conversation.Clear();
65
66
        responseQueue.Clear();

67
        conversation.Enqueue("HaHaHa got you! Thought i was a mime didnt ya?");
68
69
        responseQueue.Enqueue(new string[] { "wow you fooled me!", "nah not really" });

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

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

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

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

82
        conversation.Enqueue("...well i say its the best");
83
        responseQueue.Enqueue(new string[] { "It is great!", "please stop talking" });
84
    }
85
86
87
88

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