Advertisement
Guest User

Untitled

a guest
May 1st, 2016
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 26.19 KB | None | 0 0
  1. using UnityEngine;
  2. using UnityEngine.UI;
  3. using System.Collections;
  4.  
  5. public class TextController : MonoBehaviour {
  6.  
  7.     public Text text;
  8.    
  9.     // Enumerated list to keep track of states. Format is : States.LIST
  10.     private enum States {cell, mirror, sheets_0, locks_0, cell_mirror,
  11.                             sheets_1, locks_1, sheets_2, cell_knowledge, fatty, corridor_0,
  12.                             left_door, cell_stairwell, corridor_revisit, cell_block_a,
  13.                             mauled_man, game_over_trapped, game_over_mauled, desecrated,
  14.                             game_over_kicked, cell_escaped, old_cell, barracks, search_treats,
  15.                             search_taser, exit_door, game_over_knockout, bark_bark, bark_bark2,
  16.                             interrogate, game_over_trust, getting_key, no_reason};
  17.     private States myState;
  18.    
  19.     // Booleans for gameplay
  20.     bool knowledge = false;
  21.     bool takenSheets = false;
  22.     bool desecrate = false;
  23.     bool dogEvent = false;
  24.     bool hasTreats = false;
  25.     bool ruff = false;
  26.     bool hasTaser = false;
  27.     bool barracksUnlocked = false;
  28.     bool freedomKey = false;
  29.     bool givenVodka = false;
  30.    
  31.     string choice = "";
  32.    
  33.    
  34.     // Use this for initialization
  35.     void Start () {
  36.         myState = States.cell;
  37.         //myState = States.bark_bark2;
  38.     }
  39.                
  40.    
  41.     // Update is called once per frame
  42.     void Update () {
  43.         //print (myState);
  44.         if      (myState == States.cell)                {cell();}
  45.         else if (myState == States.sheets_0)            {sheets_0();}
  46.         else if (myState == States.mirror)              {mirror();}  
  47.         else if (myState == States.locks_0)             {locks_0();}  
  48.         else if (myState == States.fatty)               {fatty();}
  49.         else if (myState == States.cell_mirror)         {cell_mirror();}  
  50.         else if (myState == States.sheets_1)            {sheets_1();}    
  51.         else if (myState == States.locks_1)             {locks_1();}
  52.         else if (myState == States.cell_knowledge)      {cell_knowledge();}  
  53.         else if (myState == States.left_door)           {left_door();}
  54.         else if (myState == States.corridor_0)          {corridor_0();}
  55.         else if (myState == States.cell_stairwell)      {cell_stairwell();}
  56.         else if (myState == States.corridor_revisit)    {corridor_revisit();}
  57.         else if (myState == States.cell_block_a)        {cell_block_a();}
  58.         else if (myState == States.mauled_man)          {mauled_man();}
  59.         else if (myState == States.game_over_trapped)   {game_over_trapped();}
  60.         else if (myState == States.game_over_mauled)    {game_over_mauled();}
  61.         else if (myState == States.desecrated)          {desecrated();}
  62.         else if (myState == States.game_over_kicked)    {game_over_kicked();}
  63.         else if (myState == States.cell_escaped)        {cell_escaped();}
  64.         else if (myState == States.old_cell)            {old_cell();}
  65.         else if (myState == States.no_reason)           {no_reason();}
  66.         else if (myState == States.barracks)            {barracks();}
  67.         else if (myState == States.search_treats)       {search_treats();}
  68.         else if (myState == States.search_taser)        {search_taser();}
  69.         else if (myState == States.exit_door)           {exit_door();}
  70.         else if (myState == States.game_over_knockout)  {game_over_knockout();}
  71.         else if (myState == States.bark_bark)           {bark_bark();}
  72.         else if (myState == States.bark_bark2)          {bark_bark2();}
  73.         else if (myState == States.interrogate)         {interrogate();}
  74.         else if (myState == States.game_over_trust)     {game_over_trust();}
  75.         else if (myState == States.getting_key)         {getting_key();}
  76.          
  77.     }
  78.    
  79.        
  80.     void resetGame(){
  81.         knowledge = false;
  82.         takenSheets = false;
  83.         desecrate = false;
  84.         dogEvent = false;
  85.         hasTreats = false;
  86.         ruff = false;
  87.         hasTaser = false;
  88.         barracksUnlocked = false;
  89.         freedomKey = false;
  90.         givenVodka = false;
  91.     }          
  92.        
  93.     #region GameHandlerStates  
  94.     void cell() {
  95.             text.text = "You are in a prison cell, and you want to escape.\nThere are " +
  96.                         "some dirty sheets on the bed, a mirror on the wall, and the door " +
  97.                         "is locked from the outside.\n\n" +
  98.                         "S to check out the sheets.\n" +
  99.                         "M to look at the mirror.\n" +
  100.                         "L to look at the lock.\n";
  101.                        
  102.             if      (Input.GetKeyDown(KeyCode.S)) {myState = States.sheets_0;} 
  103.             else if (Input.GetKeyDown(KeyCode.M)) {myState = States.mirror;}   
  104.             else if (Input.GetKeyDown(KeyCode.L)) {myState = States.locks_0;}      
  105.    }                   
  106.                                
  107.     void sheets_0() {
  108.             text.text = "Filthy sheets lie on your bed. Maybe you could "+
  109.                         "make a rope out of the sheets like they did in Prison Break... " +
  110.                         "\n\nToo bad there isn't a window. And look at you, you're definitely not Michael Scofield.\n\n" +
  111.                         "\nPress R to continue your search.";
  112.            
  113.             if (Input.GetKeyDown(KeyCode.R)){myState = States.cell;}                   
  114.     }  
  115.    
  116.     void mirror() {
  117.             text.text = "A cracked mirror hangs from the wall. " +
  118.                         "The wall seems to be loose. Looks like you can pull the "+
  119.                         "mirror off.\n\n" +
  120.                         "Press T to take the mirror.\n" +
  121.                         "Press R to continue your search.\n";
  122.            
  123.             if      (Input.GetKeyDown(KeyCode.R)){myState = States.cell;}
  124.             else if (Input.GetKeyDown(KeyCode.T)){myState = States.cell_mirror;}           
  125.     }              
  126.    
  127.     void locks_0() {
  128.             text.text = "The manner of your imprisonment is a rusted iron-barred door. "+
  129.                         "The bars are far enough apart so that a slightly more fit person " +
  130.                         "might be able to wiggle through.\n\n" +
  131.                         "You really need to lose some weight.\n\n" +
  132.                        
  133.                         "Press R to continue your search. Press P to do some pushups";
  134.        
  135.             if      (Input.GetKeyDown(KeyCode.R)){myState = States.cell;}
  136.             else if (Input.GetKeyDown(KeyCode.P)){myState = States.fatty;}                     
  137.     }                              
  138.  
  139.                            
  140.     void fatty() {
  141.         text.text = "With your BMI being well over healthy levels, and the added stress "+
  142.                     "of your imprisonment, you begin to experience a very sharp pain in your chest.\n\n" +
  143.                     "You die.\n\n" +
  144.                     "R to restart. :)";
  145.                        
  146.         if (Input.GetKeyDown(KeyCode.R)){myState = States.cell;resetGame();}                   
  147.     }                                                                              
  148.  
  149.     void cell_mirror() {
  150.         text.text = "You return to the middle of your cell, mirror in hand. " +
  151.                     "From this angle you sorta look like that really fat dude from LOST.\n\n"+
  152.                     "I suppose he was quite rich. So there's that. Money won't help you here, however - what next?\n\n" +
  153.                    
  154.                     "S to look at the sheets again.\n" +
  155.                     "L to bring the mirror to the barred door.";
  156.                    
  157.         if      (Input.GetKeyDown(KeyCode.S)) {myState = States.sheets_1;}     
  158.         else if (Input.GetKeyDown(KeyCode.L)) {myState = States.locks_1;}  
  159.    
  160.     }
  161.                                                                    
  162.     void sheets_1() {
  163.         if (knowledge == true){
  164.                 text.text = "You take the dirty sheets off of the bed and knot it into an ESCAPE ROPE.\n\n" +
  165.                        
  166.                             "Want to do some pushups?\n\n" +
  167.                    
  168.                             "R to return to the middle of your cell.\n" +
  169.                             "P to do some pushups.";           
  170.                 takenSheets = true;            
  171.            
  172.                 if      (Input.GetKeyDown(KeyCode.R)){myState = States.cell_knowledge;}
  173.                 else if (Input.GetKeyDown(KeyCode.P)){myState = States.fatty;}
  174.            
  175.             } else {
  176.            
  177.                 text.text = "Your sheets don't look much different with the mirror.\n" +
  178.                             "Want to do some pushups?\n\n" +
  179.                    
  180.                             "R to return to the middle of your cell.\n" +
  181.                             "P to do some pushups.";   
  182.                                                        
  183.                 if      (Input.GetKeyDown(KeyCode.R)){myState = States.cell_mirror;}
  184.                 else if (Input.GetKeyDown(KeyCode.P)){myState = States.fatty;}
  185.             }
  186.     }  
  187.    
  188.     void locks_1() {
  189.         text.text = "You use the mirror to look outside the locked door. It looks like there's a key ring "+
  190.                     "on the floor to the right just out of reach!\n\n" +
  191.                    
  192.                     "R to return to cell.";
  193.        
  194.         knowledge = true;
  195.          
  196.        
  197.         if      (Input.GetKeyDown(KeyCode.R)){myState = States.cell_knowledge;}
  198.         else if (Input.GetKeyDown(KeyCode.P)){myState = States.fatty;} 
  199.     }  
  200.    
  201.     void cell_knowledge() {
  202.    
  203.         if (takenSheets == true) {
  204.             text.text = "The room is barren, save for a bedframe.\n\nAnd a thief holding a broken mirror and "+
  205.                         "some dirty bedsheets.\n\n" +
  206.                        
  207.                         "\nL to walk over to the door.";
  208.                        
  209.             if (Input.GetKeyDown(KeyCode.L)) {myState = States.corridor_0;}
  210.        
  211.         }else{
  212.                
  213.             text.text = "The only thing in the cell that isn't bolted down are the sheets in your bed. "+
  214.                         "\n\nAre you going to take those too, thief?\n\n" +
  215.                    
  216.                         "\nS to walk over to bed.\n" +
  217.                         "L to walk over to the door.";
  218.                    
  219.             if      (Input.GetKeyDown(KeyCode.S)) {myState = States.sheets_1;}     
  220.             else if (Input.GetKeyDown(KeyCode.L)) {myState = States.locks_1;}
  221.         }      
  222.                    
  223.    
  224.     }
  225.  
  226.     void corridor_0() {
  227.         text.text = "You throw the ESCAPE ROPE onto the keys and drag them towards you. " +
  228.                     "\n\nYou quickly unlock the door to find yourself in a hallway with doors on either side.\n\n" +
  229.                     "\nR - to walk over to the right door.\n" +
  230.                     "L - to check out the left door.";
  231.                    
  232.         if (Input.GetKeyDown(KeyCode.R)) {myState = States.cell_stairwell;}
  233.         if (Input.GetKeyDown(KeyCode.L)) {myState = States.left_door;}
  234.     }
  235.                            
  236.     void left_door() {
  237.         if (desecrate == false){
  238.                 text.text = "There is a barred metal door, akin to the one in your cell. " +
  239.                             "\nIt's locked." + " " + "\n\n" +
  240.                             "R to go check the other door.";
  241.                 if (Input.GetKeyDown(KeyCode.R)) {myState = States.cell_stairwell;}
  242.         }
  243.         if (desecrate == true && barracksUnlocked == false){
  244.                 text.text = "There is a barred metal door, akin to the one in your cell.\n" +
  245.                             "Luckily, you've just learned how to use a lockpick!\n\n" +
  246.                            
  247.                             "P - Pick the door, and continue through.";
  248.             if (Input.GetKeyDown(KeyCode.P)) {myState = States.barracks; barracksUnlocked = true;}
  249.         }
  250.         if (barracksUnlocked == true){
  251.                 text.text = "The barred door is unlocked.\n\n" +
  252.                             "B - Head to the Barracks.";
  253.                 if (Input.GetKeyDown(KeyCode.B)) {myState = States.barracks;}
  254.         }
  255.                        
  256.     }
  257.    
  258.     void cell_stairwell() {
  259.         text.text = "You discover a stairwell leading downwards. There is a sign on the wall, marked Stairway to Cell Block A.\n\n" +
  260.        
  261.                     "D - Descend the stairs.\n" +
  262.                     "R - Return to the cell corridor.";
  263.         if (Input.GetKeyDown(KeyCode.D)) {myState = States.cell_block_a;}          
  264.         if (Input.GetKeyDown(KeyCode.R)) {myState = States.corridor_revisit;}
  265.     }
  266.        
  267.     void corridor_revisit() {
  268.         text.text = "You are back at the corridor of your old cell.\n\n" +
  269.        
  270.                     "L - Check out the left door.\n" +
  271.                     "R - Go back down to cell block A.\n";
  272.         if (Input.GetKeyDown(KeyCode.L)) {myState = States.left_door;}
  273.         if (Input.GetKeyDown(KeyCode.R)) {myState = States.cell_block_a;}
  274.     }
  275.    
  276.            
  277.     void cell_block_a() {
  278.         text.text = "You follow the stairs downward, and arrive at Cell Block A.\n" +
  279.                     "There looks to be something on the ground at the far end of the block.\n\n" +
  280.                    
  281.                     "W – Walk over to the end of the cell block\n" +
  282.                     "S – Go back up the stairs to your cell’s corridor\n";
  283.                    
  284.         if (Input.GetKeyDown(KeyCode.W)) {myState = States.mauled_man;}
  285.         if (Input.GetKeyDown(KeyCode.S)) {myState = States.corridor_revisit;}
  286.        
  287.     }
  288.    
  289.     void mauled_man() {
  290.         text.text = "Walking down the hall, a grotesque shape comes into view.\n\n"+
  291.                     "In front of you, lay the bloody semblance of a person mauled to death "+
  292.                     "by what looks to be some sort of crazed animal, a bear maybe?\n\n"+
  293.                     "The thought of a guard bear is almost too much to bear (lol).\n\n\n" +
  294.                    
  295.                     "L – to loot the corpse for valuables. You theiving bastard. Disgusting. Absolutely disgusting.\n" +
  296.                     "S – to go back upstairs.\n" +
  297.                     "E – Enter Cell.\n";
  298.                    
  299.         if (Input.GetKeyDown(KeyCode.L)) {myState = States.desecrated; desecrate = true; dogEvent = true;}
  300.         if (Input.GetKeyDown(KeyCode.S)) {myState = States.game_over_mauled;}
  301.         if (Input.GetKeyDown(KeyCode.E)) {myState = States.game_over_trapped;}
  302.     }
  303.    
  304.     void game_over_mauled() {
  305.         text.text = "You decide to go back upstairs. Turning away from the ravaged corpse, " +
  306.                     "you come face to face with a hulking dark, animalistic figure. \n" +
  307.                     "You get torn apart.\n\n" +
  308.                     "                                         GAME OVER\n" +
  309.                     "R - to retry...";
  310.         if (Input.GetKeyDown(KeyCode.R)) {myState = States.cell_block_a;}
  311.    
  312.     }
  313.    
  314.     void game_over_trapped() {
  315.         text.text = "You decide to not desecrate the remains of another unfortunate human being. " +
  316.                     "As you begin to step into the cell, you hear a low growling from behind.\n\n" +
  317.                     "You quickly turn, and notice a large animalistic figure creeping towards you. " +
  318.                     "It breaks into a full sprint down the corridor.\n" +
  319.                     "You quickly get inside the cell and close the door – it clicks shut.\n" +
  320.                     "Congratulations! You’ve just relocked yourself in another cell!\n" +
  321.                     "                                     GAME OVER\n\n" +
  322.                     "R - to retry...";
  323.         if (Input.GetKeyDown(KeyCode.R)) {myState = States.cell_block_a;}
  324.     }
  325.    
  326.     void desecrated() {
  327.         text.text = "You search the body of the dead man and find a lockpick.\n\n" +
  328.                     "After desecrating the corpse of this poor man for valuables, you hear a low growling at the end of the corridor. " +
  329.                     "You turn around to spot a dark shape careening towards you. \n\nFrantically, you tumble into the open cell, with the door slamming shut behind you. " +
  330.                     "It’s locked now. The dark shape turns out to be a vicious guard dog, " +
  331.                     "who is intent on getting into that cell and eating your insides.\n\n" +
  332.                    
  333.                     "K – to kick the dog through the barred door.\n" +
  334.                     "N – to take a nap. Maybe the dog will get bored and leave you alone.";
  335.         if (Input.GetKeyDown(KeyCode.K)) {myState = States.game_over_kicked;}
  336.         if (Input.GetKeyDown(KeyCode.N)) {myState = States.cell_escaped;}                                  
  337.     }
  338.    
  339.     void game_over_kicked() {
  340.         text.text = "You make an attempt to kick the dog through the bars of the cell door.\n\n" +
  341.                     "The dog latches onto your foot and pulls your leg almost completely through the bar opening. " +
  342.                     "It viciously chomps down until your blood meter hits 10%. \n\nReality fades to black, as you watch the dog rip into your arteries." +
  343.                     "\n\n\t\t\t\t\t\t\t\t\t...GAME OVER...\n\n"+
  344.                     "R to Retry...";
  345.                    
  346.                    
  347.         if (hasTreats == false)  {if (Input.GetKeyDown(KeyCode.R)) {myState = States.cell_block_a;}}
  348.         if (hasTreats == true) {if (Input.GetKeyDown(KeyCode.R)) {myState = States.bark_bark;}}
  349.    
  350.     }
  351.    
  352.     void cell_escaped() {
  353.         text.text = "That nap was pretty great. Seeing that the dog has moved on from trying to eat your insides has filled you with determination!" +
  354.                     "\n\nAll that determination has given you +1 to your lockpicking skill! You successfully lockpick the cell door.\n\n" +
  355.                     "S – to go to the stairwell and back up to your old cell.";
  356.                    
  357.         if (Input.GetKeyDown(KeyCode.S)) {myState = States.old_cell;}
  358.     }
  359.    
  360.     void old_cell() {
  361.         if (dogEvent == true){text.text = "You find yourself back at your old cell. " +
  362.                                           "You're filled with an absurd amount of unwanted nostalgia. " +
  363.                                           "Thankfully, your nostalgia trip is interruped by an imminent threat. The guard dog reappears, and starts dashing towards you! \n\n" +
  364.                                           "Looks like it patrols here! You lock yourself in your cell and wait for it to get tired of intimidating you. "+
  365.                                           "After a while you watch it go downstairs… You pick the lock and are free.\n\n" +
  366.                                           "R - to go back downstairs, towards cell block A.\n" +
  367.                                           "L - to go to the barred door.";
  368.             if (Input.GetKeyDown(KeyCode.R)) {myState = States.no_reason;}
  369.             if (Input.GetKeyDown(KeyCode.L)) {myState = States.left_door;}
  370.         }
  371.                                          
  372.         if (dogEvent == false && ruff == false){text.text = "Back at your old cell, nothing to see here really.\n\n" +
  373.                                                             "R - Go downstairs to cell block A.\n" +
  374.                                                             "B - Go to the barracks.";
  375.             if (Input.GetKeyDown(KeyCode.R)) {myState = States.no_reason;}
  376.             if (Input.GetKeyDown(KeyCode.B)) {myState = States.barracks;}
  377.            
  378.         }
  379.        
  380.         if (dogEvent == false && ruff == true){text.text = "Back at your old cell. Nothing really new here. \n\nYou should go see what the dog managed to do " +
  381.                                                             "to the guard downstairs.\n\n" +
  382.                                                             "R - Go downstairs to Cell Block A.\n" +
  383.                                                             "B - Go back to the barracks.";
  384.             if (Input.GetKeyDown(KeyCode.R)) {myState = States.interrogate;}
  385.             if (Input.GetKeyDown(KeyCode.B)) {myState = States.barracks;}
  386.         }
  387.        
  388.         if (dogEvent == false && ruff == true && hasTaser == true){text.text = "Back at your old cell. Nothing really new here. \n\n" +
  389.                 "R - Go downstairs to cell block A.\n" +
  390.                 "B - Go to the Barracks.";
  391.             if (Input.GetKeyDown(KeyCode.R)) {myState = States.interrogate;}
  392.             if (Input.GetKeyDown(KeyCode.B)) {myState = States.barracks;}
  393.         }
  394.                    
  395.                                                
  396.        
  397.        
  398.     }
  399.    
  400.     void no_reason(){
  401.         text.text = "You've seen what dwells in cell block A.\n"+
  402.                     "You decide to stay the hell away from there.\n\n" +
  403.                     "B - to go back to the barred door.";
  404.         if (Input.GetKeyDown(KeyCode.B)) {myState = States.left_door;}
  405.         }
  406.        
  407.                        
  408.    
  409.     void barracks(){
  410.         if ( ruff == false &&  hasTaser == false &&  hasTreats == false)
  411.             {text.text = "You follow a winding staircase that leads you to a guard barracks. " +
  412.                          "There is a sleeping guard in the corner of the room. " +
  413.                          "The stench of cheap vodka permeates the entire dwelling.\n\nYou notice open lockers, and " +
  414.                          "a bag of dog treats on the table next to the guard. " +
  415.                          "There is a door – marked “EXIT”, adjacent to the alcoholic guard.\n\n" +
  416.                          
  417.                          "S - Quietly search the lockers.\n" +
  418.                          "E - Sneak over to the door.\n" +
  419.                          "T - Sneak over to the table, and grab the dog treats.";
  420.                          
  421.             if (Input.GetKeyDown(KeyCode.S)) {myState = States.game_over_knockout; choice = "lockers";}
  422.             if (Input.GetKeyDown(KeyCode.E)) {myState = States.game_over_knockout; choice = "door";}
  423.             if (Input.GetKeyDown(KeyCode.T)) {myState = States.search_treats;}
  424.         }                
  425.                      
  426.                      
  427.         if ( ruff == false &&  hasTaser == false &&  hasTreats == true)
  428.             {text.text ="Still in the barracks.\n" +
  429.                         "There is a sleeping guard in the corner of the room.\n" +
  430.                         "You notice open lockers. \n"+
  431.                         "There is a door – marked ''EXIT'', adjacent to the guard.\n\n"+
  432.                        
  433.                         "S - Quietly search the lockers.\n" +
  434.                         "E - Sneak over to the Exit door, to see if it's unlocked.\n" +
  435.                         "C - To head back to your old cell.";
  436.                        
  437.             if (Input.GetKeyDown(KeyCode.S)) {myState = States.game_over_knockout; choice = "lockers";}
  438.             if (Input.GetKeyDown(KeyCode.E)) {myState = States.game_over_knockout; choice = "door";}
  439.             if (Input.GetKeyDown(KeyCode.C)) {myState = States.bark_bark;}
  440.         }
  441.                    
  442.                    
  443.                    
  444.                    
  445.         if ( ruff == true &&  hasTaser == false &&  hasTreats == true){
  446.             text.text = "The guard is gone. Lockers line the side of the room, and there is a door marked EXIT.\n\n" +
  447.                          "S - Search the lockers.\n" +
  448.                          "E - Check out the Exit Door.\n" +
  449.                          "O - Head back to your old cell.";
  450.                          
  451.             if (Input.GetKeyDown(KeyCode.S)) {myState = States.search_taser;}
  452.             if (Input.GetKeyDown(KeyCode.E)) {myState = States.exit_door;}
  453.             if (Input.GetKeyDown(KeyCode.O)) {myState = States.old_cell;}
  454.         }              
  455.                        
  456.        
  457.         if ( ruff == true &&  hasTaser == true &&  hasTreats == true){
  458.             text.text = "You're in the Barracks. There is a door marked EXIT. It mocks you audibly. \n\nThose might just be the voices, though.\n" +
  459.                         "You did encounter a talking Shakespearean dog after all.\n\n\n" +
  460.                         "E - to check out the door marked EXIT.\n" +
  461.                         "O - to return to your old cell.\n";
  462.             if (Input.GetKeyDown(KeyCode.E)) {myState = States.exit_door;}
  463.             if (Input.GetKeyDown(KeyCode.O)) {myState = States.old_cell;}
  464.         }
  465.                    
  466.     }
  467.    
  468.     void game_over_knockout() {
  469.         text.text = "You sneak over to the "+ choice +", being careful not to wake the guard. \n\n" +
  470.                     "While trying to be extra sneaky, you trip over your own feet and go crashing into the "+choice+"!\n" +
  471.                     "The guard awakens from his drunken slumber – and reaches for his taser. " +
  472.                     "Before you know it, you’re on the floor being shocked!\n\n Don’t think I forgot that you’re quite a bit overweight. " +
  473.                     "The shocks cause you to go into cardiac arrest, and you die!\n\n" +
  474.                     "\t\t\t\t\t\t\t\t\t...GAME OVER...\n\n"+
  475.                     "R - to Retry...";
  476.         if (Input.GetKeyDown(KeyCode.R)) {myState = States.old_cell; dogEvent = true; barracksUnlocked = false; hasTreats = false;}
  477.     }
  478.                    
  479.     void search_treats() {
  480.         text.text = "You sneakily walk up to the bag of treats, trying your best not to wake the guard.\n\n" +
  481.                     "You obtain one bag of Skewbie Snacks™!\n\n" +
  482.                     "B – to continue";
  483.                    
  484.         if (Input.GetKeyDown(KeyCode.B)) {myState = States.barracks; hasTreats = true;}
  485.     }
  486.    
  487.     void search_taser(){
  488.         text.text = "You walk up to each locker and try to open them. " +
  489.                     "Most of them are locked, but you get lucky. \n\n" +
  490.                     "Out of ten lockers, two were open. \n\nYou find a Taser and bottle of vodka! \n\n\n\n" +
  491.                     "B - Return to the barracks entrance.";
  492.                    
  493.         if (Input.GetKeyDown(KeyCode.B)) {myState = States.barracks; hasTaser = true;}
  494.                                        
  495.     }
  496.    
  497.     void exit_door(){
  498.         if (freedomKey == false){       text.text = "The door is locked. Knowing that you may find the key someday fills you with determination!\n\n" +
  499.                                                     "B - Head back to the barracks entrance.";
  500.                                         if (Input.GetKeyDown(KeyCode.B)) {myState = States.barracks;}
  501.         }else{
  502.             text.text = "Walking up to the locked door, key in hand, fills you with determination. You unlock the door to freedom, and walk through...\n\n" +
  503.                         "\t\t\t\t\t\t\t\t\t\tYou WIN!\n\n\n" +
  504.                         "R - Wow that was really fun. I'm going to press R to play again! Just kidding. I'd rather go play something else. Like CounterStrike.";       
  505.                                         if (Input.GetKeyDown(KeyCode.R)) {myState = States.cell; resetGame();}     
  506.         }      
  507.     }
  508.    
  509.     void bark_bark() {
  510.         text.text = "While walking past your cell, you hear a low growl. " +
  511.                     "It looks like the guard dog is coming up the stairs! \n\n" +
  512.                     "It starts to race towards you. You go inside your old cell and close the door.\n\n" +
  513.                     "The dog is frantically trying to get through the bars, all the while growling and gnashing its teeth. At this point, you really want to kick this dog in the face.\n\n"+
  514.                     "K - Kick the dog in the face.\n"+
  515.                     "G - Give the dog some Treats.";
  516.                    
  517.             if (Input.GetKeyDown(KeyCode.K)) {myState = States.game_over_kicked;}
  518.             if (Input.GetKeyDown(KeyCode.G)) {myState = States.bark_bark2;}            
  519.     }
  520.    
  521.     void bark_bark2() {
  522.         text.text = "You hold up the bag of treats. The dog stops barking and looks intently at you. " +
  523.                     "You throw the bag of treats outside of the cell. The dog quickly eats them and begins to talk to you! " +
  524.                 "\n\n“Human, within this wall of flesh, there is a soul that counts thee its creditor. I bethought I wast waste away. Allow me to grant thee a favor.”" +
  525.                     "\n\nThe dog scurries off. Minutes later, you see a dog with a vodka bottle in its mouth, " +
  526.                     "and a guard in hot pursuit. They go downstairs to Cell Block A.\n\n" +
  527.                     "L - Lockpick the cell door.";
  528.         if (Input.GetKeyDown(KeyCode.L)) {myState = States.old_cell; ruff = true; dogEvent = false;}
  529.     }
  530.    
  531.     void interrogate() {
  532.         if (hasTaser == true && givenVodka == false) {
  533.             text.text = "You head down to Cell Block A, where you find the guard locked in the cell next to the dead man. \n\n" +
  534.                         "The guard offers you the key to freedom if you let him out. \n\n" +
  535.                         "There is a shattered bottle of vodka in the cell.\n\n" +
  536.                         "U - Unlock the door for the guard.\n" +
  537.                         "O - Offer the vodka in exchange for the key to freedom.\n"+
  538.                         "S - Go Back upstairs to your old cell.";
  539.             if (Input.GetKeyDown(KeyCode.U)) {myState = States.game_over_trust;}
  540.             if (Input.GetKeyDown(KeyCode.O)) {myState = States.getting_key; givenVodka = true;}
  541.             if (Input.GetKeyDown(KeyCode.S)) {myState = States.old_cell;}          
  542.            
  543.         } else if (hasTaser == false) {
  544.             text.text = "You head down to Cell Block A, where you find the guard locked in the cell next to the dead man. \n\n" +
  545.                         "The guard offers you the key to freedom if you let him out. \n\n" +
  546.                         "There is a shattered bottle of vodka in the cell.\n\n" +
  547.                         "U - Unlock the door for the guard.\n" +
  548.                         "S - Go Back upstairs to your old cell.";
  549.             if (Input.GetKeyDown(KeyCode.U)) {myState = States.game_over_trust;}
  550.             if (Input.GetKeyDown(KeyCode.S)) {myState = States.old_cell;}          
  551.        
  552.         } else if (givenVodka == true) {
  553.             text.text = "You head down to Cell Block A. There is a passed out guard in the cell next to the dead man.\n\n" +
  554.                         "Knowing that you helped contribute to his crippling alcoholism diminishes your determination. :(\n\n" +
  555.                         "\t\t\t\t\t\t\t\t...GAME OVER..." +
  556.                         "\n\n\n\n\n\nR - Just kidding. He would have killed you otherwise! Return to your old cell.";
  557.                        
  558.             if (Input.GetKeyDown(KeyCode.R)) {myState = States.old_cell;}
  559.         }
  560.     }
  561.  
  562.    
  563.     void game_over_trust() {
  564.         if (hasTaser) {
  565.             text.text = "You lockpick the door with the intention of tasing the guard once he gets out. " +
  566.                         "The guard reaches for his taser, and you reach for yours. Unfortunately, you forgot to check if the taser was charged. " +
  567.                         "\n\nThe guard tases you until you die. \n\n\t\t\t\t\t\t\t\t\tGAME OVER.\n\n" +
  568.                         "R - Retry";
  569.             if (Input.GetKeyDown(KeyCode.R)) {myState = States.barracks; hasTaser = false;}
  570.                        
  571.    
  572.         } else {
  573.             text.text = "You lockpick the cell door for the guard. He goes back on his promise and tazes you. Did you really think you could trust him?" +
  574.                         "\n\nYou have a heart attack and die.\n\n\t\t\t\t\t\t\t\t   ...GAME OVER...\n\n" +
  575.                         "R - Retry.";
  576.             if (Input.GetKeyDown(KeyCode.R)) {myState = States.interrogate;}
  577.         }  
  578.     }
  579.    
  580.     void getting_key() {
  581.             text.text = "You tell the guard that you’re not letting him out, " +
  582.                         "but you’re willing to make a trade. A large bottle of vodka for the exit key. " +
  583.                         "Without hesitation, the guard agrees.\n\nThis guard must really have a problem. " +
  584.                         "\n\nYou trade the vodka for a key marked “EXIT”.\n\n\n" +
  585.                         "R - to go back to your old cell.";
  586.                        
  587.             if (Input.GetKeyDown(KeyCode.R)) {myState = States.old_cell; freedomKey = true;}
  588.     }
  589.    
  590.     #endregion
  591. }// end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement