コード例 #1
0
    public override void ServerGenerateNodesFromNodeInfo()
    {
        if (serverEndRoundHackingResetSetup == false)
        {
            ServerRegisterHackingReset();
        }

        List <HackingNodeInfo> infList = nodeInfo.nodeInfoList.ToList();

        Shuffle(infList, Controller.doorType);
        foreach (HackingNodeInfo inf in infList)
        {
            HackingNode newNode = new HackingNode();
            newNode.IsInput            = inf.IsInput;
            newNode.IsOutput           = inf.IsOutput;
            newNode.IsDeviceNode       = inf.IsDeviceNode;
            newNode.InternalIdentifier = inf.InternalIdentifier;
            newNode.HiddenLabel        = inf.HiddenLabel;
            newNode.PublicLabel        = inf.PublicLabel;

            if (inf.IsInput)
            {
                inputNodes.Add(newNode);
            }
            else
            {
                outputNodes.Add(newNode);
            }
        }

        hackNodes = inputNodes.Concat(outputNodes).ToList();
    }
コード例 #2
0
    public override void ServerGenerateNodesFromNodeInfo()
    {
        List <HackingNodeInfo> infList = nodeInfo.nodeInfoList.ToList();

        Shuffle(infList);
        foreach (HackingNodeInfo inf in infList)
        {
            HackingNode newNode = new HackingNode();
            newNode.IsInput            = inf.IsInput;
            newNode.IsOutput           = inf.IsOutput;
            newNode.IsDeviceNode       = inf.IsDeviceNode;
            newNode.InternalIdentifier = inf.InternalIdentifier;
            newNode.HiddenLabel        = inf.HiddenLabel;
            newNode.PublicLabel        = inf.PublicLabel;

            if (inf.IsInput)
            {
                inputNodes.Add(newNode);
            }
            else
            {
                outputNodes.Add(newNode);
            }
        }

        hackNodes = inputNodes.Concat(outputNodes).ToList();
    }
コード例 #3
0
    public void ServerPerformInteraction(HandApply interaction)
    {
        this.interaction = interaction;

        if (Validations.HasItemTrait(interaction.HandObject, CommonTraits.Instance.Crowbar))
        {
            TryCrowbar();
        }
        else if (!Controller.IsClosed)
        {
            TryClose();             // Close the door if it's open
        }
        else if (Validations.HasUsedActiveWelder(interaction))
        {
            TryWelder();             // Repair or un/weld door, or deconstruct false wall
        }
        // Attempt to open if it's closed
        //Tell the OnAttemptOpen node to activate.
        else if (Controller.IsHackable)
        {
            HackingNode onAttemptOpen = Controller.HackingProcess.GetNodeWithInternalIdentifier("OnAttemptOpen");
            onAttemptOpen.SendOutputToConnectedNodes(interaction.Performer);
        }
        else
        {
            TryOpen(interaction.Performer);
        }
    }
コード例 #4
0
    public void OnSpawnServer(SpawnInfo info)
    {
        if (!info.SpawnItems)
        {
            hasCables  = false;
            stateSync  = MountedMonitorState.OpenEmpty;
            statusText = GameManager.Instance.CentComm.CommandStatusString;
        }

        if (doorControllers.Count > 0)
        {
            OnTextBroadcastReceived(StatusDisplayChannel.DoorTimer);
            foreach (var door in doorControllers)
            {
                if (door.IsHackable)
                {
                    HackingNode outsideSignalOpen = door.HackingProcess.GetNodeWithInternalIdentifier(HackingIdentifier.OutsideSignalOpen);
                    outsideSignalOpen.AddConnectedNode(door.HackingProcess.GetNodeWithInternalIdentifier(HackingIdentifier.OpenDoor));
                    outsideSignalOpen.AddConnectedNode(door.HackingProcess.GetNodeWithInternalIdentifier(HackingIdentifier.CancelCloseTimer));

                    HackingNode outsideSignalClose = door.HackingProcess.GetNodeWithInternalIdentifier(HackingIdentifier.OutsideSignalClose);
                    outsideSignalClose.AddConnectedNode(door.HackingProcess.GetNodeWithInternalIdentifier(HackingIdentifier.CloseDoor));
                }
            }
        }
        SyncSprite(stateSync, stateSync);
        centComm = GameManager.Instance.CentComm;
        centComm.OnStatusDisplayUpdate.AddListener(OnTextBroadcastReceived);
    }
コード例 #5
0
    public void TryCrowbar()
    {
        if (Controller == null)
        {
            return;
        }

        if (Controller.IsHackable)
        {
            HackingNode onAttemptClose = Controller.HackingProcess.GetNodeWithInternalIdentifier("OnAttemptClose");
            onAttemptClose.SendOutputToConnectedNodes(interaction.Performer);
        }
        else
        {
            //TODO: force the opening/close if powerless but make sure firelocks are unaffected

            if (!Controller.IsClosed)
            {
                Controller.ServerTryClose();
            }
            else
            {
                Controller.ServerTryOpen(interaction.Performer);
            }
        }
    }
コード例 #6
0
    public void ServerOpen()
    {
        if (this == null || gameObject == null)
        {
            return;                                             // probably destroyed by a shuttle crash
        }
        if (Time.time < delayStartTime + inputDelay)
        {
            return;
        }

        delayStartTime = Time.time;

        ResetWaiting();
        IsClosed = false;

        if (isHackable && hackingLoaded)
        {
            HackingNode onDoorOpened = hackingProcess.GetNodeWithInternalIdentifier("OnDoorOpened");
            onDoorOpened.SendOutputToConnectedNodes();
        }

        if (!isPerformingAction)
        {
            DoorUpdateMessage.SendToAll(gameObject, DoorUpdateType.Open);
        }
    }
コード例 #7
0
    public void ServerTryClose()
    {
        if (Time.time < delayStartTimeTryOpen + inputDelay)
        {
            return;
        }

        delayStartTimeTryOpen = Time.time;

        // Sliding door is not passable according to matrix
        if (!IsClosed && !isPerformingAction && (matrix.CanCloseDoorAt(registerTile.LocalPositionServer, true) || doorType == DoorType.sliding))
        {
            if (isHackable && hackingLoaded)
            {
                HackingNode onShouldClose = hackingProcess.GetNodeWithInternalIdentifier("OnShouldClose");
                onShouldClose.SendOutputToConnectedNodes();
            }
            // Sliding door is not passable according to matrix
            if (!IsClosed && !isPerformingAction && (ignorePassableChecks || matrix.CanCloseDoorAt(registerTile.LocalPositionServer, true) || doorType == DoorType.sliding))
            {
                ServerClose();
            }
            else
            {
                ServerClose();
            }
        }
        else
        {
            ResetWaiting();
        }
    }
コード例 #8
0
    public virtual void AddNodeConnection(int[] connection)
    {
        if (connection.Length != 2)
        {
            return;
        }

        if (hackNodes.ElementAtOrDefault(connection[0]) == null || hackNodes[connection[0]] == null)
        {
            return;
        }

        HackingNode outputNode = hackNodes[connection[0]];

        if (hackNodes.ElementAtOrDefault(connection[1]) == null || hackNodes[connection[1]] == null)
        {
            return;
        }

        HackingNode inputNode = hackNodes[connection[1]];

        bool nodeNotNull = outputNode != null && inputNode != null;

        bool isOutputAndInput = outputNode.IsOutput && inputNode.IsInput;

        bool notAlreadyHasNode = !outputNode.ConnectedInputNodes.Contains(inputNode);

        if (nodeNotNull && isOutputAndInput && notAlreadyHasNode)
        {
            outputNode.AddConnectedNode(inputNode);
        }
    }
コード例 #9
0
ファイル: GUI_Hacking.cs プロジェクト: ktndrnl/unitystation
    public void RemoveWire(GUI_HackingWire wireUI)
    {
        //Temporary. We should eventually sync this up with a a unified server/client check for whether someone can remove a wire from the hacking process.
        Pickupable handItem = PlayerManager.LocalPlayerScript.Equipment.ItemStorage.GetActiveHandSlot().Item;

        if (handItem == null || !Validations.HasItemTrait(handItem.gameObject, CommonTraits.Instance.Wirecutter))
        {
            return;
        }

        if (wireUI.StartNode == null || wireUI.EndNode == null)
        {
            return;
        }

        HackingNode outputNode = wireUI.StartNode.HackNode;
        HackingNode inputNode  = wireUI.EndNode.HackNode;

        outputNode.RemoveConnectedNode(inputNode);
        SoundManager.PlayNetworkedAtPos(Wirecut, PlayerManager.LocalPlayerScript.WorldPos);

        //If we're on client, network to the server the changes we made.
        if (!IsServer)
        {
            int   outIndex           = hackNodes.IndexOf(outputNode);
            int   inIndex            = hackNodes.IndexOf(inputNode);
            int[] connectionToRemove = { outIndex, inIndex };
            RemoveHackingConnection.Send(PlayerManager.LocalPlayerScript.gameObject, hackProcess.gameObject, connectionToRemove);
        }

        hackingWires.Remove(wireUI);
        Destroy(wireUI.gameObject);
    }
コード例 #10
0
        public void LinkHackNodes()
        {
            //door opening
            HackingNode openDoor = hackingProcess.GetNodeWithInternalIdentifier(HackingIdentifier.OpenDoor);

            openDoor.AddToInputMethods(HackingTryOpen);

            HackingNode onShouldOpen = hackingProcess.GetNodeWithInternalIdentifier(HackingIdentifier.OnShouldOpen);

            onShouldOpen.AddWireCutCallback(ServerElectrocute);
            onShouldOpen.AddConnectedNode(openDoor);

            //door closing
            HackingNode closeDoor = hackingProcess.GetNodeWithInternalIdentifier(HackingIdentifier.CloseDoor);

            closeDoor.AddToInputMethods(TryClose);

            HackingNode onShouldClose = hackingProcess.GetNodeWithInternalIdentifier(HackingIdentifier.OnShouldClose);

            onShouldClose.AddWireCutCallback(ServerElectrocute);
            onShouldClose.AddConnectedNode(closeDoor);

            //ID reject
            HackingNode rejectID = hackingProcess.GetNodeWithInternalIdentifier(HackingIdentifier.RejectId);

            rejectID.AddToInputMethods(ServerAccessDenied);

            HackingNode onIDRejected = hackingProcess.GetNodeWithInternalIdentifier(HackingIdentifier.OnIdRejected);

            onIDRejected.AddConnectedNode(rejectID);

            //pressure warning
            HackingNode doPressureWarning = hackingProcess.GetNodeWithInternalIdentifier(HackingIdentifier.DoPressureWarning);

            doPressureWarning.AddToInputMethods(ServerPressureWarn);

            HackingNode shouldDoPressureWarning = hackingProcess.GetNodeWithInternalIdentifier(HackingIdentifier.ShouldDoPressureWarning);

            shouldDoPressureWarning.AddConnectedNode(doPressureWarning);

            //power
            HackingNode powerIn = hackingProcess.GetNodeWithInternalIdentifier(HackingIdentifier.PowerIn);

            HackingNode powerOut = hackingProcess.GetNodeWithInternalIdentifier(HackingIdentifier.PowerOut);

            powerOut.AddConnectedNode(powerIn);
            powerOut.AddWireCutCallback(ServerElectrocute);

            //dummy
            HackingNode dummyIn = hackingProcess.GetNodeWithInternalIdentifier(HackingIdentifier.DummyIn);

            HackingNode dummyOut = hackingProcess.GetNodeWithInternalIdentifier(HackingIdentifier.DummyOut);

            dummyOut.AddConnectedNode(dummyIn);

            //close timer
            HackingNode cancelCloseTimer = hackingProcess.GetNodeWithInternalIdentifier(HackingIdentifier.CancelCloseTimer);

            cancelCloseTimer.AddToInputMethods(CancelWaiting);
        }
コード例 #11
0
    /// <summary>
    /// Remove a connection between two nodes. keyOutput is the index of the output node, similar for key input.
    /// </summary>
    /// <param name="keyOutput"></param>
    /// <param name="keyInput"></param>
    public virtual void RemoveNodeConnection(int keyOutput, int keyInput)
    {
        HackingNode outputNode = GetHackNodes()[keyOutput];
        HackingNode inputNode  = GetHackNodes()[keyInput];

        if (outputNode != null && inputNode != null && outputNode.IsOutput && inputNode.IsInput)
        {
            outputNode.RemoveConnectedNode(inputNode);
        }
    }
コード例 #12
0
 public void OnSpawnServer(SpawnInfo info)
 {
     inputNode = new HackingNode();
     inputNode.AddToInputMethods(onInputReceived.Invoke);
     inputNode.HiddenLabel   = "Input";
     inputNode.IsInput       = true;
     inputNode.IsDeviceNode  = true;
     outputNode              = new HackingNode();
     outputNode.HiddenLabel  = "Output";
     outputNode.IsOutput     = true;
     outputNode.IsDeviceNode = true;
 }
コード例 #13
0
    public virtual void ServerPlayerRemoveConnection(PlayerScript player, int[] connection)
    {
        int outIndex = connection[0];
        int inIndex  = connection[1];

        HackingNode node = hackNodes[outIndex];

        if (node != null)
        {
            node.WireCutCallback(player.gameObject);
        }
        RemoveNodeConnection(connection);
    }
コード例 #14
0
    //Node list is just undefined nodes for the client. Important, because it means that the client does not know what nodes does what. It just needs the same amount of nodes.
    public virtual void ClientGenerateNodesFromNodeInfo()
    {
        foreach (HackingNodeInfo inf in nodeInfo.nodeInfoList)
        {
            HackingNode newNode = new HackingNode();
            newNode.IsInput      = inf.IsInput;
            newNode.IsOutput     = inf.IsOutput;
            newNode.IsDeviceNode = inf.IsDeviceNode;
            newNode.PublicLabel  = inf.PublicLabel;

            hackNodes.Add(newNode);
        }
    }
コード例 #15
0
 public void OnSpawnClient(ClientSpawnInfo info)
 {
     if (!CustomNetworkManager.IsServer)
     {
         inputNode               = new HackingNode();
         inputNode.HiddenLabel   = "Input";
         inputNode.IsInput       = true;
         inputNode.IsDeviceNode  = true;
         outputNode              = new HackingNode();
         outputNode.HiddenLabel  = "Output";
         outputNode.IsOutput     = true;
         outputNode.IsDeviceNode = true;
     }
 }
コード例 #16
0
 /// <summary>
 /// Invoke this on server when player bumps into door to try to open it.
 /// </summary>
 public void Bump(GameObject byPlayer)
 {
     if (Controller.IsClosed && Controller.IsAutomatic)
     {
         if (Controller.IsHackable)
         {
             HackingNode onAttemptOpen = Controller.HackingProcess.GetNodeWithInternalIdentifier("OnAttemptOpen");
             onAttemptOpen.SendOutputToConnectedNodes(byPlayer);
         }
         else
         {
             TryOpen(byPlayer);
         }
     }
 }
コード例 #17
0
 private void OnEnable()
 {
     inputNode               = new HackingNode();
     inputNode.HiddenLabel   = "Input";
     inputNode.IsInput       = true;
     inputNode.IsDeviceNode  = true;
     outputNode              = new HackingNode();
     outputNode.HiddenLabel  = "Output";
     outputNode.IsOutput     = true;
     outputNode.IsDeviceNode = true;
     if (CustomNetworkManager.IsServer)
     {
         inputNode.AddToInputMethods(onInputReceived.Invoke);
     }
 }
コード例 #18
0
    public virtual void ServerGenerateNodesFromNodeInfo()
    {
        foreach (HackingNodeInfo inf in nodeInfo.nodeInfoList)
        {
            HackingNode newNode = new HackingNode();
            newNode.IsInput            = inf.IsInput;
            newNode.IsOutput           = inf.IsOutput;
            newNode.IsDeviceNode       = inf.IsDeviceNode;
            newNode.InternalIdentifier = inf.InternalIdentifier;
            newNode.HiddenLabel        = inf.HiddenLabel;
            newNode.PublicLabel        = inf.PublicLabel;

            hackNodes.Add(newNode);
        }
    }
コード例 #19
0
    public virtual void RemoveNodeConnection(int[] connection)
    {
        if (connection.Length != 2)
        {
            return;
        }

        HackingNode outputNode = GetHackNodes()[connection[0]];
        HackingNode inputNode  = GetHackNodes()[connection[1]];

        if (outputNode != null && inputNode != null && outputNode.IsOutput && inputNode.IsInput)
        {
            outputNode.RemoveConnectedNode(inputNode);
        }
    }
コード例 #20
0
ファイル: DoorSwitch.cs プロジェクト: Basipek/unitystation
    public void OnSpawnServer(SpawnInfo info)
    {
        foreach (var door in doorControllers)
        {
            if (door == null)
            {
                continue;
            }

            if (door.IsHackable)
            {
                HackingNode outsideSignalOpen = door.HackingProcess.GetNodeWithInternalIdentifier(HackingIdentifier.OutsideSignalOpen);
                outsideSignalOpen.AddConnectedNode(door.HackingProcess.GetNodeWithInternalIdentifier(HackingIdentifier.OpenDoor));

                HackingNode outsideSignalClose = door.HackingProcess.GetNodeWithInternalIdentifier(HackingIdentifier.OutsideSignalClose);
                outsideSignalClose.AddConnectedNode(door.HackingProcess.GetNodeWithInternalIdentifier(HackingIdentifier.CloseDoor));
            }
        }
    }
コード例 #21
0
    public override void ClientGenerateNodesFromNodeInfo()
    {
        List <HackingNodeInfo> infList = nodeInfo.nodeInfoList;

        foreach (HackingNodeInfo inf in infList)
        {
            HackingNode newNode = new HackingNode();
            newNode.IsInput      = inf.IsInput;
            newNode.IsOutput     = inf.IsOutput;
            newNode.IsDeviceNode = inf.IsDeviceNode;
            newNode.PublicLabel  = inf.PublicLabel;

            if (inf.IsInput)
            {
                inputNodes.Add(newNode);
            }
            else
            {
                outputNodes.Add(newNode);
            }
        }
        hackNodes = inputNodes.Concat(outputNodes).ToList();
    }
コード例 #22
0
    public void ServerPerformInteraction(HandApply interaction)
    {
        if (Validations.HasItemTrait(interaction.HandObject, CommonTraits.Instance.Crowbar))
        {
            if (Controller.IsHackable)
            {
                HackingNode onAttemptClose = Controller.HackingProcess.GetNodeWithInternalIdentifier("OnAttemptClose");
                onAttemptClose.SendOutputToConnectedNodes(interaction.Performer);
            }
            else
            {
                TryCrowbar(interaction.Performer);
            }
        }
        else if (!Controller.IsClosed)
        {
            TryClose();             // Close the door if it's open
        }
        else
        {
            if (Validations.HasItemTrait(interaction.HandObject, CommonTraits.Instance.Welder))             // welding the door (only if closed and not helping)
            {
                if (Controller.IsWeldable)
                {
                    var welder = interaction.HandObject.GetComponent <Welder>();
                    if (welder.IsOn && interaction.Intent != Intent.Help)
                    {
                        void ProgressComplete()
                        {
                            if (Controller != null)
                            {
                                Chat.AddExamineMsgFromServer(interaction.Performer,
                                                             "You " + (Controller.IsWelded ? "unweld" : "weld") + " the door.");
                                Controller.ServerTryWeld();
                            }
                        }

                        var bar = StandardProgressAction.CreateForWelder(ProgressConfig, ProgressComplete, welder)
                                  .ServerStartProgress(interaction.Performer.transform.position, weldTime, interaction.Performer);
                        if (bar != null)
                        {
                            SoundManager.PlayNetworkedAtPos("Weld", interaction.Performer.transform.position, UnityEngine.Random.Range(0.8f, 1.2f), sourceObj: interaction.Performer);
                            Chat.AddExamineMsgFromServer(interaction.Performer, "You start " + (Controller.IsWelded ? "unwelding" : "welding") + " the door...");
                        }

                        return;
                    }
                }
                else if (!Controller.IsAutomatic)
                {
                    ToolUtils.ServerUseToolWithActionMessages(interaction, 4f,
                                                              "You start to disassemble the false wall...",
                                                              $"{interaction.Performer.ExpensiveName()} starts to disassemble the false wall...",
                                                              "You disassemble the girder.",
                                                              $"{interaction.Performer.ExpensiveName()} disassembles the false wall.",
                                                              () => Controller.ServerDisassemble(interaction));
                    return;
                }
            }

            // Attempt to open if it's closed
            //Tell the OnAttemptOpen node to activate.
            if (Controller.IsHackable)
            {
                HackingNode onAttemptOpen = Controller.HackingProcess.GetNodeWithInternalIdentifier("OnAttemptOpen");
                onAttemptOpen.SendOutputToConnectedNodes(interaction.Performer);
            }
            else
            {
                Controller.ServerTryOpen(interaction.Performer);
            }
        }

        StartInputCoolDown();
    }
コード例 #23
0
ファイル: HackingNode.cs プロジェクト: talentone/unitystation
 public virtual void RemoveConnectedNode(HackingNode node)
 {
     connectedInputNodes.Remove(node);
 }
コード例 #24
0
ファイル: GUI_Hacking.cs プロジェクト: ktndrnl/unitystation
 /// <summary>
 /// Gets the UI component of a node inside the system. Every node should have a UI component, so this shouldn't ever return null. If it does, uh oh.
 /// </summary>
 /// <param name="node"></param>
 /// <returns></returns>
 private GUI_HackingNode GetUIComponentOfNode(HackingNode node)
 {
     return(nodeUIObjects.Find(x => x.HackNode.Equals(node)));
 }
コード例 #25
0
ファイル: HackingNode.cs プロジェクト: talentone/unitystation
 public virtual void AddConnectedNode(HackingNode node)
 {
     connectedInputNodes.Add(node);
 }
コード例 #26
0
    public void ServerTryOpen(GameObject Originator)
    {
        if (Time.time < delayStartTimeTryOpen + inputDelay)
        {
            return;
        }

        delayStartTimeTryOpen = Time.time;

        if (isWelded)
        {
            Chat.AddExamineMsgFromServer(Originator, "This door is welded shut.");
            return;
        }
        if (AccessRestrictions != null)
        {
            if (!AccessRestrictions.CheckAccess(Originator))
            {
                if (IsClosed && !isPerformingAction)
                {
                    if (isHackable && hackingLoaded)
                    {
                        HackingNode onIDRejected = hackingProcess.GetNodeWithInternalIdentifier("OnIDRejected");
                        onIDRejected.SendOutputToConnectedNodes(Originator);
                    }
                    else
                    {
                        ServerAccessDenied();
                    }
                    return;
                }
            }
        }

        if (IsClosed && !isPerformingAction)
        {
            if (!pressureWarnActive && DoorUnderPressure())
            {
                if (isHackable && hackingLoaded)
                {
                    HackingNode shouldDoPressureWarn = hackingProcess.GetNodeWithInternalIdentifier("ShouldDoPressureWarning");
                    shouldDoPressureWarn.SendOutputToConnectedNodes(Originator);
                }
                else
                {
                    ServerPressureWarn();
                }
            }
            else
            {
                if (isHackable && hackingLoaded)
                {
                    HackingNode onShouldOpen = hackingProcess.GetNodeWithInternalIdentifier("OnShouldOpen");
                    onShouldOpen.SendOutputToConnectedNodes(Originator);
                }
                else
                {
                    ServerOpen();
                }
            }
        }
    }
コード例 #27
0
    public void LinkHackNodes()
    {
        HackingNode openDoor = hackingProcess.GetNodeWithInternalIdentifier("OpenDoor");

        openDoor.AddToInputMethods(ServerOpen);

        HackingNode closeDoor = hackingProcess.GetNodeWithInternalIdentifier("CloseDoor");

        closeDoor.AddToInputMethods(ServerClose);

        HackingNode beginOpenProcedure = hackingProcess.GetNodeWithInternalIdentifier("BeginOpenProcedure");

        beginOpenProcedure.AddToInputMethods(ServerTryOpen);

        HackingNode beginCloseProcedure = hackingProcess.GetNodeWithInternalIdentifier("BeginCloseProcedure");

        beginCloseProcedure.AddToInputMethods(ServerTryClose);

        HackingNode onAttemptOpen = hackingProcess.GetNodeWithInternalIdentifier("OnAttemptOpen");

        onAttemptOpen.AddConnectedNode(beginOpenProcedure);

        HackingNode onAttemptClose = hackingProcess.GetNodeWithInternalIdentifier("OnAttemptClose");

        onAttemptClose.AddConnectedNode(beginCloseProcedure);

        HackingNode onShouldOpen = hackingProcess.GetNodeWithInternalIdentifier("OnShouldOpen");

        onShouldOpen.AddWireCutCallback(ServerElectrocute);
        onShouldOpen.AddConnectedNode(openDoor);

        HackingNode onShouldClose = hackingProcess.GetNodeWithInternalIdentifier("OnShouldClose");

        onShouldClose.AddWireCutCallback(ServerElectrocute);
        onShouldClose.AddConnectedNode(closeDoor);

        HackingNode acceptID = hackingProcess.GetNodeWithInternalIdentifier("AcceptId");

        HackingNode rejectID = hackingProcess.GetNodeWithInternalIdentifier("RejectID");

        rejectID.AddToInputMethods(ServerAccessDenied);

        HackingNode onIDRejected = hackingProcess.GetNodeWithInternalIdentifier("OnIDRejected");

        onIDRejected.AddConnectedNode(rejectID);

        HackingNode doPressureWarning = hackingProcess.GetNodeWithInternalIdentifier("DoPressureWarning");

        doPressureWarning.AddToInputMethods(ServerPressureWarn);

        HackingNode shouldDoPressureWarning = hackingProcess.GetNodeWithInternalIdentifier("ShouldDoPressureWarning");

        shouldDoPressureWarning.AddConnectedNode(doPressureWarning);

        HackingNode onDoorOpened = hackingProcess.GetNodeWithInternalIdentifier("OnDoorOpened");

        HackingNode onDoorClosed = hackingProcess.GetNodeWithInternalIdentifier("OnDoorClosed");

        HackingNode powerIn = hackingProcess.GetNodeWithInternalIdentifier("PowerIn");

        HackingNode powerOut = hackingProcess.GetNodeWithInternalIdentifier("PowerOut");

        powerOut.AddConnectedNode(powerIn);
        powerOut.AddWireCutCallback(ServerElectrocute);

        HackingNode dummyIn = hackingProcess.GetNodeWithInternalIdentifier("DummyIn");

        HackingNode dummyOut = hackingProcess.GetNodeWithInternalIdentifier("DummyOut");

        dummyOut.AddConnectedNode(dummyIn);

        hackingLoaded = true;
    }
コード例 #28
0
    public void SendOutputToConnectedNodes(HackingIdentifier identifier, GameObject originator = null)
    {
        HackingNode node = GetNodeWithInternalIdentifier(identifier);

        node.SendOutputToConnectedNodes(originator);
    }
コード例 #29
0
 public void SetHackingNode(HackingNode node)
 {
     hackNode = node;
     SetUpNodeData();
 }