public void RunWhenplayerDrinksSCP207(UsedMedicalItemEventArgs Used207)
        {
            if (Used207.Player != Hub || Used207.Item != ItemType.SCP207)
            {
                return;
            }

            if (Hub.IsGodModeEnabled)
            {
                Counter = 0;
                return;
            }

            if (Counter < CreativeToolbox.ConfigRef.Config.Scp207DrinkLimit)
            {
                string MessageToReplace = RogerFKTokenReplace.ReplaceAfterToken(CreativeToolbox.ConfigRef.Config.DrinkingScp207Message, '%', new Tuple <string, object>[] { new Tuple <string, object>("counter", Counter) });
                Used207.Player.ReferenceHub.hints.Show(new TextHint($"\n\n\n\n\n\n\n\n\n{MessageToReplace}", new HintParameter[]
                {
                    new StringHintParameter("")
                }, HintEffectPresets.FadeInAndOut(0.25f, 1f, 0f)));
            }

            if (Counter == CreativeToolbox.ConfigRef.Config.Scp207PryGateLimit)
            {
                string MessageToReplace = RogerFKTokenReplace.ReplaceAfterToken(CreativeToolbox.ConfigRef.Config.PryGatesWithScp207Message, '%', new Tuple <string, object>[] { new Tuple <string, object>("counter", Counter) });
                if (!CreativeToolboxEventHandler.PlayersThatCanPryGates.Contains(Hub))
                {
                    CreativeToolboxEventHandler.PlayersThatCanPryGates.Add(Hub);
                    Used207.Player.ReferenceHub.hints.Show(new TextHint($"\n\n\n\n\n\n\n\n\n{MessageToReplace}", new HintParameter[]
                    {
                        new StringHintParameter("")
                    }, HintEffectPresets.FadeInAndOut(0.25f, 1f, 0f)));
                }
            }

            if (Counter >= CreativeToolbox.ConfigRef.Config.Scp207DrinkLimit)
            {
                string MessageToReplace = RogerFKTokenReplace.ReplaceAfterToken(CreativeToolbox.ConfigRef.Config.ExplodeAfterScp207Message, '%', new Tuple <string, object>[] { new Tuple <string, object>("counter", Counter) });
                if (CreativeToolboxEventHandler.PlayersThatCanPryGates.Contains(Hub))
                {
                    CreativeToolboxEventHandler.PlayersThatCanPryGates.Remove(Hub);
                }
                Hub.Health           = 0;
                Hub.AdrenalineHealth = 0;
                Hub.Kill();
                CreativeToolboxEventHandler.SpawnGrenadeOnPlayer(Hub, false);
                Counter = 0;
                Used207.Player.ReferenceHub.hints.Show(new TextHint($"\n\n\n\n\n\n\n\n\n{MessageToReplace}", new HintParameter[]
                {
                    new StringHintParameter("")
                }, HintEffectPresets.FadeInAndOut(0.25f, 1f, 0f)));
            }
        }
Пример #2
0
        public void RunWhenplayerDrinksSCP207(UsedMedicalItemEventArgs Used207)
        {
            if (Used207.Player != Hub || Used207.Item != ItemType.SCP207)
            {
                return;
            }

            if (Hub.IsGodModeEnabled)
            {
                Counter = 0;
                return;
            }

            if (Counter < CreativeToolbox.ConfigRef.Config.Scp207DrinkLimit)
            {
                Used207.Player.ReferenceHub.hints.Show(new TextHint($"\n\n\n\n\n\n\n\n\nnumber of drinks consumed: {Counter}", new HintParameter[]
                {
                    new StringHintParameter("")
                }, HintEffectPresets.FadeInAndOut(0.25f, 1f, 0f)));
            }

            if (Counter == CreativeToolbox.ConfigRef.Config.Scp207PryGateLimit)
            {
                if (!CreativeToolboxEventHandler.PlayersThatCanPryGates.Contains(Hub.ReferenceHub))
                {
                    CreativeToolboxEventHandler.PlayersThatCanPryGates.Add(Hub.ReferenceHub);
                    Used207.Player.ReferenceHub.hints.Show(new TextHint($"\n\n\n\n\n\n\n\n\nyou can now pry gates open", new HintParameter[]
                    {
                        new StringHintParameter("")
                    }, HintEffectPresets.FadeInAndOut(0.25f, 1f, 0f)));
                }
            }

            if (Counter >= CreativeToolbox.ConfigRef.Config.Scp207DrinkLimit)
            {
                CreativeToolboxEventHandler.SpawnGrenadeOnPlayer(Hub, false);
                Counter = 0;
                Used207.Player.ReferenceHub.hints.Show(new TextHint($"\n\n\n\n\n\n\n\n\nyou drank too much and your body could not handle it", new HintParameter[]
                {
                    new StringHintParameter("")
                }, HintEffectPresets.FadeInAndOut(0.25f, 1f, 0f)));
            }
        }
        public void RunWhenPlayerDrinksScp207(UsedMedicalItemEventArgs ev)
        {
            if (ev.Player != _ply || ev.Item != ItemType.SCP207)
            {
                return;
            }

            if (_ply.IsGodModeEnabled)
            {
                counter = 0;
                return;
            }

            if (counter < Instance.Config.Scp207DrinkLimit)
            {
                string messageToReplace =
                    Instance.Config.DrinkingScp207Message.ReplaceAfterToken('%',
                                                                            new[] { new Tuple <string, object>("counter", counter) });
                ev.Player.ReferenceHub.hints.Show(new TextHint($"\n\n\n\n\n\n\n\n\n{messageToReplace}",
                                                               new HintParameter[]
                {
                    new StringHintParameter("")
                }, HintEffectPresets.FadeInAndOut(0.25f, 1f, 0f)));
            }

            if (counter == Instance.Config.Scp207PryGateLimit)
            {
                string messageToReplace =
                    Instance.Config.PryGatesWithScp207Message.ReplaceAfterToken('%',
                                                                                new[] { new Tuple <string, object>("counter", counter) });
                if (!CreativeToolboxEventHandler.PlayersThatCanPryGates.Contains(_ply))
                {
                    CreativeToolboxEventHandler.PlayersThatCanPryGates.Add(_ply);
                    ev.Player.ReferenceHub.hints.Show(new TextHint($"\n\n\n\n\n\n\n\n\n{messageToReplace}",
                                                                   new HintParameter[]
                    {
                        new StringHintParameter("")
                    }, HintEffectPresets.FadeInAndOut(0.25f, 1f, 0f)));
                }
            }

            if (counter >= Instance.Config.Scp207DrinkLimit)
            {
                string messageToReplace =
                    Instance.Config.ExplodeAfterScp207Message.ReplaceAfterToken('%',
                                                                                new[] { new Tuple <string, object>("counter", counter) });
                if (CreativeToolboxEventHandler.PlayersThatCanPryGates.Contains(_ply))
                {
                    CreativeToolboxEventHandler.PlayersThatCanPryGates.Remove(_ply);
                }
                _ply.Health           = 0;
                _ply.AdrenalineHealth = 0;
                _ply.Kill();
                CreativeToolboxEventHandler.SpawnGrenadeOnPlayer(_ply, false);
                counter = 0;
                ev.Player.ReferenceHub.hints.Show(new TextHint($"\n\n\n\n\n\n\n\n\n{messageToReplace}",
                                                               new HintParameter[]
                {
                    new StringHintParameter("")
                }, HintEffectPresets.FadeInAndOut(0.25f, 1f, 0f)));
            }
        }