예제 #1
0
        public void SubmitResult(ChoreographyCue cue)
        {
            //if (double.IsNaN(cue.Score))
            //{
            //    Speech.Say("What the heck was that?");
            //}
            //else if (cue.Score < 0)
            //{
            //    var recognizedAsName = Classifiers[cue.ClassifierKey].MatchingDatasetClasses[cue.GestureClassIndex].className;
            //    Speech.Say($"Looked more like {recognizedAsName}, with {(-1 * cue.Score):f1} points.", SoundOptions.AtSpeed(2.0));
            //}
            //else
            //{
            //    Speech.Say($"Score {cue.Score:f1}, {cue.Delay.TotalSeconds:f1} seconds", SoundOptions.AtSpeed(2.0));
            //}

            if (IsOnPlayerTwo)
            {
                if (double.IsNaN(PlayerOneCue.Score))
                {
                    Speech.Say("First gesture unrecognized.", SoundOptions.AtSpeed(2.0));
                }
                else if (double.IsNaN(cue.Score))
                {
                    Speech.Say("Second gesture unrecognized.", SoundOptions.AtSpeed(2.0));
                }
                else
                {
                    var P1netscore = PlayerOneCue.Score - PlayerOneCue.Delay.TotalSeconds;
                    var P2netscore = cue.Score - cue.Delay.TotalSeconds;
                    if (Math.Abs(P1netscore - P2netscore) < 0.35)
                    {
                        Speech.Say("Tie.");
                    }
                    else if (P1netscore > P2netscore)
                    {
                        Speech.Say("Point to first.", SoundOptions.AtSpeed(2.0));
                    }
                    else
                    {
                        Speech.Say("Point to second.", SoundOptions.AtSpeed(2.0));
                    }
                }

                Generator.SubmitResults(PlayerOneCue, cue);
                IsOnPlayerTwo = false;
                PlayerOneCue  = null;
            }
            else
            {
                PlayerOneCue  = cue;
                IsOnPlayerTwo = true;
                ReceivedSubmission.Set();
            }
        }
예제 #2
0
        protected async void RespondToPromptCue(object o, EventArgs <ChoreographyCue> eargs)
        {
            CurrentCue = eargs.Value;
            Classifier = CueClassifiers[CurrentCue.ClassifierKey];
            //await GimmeCue(eargs.Value.GestureClass);
            SelectedGestureClass = Classifier.MatchingDatasetClasses[CurrentCue.GestureClassIndex];
            if (CurrentCue.CueTime < DateTime.Now)
            {
                Log.Debug(_tag, $"Timing issue - CurrentCue.CueTime is {CurrentCue.CueTime}, now is {DateTime.Now}.");
                CurrentCue.CueTime = DateTime.Now + TimeSpan.FromMilliseconds(250);
            }
            var delay = CurrentCue.CueTime - DateTime.Now;
            await Task.Delay(delay);

            Speech.Say(SelectedGestureClass.className, SoundOptions.AtSpeed(2.0));
            Stopwatch.Restart();
            if (_singleMode)
            {
                MeleeChoreographer.Deactivate();
            }
        }
예제 #3
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            SetContentView(Resource.Layout.SimpleListPage);
            //FindAllViews();

            Dataset    = new DataSet <DKS>();
            Classifier = new Classifier(); // Just in case; it's not actually going to get used in this version.

            var lView  = FindViewById(Resource.Id.list);
            var mPanel = FindViewById(Resource.Id.listpage_backdrop);

            listView  = lView as ListView;
            mainPanel = mPanel as RelativeLayout;

            //listView.ItemClick += ListView_ItemClick;

            //HackingActionsList = new HackingActionsList();
            //HackingActionsList.SetUpBasicNetwork();
            //HackingActionsList.SetUpFirewall();
            //HackingActionsList.RegisterAllActions();

            Map = new HackingMap();
            Map.SetUpDefaults();
            Map.SetupObjectiveChain("Root Access", "Security Server", "Suppress Cameras");
            Map.SetupFirewall();
            //Map.OnTransition += (o, e) => UpdateMapView();
            UpdateMapView();

            Speech.Say("Penetrating access point. Raising hud and gestural interface. Loading icebreakers. Scrambler countermeasures detected and partially neutralized.", SoundOptions.AtSpeed(2.0));

            useVolumeTrigger = true;
            //OnVolumeButtonPressed += (o, e) => PerformSpellSelection();
        }
예제 #4
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            GravProvider = new Vector3Provider(SensorType.Gravity, StopToken);
            GravProvider.Activate(); // Getting this running right away means that we can ask it for a meaningful value when the player presses the button.

            useVolumeTrigger        = true;
            OnVolumeButtonPressed  += LimberUpVolumePressed;
            OnVolumeButtonReleased += LimberUpVolumeReleased;

            Speech.Say("Limber up.");
            Speech.Say("Start at zero, hold down button and mime your rotation, let go at zero.", SoundOptions.AtSpeed(1.25));
        }
예제 #5
0
 protected override Task nextStageActionAsync()
 {
     return(Speech.SayAllOf("Got it.", SoundOptions.AtSpeed(1.75)));
 }
예제 #6
0
 public void SubmitResult(ChoreographyCue cue)
 {
     if (double.IsNaN(cue.Score))
     {
         Speech.Say("What the heck was that?");
     }
     else if (cue.Score < 0) // Encodes "score but for the wrong gesture" in our Cue.Score scheme.
     {
         var recognizedAsName = Classifiers[cue.ClassifierKey].MatchingDatasetClasses[cue.GestureClassIndex].className;
         Speech.Say($"Looked more like {recognizedAsName}, with {(-1 * cue.Score):f1} points.", SoundOptions.AtSpeed(2.0));
     }
     else
     {
         Speech.Say($"Score {cue.Score:f1}, {cue.Delay.TotalSeconds:f1} seconds", SoundOptions.AtSpeed(2.0));
     }
     Generator.SubmitResults(cue, default(ChoreographyCue));
 }
예제 #7
0
        public void SetUpDefaults()
        {
            // Format:
            var AssessICE      = Nodes["AssessICE"] = new HackingMapNode("Assess ICE");
            var FalseTrail     = Nodes["FalseTrail"] = new HackingMapNode("False Trail", "Lay False Trail");
            var PasswordPrompt = Nodes["PasswordPrompt"] = new HackingMapNode("Password", "Password Prompt")
            {
                IsBlocking = true
            };
            var ShellAccess = Nodes["ShellAccess"] = new HackingMapNode("Shell", "Shell Access");
            var Paydata     = Nodes["Paydata"] = new HackingMapNode("Paydata", "Seek Paydata");
            var NetworkScan = Nodes["NetworkScan"] = new HackingMapNode("Netscan", "Network Scan");

            // Assess ICE - investigate and un-hide pieces of ICE before they trip you up.
            AssessICE.IsAbove(StartNode);
            AssessICE.OnEntrySay          = "Analyzing network";
            AssessICE.Data["Detectables"] = new Dictionary <int, string>
            {
                { 3, "PasswordPrompt" },
                { 5, "Firewall" },
                { 8, "ProxyServer" },
                { 12, "Biometrics" },
                { 15, "Voiceprint" },
                { 19, "TwoFactor" },
                { 23, "Further countermeasures" }
            };
            AssessICE.AddAction("Probe", HackGesture.Typing, (action, node) =>
            {
                var detectables = AssessICE.Data["Detectables"] as Dictionary <int, string>; // Lookup from Data[], rather than direct local variable, because this way it can be altered between creation & use.
                node.Counter_Persistent++;
                action.Name = "Probe More";
                if (detectables.TryGetValue(node.Counter_Persistent, out string nodeName)) // Their tally of digging-clicks corresponds to a valid list entry (whether it's present or not).
                {
                    if (Exists(nodeName) && Nodes[nodeName] != null)
                    {
                        Nodes[nodeName].IsHidden = false;
                        Speech.Say($"{Nodes[nodeName].Longname} detected", Interrupt);
                    }
                    else
                    {
                        Speech.Say($"{nodeName} not found.", Interrupt);
                    }
                }
            });

            // False Trail - preventative counter to trace attempts which might happen later.
            FalseTrail.IsBelow(StartNode, PasswordPrompt);
            FalseTrail.AddAction("Add Bounce", HackGesture.Typing, (action, node) =>
            {
                var citynames = new string[] { "London", "New York", "Sydney", "Moscow", "Paris", "Bogota", "Rekyavick", "Berlin", "Nairobi", "Sao Paolo", "Leema", "Perth",
                                               "Singapore", "Hong Kong", "Vancouver", "Toronto", "Istanbul", "Delhi", "Los Angeles", "Miami", "Prague", "Malta", "The Caymans", "Brunei", "Ell five" };
                if (Res.Random < 0.25)
                {
                    Speech.Say($"Routing through {citynames.GetRandom()}", new SoundOptions()
                    {
                        Speed = 2.0, Interrupt = true
                    });
                    node.Counter_Persistent++;
                }
            });

            PasswordPrompt.IsRightOf(StartNode);
            PasswordPrompt.OnEntrySay           = "Running Pineapple-hack 1.1                                 "; // Making it "longer" makes it be said faster [see Enter( )]
            PasswordPrompt.Data["targetClicks"] = MiscUtil.StaticRandom.Next(6, 11);
            PasswordPrompt.AddAction("Crack", HackGesture.Typing, (action, node) =>
            {
                if (!node.IsBlocking)
                {
                    return;
                }
                dataEntryEffect.Play();
                node.Counter_ThisAccess++;
                if (node.Counter_ThisAccess > (int)node.Data["targetClicks"])
                {
                    node.IsBlocking = false;
                    Speech.Say("Cracked it.");
                }
            });

            ShellAccess.IsRightOf(PasswordPrompt);
            Paydata.IsBelow(ShellAccess);
            NetworkScan.IsAbove(ShellAccess);

            Paydata.AddAction("Assess", HackGesture.Typing, (action, node) =>
            {
                Speech.Say("No valuable side data found on this server.");
                Paydata.Actions.Clear();
            });

            NetworkScan.AddAction("Trace Status", HackGesture.Left, async(action, node) =>
            {
                await Speech.SayAllOf("Checking...", new SoundOptions()
                {
                    Speed = 2.0, Interrupt = true
                });
                await Task.Delay(750);
                Speech.Say("No active trace in progress.", SoundOptions.AtSpeed(1.5));
            });
            NetworkScan.AddAction("Delete Logs", HackGesture.Typing, (action, node) =>
            {
                ExecutableActionsCounter--; // Doesn't count toward the actions needing deletion.
                node.Counter_Persistent++;
                if (0.25 * node.Counter_Persistent * node.Counter_Persistent >= ExecutableActionsCounter)
                {
                    Speech.Say("Logs cleared. Passive trace; should; be impossible.", new SoundOptions()
                    {
                        Speed = 1.8, Interrupt = true
                    });
                }
            });
            NetworkScan.AddAction("Detect Sysop", HackGesture.Right, async(action, node) =>
            {
                await Speech.SayAllOf("Scanning...", new SoundOptions()
                {
                    Speed = 2.0, Interrupt = true
                });
                await Task.Delay(1000);
                Speech.Say("Sysop does not appear to be logged on.", SoundOptions.AtSpeed(1.5));
            });
        }