Example #1
0
    public static void AliceDialogue4()
    {
        string[]   lines = { "Something must be wrong with his\ncode..." };
        GameObject Alice = GameObject.Find("Alice");

        Filesystem.canEdit [Filesystem.GetIndexFromFilename("GarbageCollector.cs")] = true;
        Speech.Instance.Speak(lines, myName, 200.0f, null, staticIcon);
    }
Example #2
0
 public void GoBack()
 {
     Filesystem.canEdit [Filesystem.GetIndexFromFilename("GarbageCollector.cs")] = false;
     Carpenter.isFixed = true;
     AliceDialogue.Advance();
     Tunnel.shouldBeOnFire = true;
     RandomFiles.ShowFiles();
     SceneManager.LoadScene("Terminal");
 }
Example #3
0
 public void Interact()
 {
     if (canPass)
     {
         Filesystem.visible [Filesystem.GetIndexFromFilename("Anti-virus.exe")] = false;
         Filesystem.canRun [Filesystem.GetIndexFromFilename("Anti-virus.exe")]  = false;
         SourceManager.oldScene = sourceName;
         SceneManager.LoadScene(destinationName);
         AliceMovement.hasStarted = false;
     }
 }
Example #4
0
 void Update()
 {
     if (Input.GetKeyDown(KeyCode.Return))
     {
         string input = inputField.text;
         if (input.Equals(clearCommand))
         {
             Clear();
             return;
         }
         else if (input.Equals(listCommand))
         {
             if (numFiles != 0)
             {
                 pastText.text = string.Concat(pastText.text, input);
                 NewLine();
             }
             for (int i = 0; i < Filesystem.files.Length; i++)
             {
                 if ((Filesystem.files [i] == null) || (Filesystem.visible [i] == false))
                 {
                     continue;
                 }
                 pastText.text = string.Concat(pastText.text, "  ", Filesystem.files [i]);
                 if (i != Filesystem.files.Length - 1 && Filesystem.files [i + 1] != null && Filesystem.visible [i + 1])
                 {
                     NewLine();
                 }
             }
         }
         else if (Regex.IsMatch(input, string.Concat(openCommand, "  *")))
         {
             pastText.text = string.Concat(pastText.text, input);
             //NewLine ();
             string filename = input.Substring(openCommand.Length + 1);
             //Debug.Log (filename);
             inputField.text = "";
             bool found = false;
             for (int i = 0; i < Filesystem.files.Length; i++)
             {
                 if (Filesystem.files [i] != null && Filesystem.files [i].Equals(filename))
                 {
                     if (Filesystem.visible [i])
                     {
                         if (Filesystem.canEdit [i])
                         {
                             if (filename.Equals("Tools.cs"))
                             {
                                 SceneManager.LoadScene("Tools");
                             }
                             else if (filename.Equals("GarbageCollector.cs"))
                             {
                                 SceneManager.LoadScene("Garbage Collector");
                             }
                             else
                             {
                                 pastText.text = string.Concat(pastText.text, inputField.text);
                                 NewLine();
                                 pastText.text = string.Concat(pastText.text, string.Concat("  ERROR: Permission denied"));
                             }
                         }
                         else
                         {
                             pastText.text = string.Concat(pastText.text, inputField.text);
                             NewLine();
                             pastText.text = string.Concat(pastText.text, string.Concat("  ERROR: Permission denied"));
                         }
                         found = true;
                     }
                     break;
                 }
             }
             if (!found)
             {
                 pastText.text = string.Concat(pastText.text, inputField.text);
                 NewLine();
                 pastText.text = string.Concat(pastText.text, "  ERROR: File not found");
             }
         }
         else if (Regex.IsMatch(input, string.Concat(deleteCommand, "  *")))
         {
             string filename = input.Substring(deleteCommand.Length + 1);
             bool   found    = false;
             for (int i = 0; i < Filesystem.files.Length; i++)
             {
                 if (Filesystem.files [i] != null && Filesystem.files [i].Equals(filename) && Filesystem.visible [i])
                 {
                     pastText.text = string.Concat(pastText.text, inputField.text);
                     NewLine();
                     if (Filesystem.canDelete [i])
                     {
                         Filesystem.files [i] = null;
                         pastText.text        = string.Concat(pastText.text, string.Concat("  SUCCESS: Removed ", filename));
                         numFiles--;
                         //if (filename.Equals ("Walrus.txt")) {
                         //	WalrusManager.KillWalrus ();
                         //}
                     }
                     else
                     {
                         pastText.text = string.Concat(pastText.text, string.Concat("  ERROR: Permission denied"));
                     }
                     found = true;
                     break;
                 }
             }
             if (!found)
             {
                 pastText.text = string.Concat(pastText.text, inputField.text);
                 NewLine();
                 pastText.text = string.Concat(pastText.text, "  ERROR: File not found");
             }
         }
         else if (input.Equals(quitCommand))
         {
             SourceManager.oldScene = "Terminal";
             SceneManager.LoadScene(Filesystem.quitScene);
         }
         else if (Regex.IsMatch(input, string.Concat(runCommand, "  *")))
         {
             string filename = input.Substring(runCommand.Length + 1);
             bool   found    = false;
             for (int i = 0; i < Filesystem.files.Length; i++)
             {
                 if (Filesystem.files [i] != null && Filesystem.files [i].Equals(filename))
                 {
                     if (Filesystem.visible [i])
                     {
                         if (Filesystem.canRun [i])
                         {
                             if (filename.Equals("Alice.exe"))
                             {
                                 //SwitchWorlds.physical = false;
                                 sound1.GetComponent <AudioSource>().volume = 0.0f;
                                 sound2.GetComponent <AudioSource>().volume = 1.0f;
                                 Filesystem.canRun [0] = false;
                                 Filesystem.canEdit [Filesystem.GetIndexFromFilename("Tools.cs")] = true;
                                 SourceManager.oldScene = SceneManager.GetActiveScene().name;
                                 SceneManager.LoadScene("Bus Station 1");
                                 isRunningProgram = true;
                             }
                             else if (filename.Equals("Anti-virus.exe"))
                             {
                                 RabbitDialogue.Advance();
                             }
                             else
                             {
                                 pastText.text = string.Concat(pastText.text, inputField.text);
                                 NewLine();
                                 pastText.text = string.Concat(pastText.text, string.Concat("  ERROR: Permission denied"));
                             }
                         }
                         else
                         {
                             pastText.text = string.Concat(pastText.text, inputField.text);
                             NewLine();
                             pastText.text = string.Concat(pastText.text, string.Concat("  ERROR: Permission denied"));
                         }
                         found = true;
                     }
                     break;
                 }
             }
             if (!found)
             {
                 pastText.text = string.Concat(pastText.text, inputField.text);
                 NewLine();
                 pastText.text = string.Concat(pastText.text, "  ERROR: File not found");
             }
         }
         else if (input.Equals(pauseCommand))
         {
             if (isRunningProgram)
             {
                 sound1.GetComponent <AudioSource>().volume = 1.0f;
                 sound2.GetComponent <AudioSource>().volume = 0.0f;
                 Filesystem.canRun [0] = true;
                 Filesystem.canEdit [Filesystem.GetIndexFromFilename("Tools.cs")] = false;
                 SceneManager.LoadScene("Hub");
                 SourceManager.oldScene = SceneManager.GetActiveScene().name;
                 isRunningProgram       = false;
             }
             else
             {
                 pastText.text = string.Concat(pastText.text, inputField.text);
                 NewLine();
                 pastText.text = string.Concat(pastText.text, "  ERROR: No program running");
             }
         }
         else if (input.Equals(helpCommand))
         {
             pastText.text = string.Concat(pastText.text, inputField.text);
             NewLine();
             pastText.text = string.Concat(pastText.text, listCommand, " - Lists available files");
             NewLine();
             pastText.text = string.Concat(pastText.text, openCommand, " <filename> - Opens a file");
             NewLine();
             pastText.text = string.Concat(pastText.text, clearCommand, " - Clears the terminal screen");
             NewLine();
             pastText.text = string.Concat(pastText.text, deleteCommand, " <filename> - Deletes a file");
             NewLine();
             pastText.text = string.Concat(pastText.text, quitCommand, " - Quits out of the terminal");
             NewLine();
             pastText.text = string.Concat(pastText.text, runCommand, " <filename> - Runs an executable");
             NewLine();
             pastText.text = string.Concat(pastText.text, pauseCommand, " - pauses execution of running");
             NewLine();
             pastText.text = string.Concat(pastText.text, "        program");
             NewLine();
             pastText.text = string.Concat(pastText.text, helpCommand, " - I betcha can figure this one");
             NewLine();
             pastText.text = string.Concat(pastText.text, "       out on your own ;)");
         }
         else if (input.Equals(""))
         {
         }
         else
         {
             pastText.text = string.Concat(pastText.text, inputField.text);
             NewLine();
             pastText.text = string.Concat(pastText.text, "  ERROR: Invalid command");
         }
         pastText.text = string.Concat(pastText.text, inputField.text);
         NewLine();
         pastText.text = string.Concat(pastText.text, ">>> ");
     }
 }
Example #5
0
 void Awake()
 {
     Filesystem.visible [Filesystem.GetIndexFromFilename("Anti-virus.exe")] = true;
     Filesystem.canRun [Filesystem.GetIndexFromFilename("Anti-virus.exe")]  = true;
 }