예제 #1
0
 //Callback handler When changing the type of vibrator.
 public void OnVibratorTypeChanged(int index)
 {
     if (vibratorDropdown != null)
     {
         if (vibratorControl == null)
         {
             vibratorControl = FindObjectOfType <VibratorController>();
         }
         if (vibratorControl != null)
         {
             vibratorControl.vibratorType = (VibratorController.VibratorType)Enum.ToObject(typeof(VibratorController.VibratorType), index);
         }
     }
 }
예제 #2
0
        public async Task StartListening(int playerNumber, VibratorController vibratorController)
        {
            while (Attached && Mem.theProc != null && !Mem.theProc.HasExited)
            {
                var stats = ReadEventForPlayerNumber(playerNumber);

                if (readCounts < 10)
                {
                    readCounts++;
                    vibratorController.IgnoreCommands = true;
                }
                else if (vibratorController.IgnoreCommands)
                {
                    vibratorController.IgnoreCommands = false;
                }

                await Task.Delay(PollingRate);
            }
        }
예제 #3
0
        public override void AttachListenersForPlayerNumber(VibratorController vibratorController, int playerNumber)
        {
            var player = GetPlayerByNumber(playerNumber);

            player.HPUpdated += (s, val) =>
            {
                vibratorController.PublishLogs($"{nameof(player.HPUpdated)}: {val}");
            };

            player.HPHitReceived += (s, val) =>
            {
                vibratorController.SendVibration(new SpeedTime(val * 3, 2000));
                vibratorController.PublishLogs($"{nameof(player.HPHitReceived)}: {val}");
            };

            player.RoundEndedLoss += (s, val) =>
            {
                vibratorController.SendVibration(new SpeedTime(1, 10000, true));
                vibratorController.PublishLogs($"{nameof(player.RoundEndedLoss)}: {val}");
            };
        }
        public override void AttachListenersForPlayerNumber(VibratorController vibratorController, int playerNumber)
        {
            var player = GetPlayerByNumber(playerNumber);

            player.HPUpdated += (s, val) =>
            {
                vibratorController.PublishLogs($"{nameof(player.HPUpdated)}: {val}");
            };

            player.HPHitReceived += (s, val) =>
            {
                vibratorController.SendVibration(new SpeedTime(val * 2, 2000));
                vibratorController.PublishLogs($"{nameof(player.HPHitReceived)}: {val}");
            };

            player.LPUpdated += (s, val) =>
            {
                vibratorController.PublishLogs($"{nameof(player.LPUpdated)}: {val}");
            };

            player.LPHitReceived += (s, val) =>
            {
                vibratorController.SendVibration(new SpeedTime(val * 2, 3000));
                vibratorController.PublishLogs($"{nameof(player.LPHitReceived)}: {val}");
            };

            player.HumiliationHPUpdated += (s, val) =>
            {
                vibratorController.PublishLogs($"{nameof(player.HumiliationHPUpdated)}: {val}");
            };

            player.HumiliationHPHitReceived += (s, val) =>
            {
                vibratorController.SendVibration(new SpeedTime(val, 3000));
                vibratorController.PublishLogs($"{nameof(player.HumiliationHPHitReceived)}: {val}");
            };

            player.OrgasmStarted += (s, val) =>
            {
                vibratorController.SendVibration(new SpeedTime(1, 5000, true));
                vibratorController.PublishLogs($"{nameof(player.OrgasmStarted)}: {val}");
            };

            player.OrgasmEnded += (s, val) =>
            {
                vibratorController.PublishLogs($"{nameof(player.OrgasmEnded)}: {val}");
            };

            player.SubmissionStarted += (s, val) =>
            {
                vibratorController.SendVibration(new SpeedTime(0.75, 60000, true));
                vibratorController.PublishLogs($"{nameof(player.SubmissionStarted)}: {val}");
            };

            player.SubmissionEnded += (s, val) =>
            {
                vibratorController.SendVibration(new SpeedTime(0, 1000, true));
                vibratorController.PublishLogs($"{nameof(player.SubmissionEnded)}: {val}");
            };

            player.RoundEndedLoss += (s, val) =>
            {
                vibratorController.SendVibration(new SpeedTime(1, 10000));
                vibratorController.PublishLogs($"{nameof(player.RoundEndedLoss)}: {val}");
            };
        }
예제 #5
0
        public override void AttachListenersForPlayerNumber(VibratorController vibratorController, int playerNumber)
        {
            var player = GetPlayerByNumber(playerNumber);

            player.HPUpdated += (s, val) =>
            {
                vibratorController.PublishLogs($"{nameof(player.HPUpdated)}: {val}");
            };

            player.HPHitReceived += (s, val) =>
            {
                vibratorController.SendVibration(new SpeedTime(val * 4, 5000));
                vibratorController.PublishLogs($"{nameof(player.HPHitReceived)}: {val}");
            };

            player.LPUpdated += (s, val) =>
            {
                vibratorController.SendVibration(new SpeedTime(val, 5000));
                vibratorController.PublishLogs($"{nameof(player.LPUpdated)}: {val}");
            };

            player.LPHitReceived += (s, val) =>
            {
                vibratorController.PublishLogs($"{nameof(player.LPHitReceived)}: {val}");
            };

            player.HumiliationHPUpdated += (s, val) =>
            {
                vibratorController.PublishLogs($"{nameof(player.HumiliationHPUpdated)}: {val}");
            };

            player.HumiliationHPHitReceived += (s, val) =>
            {
                vibratorController.SendVibration(new SpeedTime(val * 4, 5000));
                vibratorController.PublishLogs($"{nameof(player.HumiliationHPHitReceived)}: {val}");
            };

            player.OrgasmStarted += (s, val) =>
            {
                vibratorController.SendVibration(new SpeedTime(1, 60000));
                vibratorController.PublishLogs($"{nameof(player.OrgasmStarted)}: {val}");
            };

            player.OrgasmEnded += (s, val) =>
            {
                vibratorController.PublishLogs($"{nameof(player.OrgasmEnded)}: {val}");
            };

            player.SubmissionStarted += (s, val) =>
            {
                vibratorController.SendVibration(new SpeedTime(0.75, 60000));
                vibratorController.PublishLogs($"{nameof(player.SubmissionStarted)}: {val}");
            };

            player.SubmissionEnded += (s, val) =>
            {
                vibratorController.SendVibration(new SpeedTime(0, 1));
                vibratorController.PublishLogs($"{nameof(player.SubmissionEnded)}: {val}");
            };

            player.RoundEndedLoss += (s, val) =>
            {
                vibratorController.SendVibration(new SpeedTime(1, 4000));
                vibratorController.PublishLogs($"{nameof(player.RoundEndedLoss)}: {val}");
            };

            player.HumOrgasmStarted += (s, val) =>
            {
                vibratorController.SendVibration(new SpeedTime(1, 600000));
                vibratorController.PublishLogs($"{nameof(player.OrgasmStarted)}: {val}");
            };

            player.HumOrgasmEnded += (s, val) =>
            {
                vibratorController.PublishLogs($"{nameof(player.OrgasmEnded)}: {val}");
            };

            //This means the opponent got a point
            player.LifeRefilled += (s, val) =>
            {
                vibratorController.SendVibration(new SpeedTime(0.75, 3000));
                vibratorController.PublishLogs($"{nameof(player.LifeRefilled)}: {val}");
            };
        }
예제 #6
0
 public abstract void AttachListenersForPlayerNumber(VibratorController vibratorController, int playerNumber);