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


public class SilasSpeech : MonoBehaviour, Character {

    private Queue<string> conversation = new Queue<string>();

10
11
    private string[] currentResponses;

12
13
    public string GreetingMessage(){
        loadConversation();
14
        currentResponses = new string[] { "Hi there", "Who are you", "what is this place" };
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
        return "...";
    }
    public string GoodbyeMessage(){
        return "mime mime mime mime cya bye mime";
    }

    public string ProximityMessage(){
        return "did someone enter my invivible box";
    }
    public string butthurtGoodbye(){
        return "its just white makeup, i swear!";
    }

    public string nothingMoreToSay() {
        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) {
            return conversation.Dequeue();
        } else {
            return nothingMoreToSay();
        }
    }

    private void loadConversation() {
54
        conversation.Clear();
55
56
57
58
59
60
61
        conversation.Enqueue("HaHaHa got you! Thought i was a mime didnt ya?");
        conversation.Enqueue("The names Silas, they call me the unspeakable round here");
        conversation.Enqueue("Not really sure why they call me unspeakable but it sounds cool doesnt it.");
        conversation.Enqueue("anyway have you seen my show 'Mime Mime' its the talk of the circus");
        conversation.Enqueue("...well its mostly just me talking about it but they say its the best");
        conversation.Enqueue("...well i say its the best");
    }
62
63
64
65

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