SilasSpeech.cs 5.18 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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
        
        if (GameManager.ConversationStage == 1) {
            currentResponses = new string[] { "Hi there", "Umm hello?", "was geht ab?" };
            return "...";

        } else if (GameManager.ConversationStage == 2) {
            currentResponses = new string[] { "stage 2 greeting response" };
            return "stage 2 greeetiong";

        } else if (GameManager.ConversationStage == 3) {
            currentResponses = new string[] { "stage 3 greeting response" };
            return "stage 3 greeting";

        } else if (GameManager.ConversationStage == 4) {
            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
        currentResponses = new string[] {"wow, tell me more", "my ears are bleeding" };
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
        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) {
77
            currentResponses = responseQueue.Dequeue();
78
79
80
81
82
83
84
            return conversation.Dequeue();
        } else {
            return nothingMoreToSay();
        }
    }

    private void loadConversation() {
85
        conversation.Clear();
86
87
        responseQueue.Clear();

88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
        if (GameManager.ConversationStage == 1) {
            conversationStage1();

        } else if (GameManager.ConversationStage == 2) {
            conversationStage2();

        } else if (GameManager.ConversationStage == 3) {
            conversationStage3();

        } else if (GameManager.ConversationStage == 4) {
            conversationStage4();

        }
    }

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

    private void conversationStage1() {
108
        conversation.Enqueue("HaHaHa got you! Thought i was a mime didnt ya?");
109
110
        responseQueue.Enqueue(new string[] { "wow you fooled me!", "nah not really" });

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

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

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

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

123
        conversation.Enqueue("...well i say its the best");
124
        responseQueue.Enqueue(new string[] { "It is great!", "please stop talking" });
125
    }
126

127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
    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" });
149
    }
150
}