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

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

    public string nothingMoreToSay() {
33
        currentResponses = new string[] {"wow, tell me more", "my ears are bleeding" };
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
        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) {
52
            currentResponses = responseQueue.Dequeue();
53
54
55
56
57
58
59
            return conversation.Dequeue();
        } else {
            return nothingMoreToSay();
        }
    }

    private void loadConversation() {
60
        conversation.Clear();
61
62
        responseQueue.Clear();

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

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

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

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

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

78
        conversation.Enqueue("...well i say its the best");
79
        responseQueue.Enqueue(new string[] { "It is great!", "please stop talking" });
80
    }
81
82
83
84

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