Exemplo n.º 1
0
        public void SetupProxy(string blockedStageName)
        {
            var ProxyServer = Nodes["ProxyServer"] = new HackingMapNode("Proxy", "Proxy Server")
            {
                IsBlocking = true, IsHidden = true
            };
            var Spoof   = Nodes["Spoof"] = new HackingICEBreakerNode("Spoof", "Spoof Proxy");
            var Disrupt = Nodes["Disrupt"] = new HackingICEBreakerNode("Disrupt", "Disrupt Proxy Server");

            //ProxyServer.IsRightOf(PasswordPrompt);
            Spoof.IsAbove(ProxyServer);
            Disrupt.IsBelow(ProxyServer);
        }
Exemplo n.º 2
0
        public void SetupFirewall()
        {
            var PasswordPrompt = Nodes["PasswordPrompt"];
            var Firewall       = Nodes["Firewall"] = new HackingMapNode("Firewall")
            {
                IsBlocking = true, IsHidden = true
            };
            var Sleaze = new HackingICEBreakerNode("Sleaze", "Sleaze v2.11");

            Nodes["Sleaze"] = Sleaze;
            //var Banzai = new HackingICEBreakerNode("Banzai", "Banzai PRO");
            //Nodes["Banzai"] = Banzai;

            Firewall.IsRightOf(StartNode);
            PasswordPrompt.IsRightOf(Firewall);
            Sleaze.IsAbove(Firewall);
            //Banzai.IsBelow(Firewall);

            Sleaze.Unlocks = Firewall;
            //Banzai.Unlocks = Firewall;

            // Password prompt should fail if firewall is present and still blocking - exposing it if hidden (with an ominous warning if so).
            PasswordPrompt.ValidateGesture = (g) =>
            {
                if (g != HackGesture.Typing)
                {
                    return(true);
                }
                if (PasswordPrompt.Counter_ThisAccess < (int)PasswordPrompt.Data["targetClicks"])
                {
                    return(true);
                }
                else
                {
                    return(!Firewall.IsBlocking);
                }
            };
            PasswordPrompt.OnValidationFailed = (g) =>
            {
                dataEntryEffect.Play();
                Firewall.IsHidden = false;
                Speech.Say("Crack blocked by firewall.  Alert level raised slightly.", Interrupt);
                HackingActivity.Current.TransitionNode(HackingMapNode.Dir.Left).Wait();
            };

            // Sleaze is a pretty straightforward "guess how much effort to put into improving my odds vs. into trying the shot" icebreaker.
            Sleaze.Data["ChanceOfSucc"] = 0.0;
            Sleaze.AddAction("Generate", HackGesture.Typing, (action, node) =>
            {
                dataEntryEffect.Play();
                if (node.Counter_ThisAccess == 0)
                {
                    Speech.Say("Falsifying certificate", Interrupt);
                    action.Name = "Tweak";
                }
                node.Counter_ThisAccess++;
                var chanceOfSucc               = 1.0 - Math.Exp(-0.3 * node.Counter_ThisAccess);
                node.Data["ChanceOfSucc"]      = chanceOfSucc;
                node.Actions.ElementAt(1).Name = $"Submit (~{(chanceOfSucc * 100):f0}%)";
            });
            Sleaze.AddAction("Submit", HackGesture.Right, (action, node) =>
            {
                var chanceOfSucc = (double)node.Data["ChanceOfSucc"];
                if (Res.Random < chanceOfSucc)
                {
                    new Effect("shatter", Resource.Raw._349905_slowGlassShatter).Play();
                    (node as HackingICEBreakerNode).DoUnlocking();
                }
                else
                {
                    new Effect("blatt", Resource.Raw.kblaa_magic).Play();
                    node.Counter_ThisAccess   = 0;
                    node.Data["ChanceOfSucc"] = 0.0;
                    action.Name = "Submit (0%)";
                    node.Actions.ElementAt(0).Name = "(Re)Generate";
                    Speech.Say("Certificate not accepted.", Interrupt);
                }
            });

            // Banzai will be a more complex "follow instructions promptly" icebreaker, but I'm moving on to other things for awhile.
        }