コード例 #1
0
    public void HackItem(string[] separatedInputWords)
    {
        string nounToHack = separatedInputWords[1];

        if (nounsInRoom.Contains(nounToHack))
        {
            foreach (InteractableObject o in controller.roomNavigation.currentRoom.interactableObjectsInRoom)
            {
                if (o.noun == nounToHack)
                {
                    bool b = TestForInteractibility(o);
                    if (b)
                    {
                        //Start the hacking music
                        controller.roomNavigation.defaultTrack.stop(FMOD.Studio.STOP_MODE.ALLOWFADEOUT);
                        HackingController.hackingTrack.start();
                        HackingController.hackingTrack.setVolume(hackingVolume * controller.roomNavigation.masterVolume);
                        HackingController.hackingIntensity.setValue(1);

                        //Reset the important file found tracking bool
                        HackingController.importantFileFound = false;

                        Debug.Log("Hacking");
                        controller.hacking = true;

                        //Find the correct library of files to load up for the player to interact with
                        HackingController.LoadLibrary(nounToHack);

                        //Switch UIs over
                        uiFader.FadeInPanel(controller.hackingUI);

                        //Switch the current input fields around, then run ActivateFields
                        textInput.currentField    = textInput.hackingInputField;
                        textInput.notCurrentField = textInput.inputField;
                        controller.ClearCurrentLog();

                        ActivateFields();

                        //Switch the display output to begin logging & outputting the appropriate display
                        controller.currentActionLog   = controller.hackingActionLog;
                        controller.currentDisplayText = controller.hackingDisplayText;
                    }
                }
            }
        }

        else
        {
            controller.LogStringWithReturn("You don't see a " + nounToHack + " here.");
        }
    }
コード例 #2
0
ファイル: HackDisplay.cs プロジェクト: bennymann569/JBCAT
    public override void RespondToInput(GameController controller, string[] separatedInputWords)
    {
        if (separatedInputWords.Length == 1)
        {
            controller.currentActionLog.Add("Please specify a file to display");
        }
        else
        {
            string stringToSearch = separatedInputWords[1];

            if (stringToSearch == "")
            {
                controller.currentActionLog.Add("Please specify a file to display");
            }
            else
            {
                HackingController.DisplayFile(stringToSearch);
            }
        }
    }