Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- using UnityEngine.UI;
- using System.Collections;
- public class TextController : MonoBehaviour {
- public bool dogFood;
- public int dogFood_Counter = 100;
- public int dogFood_Max = 100;
- public int dogFood_Min = 0;
- public bool clothes;
- public Text text;
- private enum States {
- cell, bed, bed_1, bed_2, bed_3, bed_4, food, food_1, food_finished, clothes, clothes_1, door, unlocked_door,
- day_2, dogAngry, getShiv, searchGuard, day2, hutInspect, hutShelf, escapeHut
- };
- private States myState;
- private enum gear {};
- // Use this for initialization
- void Start () {
- myState = States.cell;
- text.text ="Welcome to Tribal Arrest. " + "\n\n\n\nPress Space to continue";
- if (Input.GetKeyDown (KeyCode.Space)) cell();
- }
- // Update is called once per frame
- void Update () {
- if (myState ==States.cell) {cell();}
- else if (myState ==States.bed) {bed();}
- else if (myState ==States.bed_1) {bed_1();}
- else if (myState ==States.bed_2) {bed_2();}
- else if (myState ==States.bed_3) {bed_3();}
- else if (myState ==States.day2) {day2();}
- else if (myState ==States.food) {food();}
- else if (myState ==States.food_1) {food_1();}
- else if (myState ==States.food_finished) {foodFinished();}
- else if (myState ==States.clothes) {clothes_0();}
- else if (myState ==States.door) {door();}
- else if (myState ==States.unlocked_door) {doorUnlocked();}
- else if (myState ==States.dogAngry) {dogAngry();}
- else if (myState ==States.getShiv) {getShiv();}
- else if (myState ==States.searchGuard) {searchGuard();}
- else if (myState ==States.hutInspect) {hutInspect();}
- else if (myState ==States.escapeHut) {escapeHut();}
- if (dogFood_Counter < 25) dogFood = false;
- else if (dogFood_Counter <= 25) dogFood = true;
- }
- //explain what options are available to the players character, feed new information to grow the storyline (ie. a man walks past with a dog, the dog has keys around his neck, you have dog food, you could get caught and lose the game.)
- void cell () {
- text.text = "You awake hurt, naked and confused, you're in a cage inside a small wooden hut that is dimly lit. You want to escape. "
- +"\nThere is a make shift bed, a dog bowl of food, and a small pile of clothes. The cage door is locked from the outside."
- +"\n\nPress B to get in bed, F to inspect food, C to inspect Clothes";
- if (Input.GetKeyDown (KeyCode.B)) bed();
- if (Input.GetKeyDown (KeyCode.F)) food();
- if (Input.GetKeyDown (KeyCode.C)) clothes_0();
- }
- void bed () {
- text.text = "You are in a dirty smelly bed, still confused from your surroundings you comtemplate your next action."
- + "\nYou could go to sleep and hope things change, or try to find a way out."
- + "\n\nPress S to try to Sleep, F to inspect the bowl of Food, or C to inspect the Clothes";
- if (Input.GetKeyDown (KeyCode.S)) bed_1();
- if (Input.GetKeyDown (KeyCode.F)) food();
- if (Input.GetKeyDown (KeyCode.C)) clothes_0();
- }
- void bed_1 () {
- if (clothes = false) & (dogFood = true);
- text.text = "You close your eyes turn over onto your side and try to remember what happened to you."
- + "\nYou fall asleep, and some time after wake up. You're now hungry and it is turning night."
- + "\n\nPress F to inspect food, C to inspect the clothes or S to Sleep some more";
- if (clothes = false) & (dogFood = true);
- text.text = "You close your eyes turn over onto your side and try to remember what happened to you."
- + "\nYou fall asleep, and some time after wake up. You're now hungry and it is turning night."
- + "\n\nPress S to Sleep some more";
- if (clothes = true);
- text.text = "You close your eyes turn over onto your side and try to remember what happened to you."
- + "\nYou fall asleep, and some time after wake up. You're now hungry and it is turning night."
- + "\n\nPress Press F to inspect food, or S to sleep some more";
- if (clothes = true);
- text.text = "You close your eyes turn over onto your side and try to remember what happened to you."
- + "\nYou fall asleep, and some time after wake up. You're now hungry and it is turning night."
- + "\n\nPress Press F to inspect food, or S to sleep some more";
- if (Input.GetKeyDown (KeyCode.S))
- text.text = "You cannot sleep anymore..."
- +"\n\n\nPress F to inspect food, or C to inspect the clothes";
- else if (Input.GetKeyDown (KeyCode.F)) food();
- else if (Input.GetKeyDown (KeyCode.C))
- if (clothes = false) clothes_0();
- if (clothes = 1);
- text.text = "You already put the clothes on, they aren't the best but they are warm.\n"
- +"\nYou should probably get in bed. The guard is starting to look tired!"
- +"\n\nPress S to Sleep"; ;
- }
- void bed_2 () {
- text.text = "You sit up on the bed. What do you want to do now?"
- + "\n\n\n Press F to inspect food, D to go to the door";
- if (dogFood > 26)
- if (Input.GetKeyDown (KeyCode.F)) food();
- else if (Input.GetKeyDown (KeyCode.D)) door();
- }
- void bed_3 () {
- text.text = "You sit on the bed. Theres nothing to do but sleep."
- + "\n\n\n Press S to Sleep, D to go to the door";
- if (Input.GetKeyDown (KeyCode.S)) bed_4();
- else if (Input.GetKeyDown (KeyCode.D)) door();
- }
- void bed_4 () {
- text.text = "You fall asleep. Wake up, and have a look around. You're still here..."
- + "\nThere is more food in the bowl and the man and dog are sleeping in the corner. What to do...?"
- + "\n\n Press F to inspect food, D to go to the door";
- if (dogFood > 24)
- if (Input.GetKeyDown (KeyCode.S)) day2();
- else if (Input.GetKeyDown (KeyCode.D)) door();
- }
- void bed_1_b () {
- text.text = "You get back into bed, turn over onto your side and try to remember what happened to you."
- + "\nYou fall asleep, and some time after wake up. ."
- + "\n\nPress F to inspect food, C to inspect the clothes or S to sleep some more";
- if (Input.GetKeyDown (KeyCode.S))
- text.text = "You cannot sleep anymore..."
- +"\n\n\nPress F to inspect food, or C to inspect the clothes, I to inspect surroundings";
- else if (Input.GetKeyDown (KeyCode.F)) food();
- else if (Input.GetKeyDown (KeyCode.C)) clothes_0();
- else if (Input.GetKeyDown (KeyCode.I)) bedB_inspect();
- }
- void bedB_inspect(){
- text.text = "Theres some clothes that should make me feel more comfortable .";
- }
- void clothes_0 () {
- text.text = "You go over to the clothes. They look like they will fit. They might even be yours. You cannot remember"
- + "\nYou can try to put them on or return"
- + "\n\nPress F to inspect Food bowl, W to Wear the clothes";
- if (Input.GetKeyDown (KeyCode.F)) food();
- else if (Input.GetKeyDown (KeyCode.W)) clothes_1();
- }
- void clothes_1 () {
- text.text = "As you put on the trousers some coins fall out onto the floor. The coins collide against the cage. A man enters the hut with an old dog."
- + "\nHe looks over to you, gestures for you to be quiet and sits down in a chair across from the cafe. You put the top on quickly."
- + "\n\nPress D to go to the Door, F to inspect Food bowl, B to sit on the Bed";
- clothes = true;
- if (Input.GetKeyDown (KeyCode.F)) food();
- else if (Input.GetKeyDown (KeyCode.D)) door();
- }
- void door () {
- if(dogFood => 25)
- text.text = "You slowly approach the door to the cage. The man and his dog are both resting, and might be asleep, it's hard to tell."
- + "\nGood thing you didn't eat all of the dog food."
- + "\n\nPress D to go to the Door, F to give the dog the Food, B to sit on the Bed";
- else
- text.text = "You slowly approach the door of the cage. The man and his dog are both resting and might be asleep, it's hard to tell."
- + "\n You already ate all of the food... You could still try to get the dogs attention."
- + "\n\nPress D to go to the Door, F to show the dog the Food Bowl, B to sit on the Bed";
- if (Input.GetKeyDown (KeyCode.F) && dogFood < 24) dogAngry();
- else if (Input.GetKeyDown (KeyCode.F) && dogFood > 24) doorUnlocked();
- else if (Input.GetKeyDown (KeyCode.B)) bed_3();
- }
- void dogAngry () {
- if(dogFood => 25)
- text.text = "You anger the dog. He doesn't like empty bowls. It growls at you."
- + "\nThe guard wakes up and point towards your bed."
- + "\n\nPress B to sit on the Bed";
- if (Input.GetKeyDown (KeyCode.B)) bed_3();
- }
- void food () {
- if (clothes = 0)
- text.text = "You get on your knees and grab the bowl of brown food. It's texture is gooey and it smells rotten." +
- + "\nYou are hungry but eating this food isn't ideal. You notice you feel cold from the being on the floor."
- + "\n\nPress T to Taste some of the food, E to Eat the whole bowl, C to go to the Clothes, or L to Leave the food";
- else if (clothes = 1)
- text.text = "You get on your knees and grab the bowl of brown food. It's texture is gooey and it smells rotten." +
- + "\nYou are hungry but eating this food isn't ideal. You notice you feel cold from the being on the floor."
- + "\n\nPress T to Taste some of the food, E to Eat the whole bowl, C to go to the Clothes, or L to Leave the food";
- if (Input.GetKeyDown (KeyCode.T)) food_1();
- else if (Input.GetKeyDown (KeyCode.L)) bed_2();
- else if (Input.GetKeyDown (KeyCode.C)) clothes_0();
- else if (Input.GetKeyDown (KeyCode.E)) foodFinished();
- }
- void food_1 () {
- dogFood_Counter - 25;
- text.text = "You taste the food, you haven't tasted dog food before, but this could be it."
- + "\nThe weird taste in your mouth fills you with disgust. You could eat more. It's up to you."
- + "\n\nPress T to try more, F to finish the dog food, C to inspect the clothes, L to leave the food";
- if (Input.GetKeyDown (KeyCode.F)) foodFinished();
- else if (Input.GetKeyDown (KeyCode.T)) food_2();
- else if (Input.GetKeyDown (KeyCode.D)) door();
- }
- void food_2 () {
- text.text = "You put you hand into the bowl and take some more. You put it in your mouth and chew."
- + "\nYour face shrivels up as you feel it going down your neck. You could eat more. It's up to you."
- + "\n\nPress T to Try more, F to finish the dog food, C to inspect the clothes, L to leave the food";
- if (Input.GetKeyDown (KeyCode.F)) foodFinished();
- else if (Input.GetKeyDown (KeyCode.T)) food_3();
- else if (Input.GetKeyDown (KeyCode.C)) foodFinished();
- else if (Input.GetKeyDown (KeyCode.D)) door();
- }
- void food_3 () {
- text.text = "You put you hand into the bowl once more. As your teeth pierce and burst fluid down your throat..."
- + "\nyour face shrivels up as you feel it going down your neck. You could eat more though. It's up to you."
- + "\n\nPress F to finish the dog food, C to inspect the clothes, L to leave the food";
- if (Input.GetKeyDown (KeyCode.F)) foodFinished();
- else if (Input.GetKeyDown (KeyCode.C)) clothes_0();
- else if (Input.GetKeyDown (KeyCode.D)) door();
- }
- void foodFinished () {
- text.text = "You lick the bowl clean after finishing the dog food, you animal. You burp and move away from the bowl."
- + "\nYou're sitting against the cage, and looking around there isn't much inside the cage, you need to find a way out."
- + "\n\nPress C to inspect the Clothes";
- if (Input.GetKeyDown (KeyCode.C)) clothes_0();
- }
- void day2 () {
- text.text = "You wake up again and not much has changed. There is more food and the dog is still here."
- + "\n"
- + "\n\nPress B to interact";
- if (Input.GetKeyDown (KeyCode.E)) exitCage();
- }
- void doorUnlocked () {
- text.text = "You give the dog some food, you take the key chain from around its neck. You attempt to open the lock from the inside."
- + "\nIt's awkward and dificult but you do manage to open the door."
- + "\n\nPress E to Exit the cage";
- if (Input.GetKeyDown (KeyCode.E)) exitCage();
- }
- void exitCage () {
- text.text = "You are now standing in the room outside of the cage. The man is there, still sleeping."
- + "\n You should probably be as quiet as possible. Only knows what he'll to do you if he see's you out of the cage."
- + "\n\nPress S to Search the man, D to exit though the Door, or I to Inspect the room";
- if (Input.GetKeyDown (KeyCode.S)) searchGuard();
- else if (Input.GetKeyDown (KeyCode.D)) escapeHut();
- else if (Input.GetKeyDown (KeyCode.I)) hutInspect();
- }
- void searchGuard () {
- text.text = "You approach the sleeping man, he is wearing a cloth top with a little pocket. You see a small shiv inside."
- + "\n You should probably be as quiet as possible. Only knows what he'll to do you if he see's you out of the cage."
- + "\n\nPress S to Search the man";
- if (Input.GetKeyDown (KeyCode.S)) getShiv();
- }
- void getShiv () {
- text.text = "You take the shiv from the mans pocket. He wakes up and grabs your arm. You push the shiv directly into his neck."
- + "\nYou killed a man. Way to go... The dog cowards in the corner as his owner falls off the chair into a pile."
- + "\n\nPress D to exit through the Door, or I to inspect the room ";
- if (Input.GetKeyDown (KeyCode.D)) escapeHut();
- else if (Input.GetKeyDown (KeyCode.I)) hutInspect();
- }
- void escapeHut () {
- text.text = "Still in shock from killing another human you take a moment to look around. It appears you are at an encampment."
- + "\nThere are two other huts across from you, a path that leads out of the encampment, and another path leading to a large tree."
- + "\n\nPress H to go to the Huts, L to Leave the encampment, T to go to the Tree or R to return to the hut ";
- if (Input.GetKeyDown (KeyCode.R)) hutInspect();
- else if (Input.GetKeyDown (KeyCode.H)) camp_huts();
- else if (Input.GetKeyDown (KeyCode.L)) exitCamp();
- else if (Input.GetKeyDown (KeyCode.T)) camp_tree();
- }
- void hutInspect () {
- text.text = "You quickly look around the hut. The man is still laying there. There is a shelf with some things on it."
- + "\nThe dog is still here, but there is nothing more to do here."
- + "\n\nPress S to Search the shelf, or L to leave the hut ";
- if (Input.GetKeyDown (KeyCode.S)) hutShelf();
- else if (Input.GetKeyDown (KeyCode.L)) escapeHut();
- }
- void hutShelf () {
- text.text = "There is an old photo of the man with another two men holding rifles in the air. Next to it is a small satchel and some shells for a .408 rifle"
- + "\nYou take the shells. There is also a metal flask. You put the empty flask in the small satchel. You put it over your head, pull the strap tight."
- + "\n\nPress L to leave the hut.";
- gear.backpack = "Satchel";
- if (Input.GetKeyDown (KeyCode.S)) hutShelf();
- else if (Input.GetKeyDown (KeyCode.L)) escapeHut();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement