Пример #1
0
 public void onPlayerDied(DiedEventArgs ev)
 {
     if (scp372.Contains(ev.Target.UserId))
     {
         Remove372(ev.Target);
         ev.Target.IsInvisible = false;
     }
 }
Пример #2
0
 public void OnDied(DiedEventArgs ev)
 {
     if (GrenadeRun.Instance.GrenadeRound && ev.Target != null && ev.HitInformations.GetDamageType() == DamageTypes.Grenade)
     {
         GrenadeRun.Instance.Config.Translations.TryGetValue("PlayerDied", out string msg);
         Map.Broadcast((ushort)GrenadeRun.Instance.Config.DeathMsgTime, msg.Replace("{player}", ev.Target.Nickname));
     }
 }
Пример #3
0
 private void OnDied(DiedEventArgs ev)
 {
     if (Config.RespawnDying && ev.Target.IsInfected())
     {
         ev.Target.Infect();
     }
     ev.Target.Cure();
 }
Пример #4
0
        private static void OnKill(DiedEventArgs ev)
        {
            if (ev.Killer == null)
            {
                return;
            }

            Timing.RunCoroutine(Infect(ev));
        }
Пример #5
0
 private void OnDied(DiedEventArgs ev)
 {
     foreach (var charge in PlacedCharges.ToList())
     {
         if (charge.Value == ev.Target)
         {
             C4Handler(charge.Key, MethodOnDeath);
         }
     }
 }
Пример #6
0
 public void OnDie(DiedEventArgs e)
 {
     if (kille.ContainsKey(e.Killer))
     {
         kille[e.Killer]++;
     }
     else
     {
         kille.Add(e.Killer, 1);
     }
 }
Пример #7
0
 public void OnPlayerDied(DiedEventArgs ev)
 {
     if (ev.Target.Role == RoleType.Scp049 || ev.Target.Role == RoleType.Scp0492)
     {
         if (SCP008Check())
         {
             Log.Debug($"SCP008Check() passed. Announcing recontainment...", SCP008X.Instance.Config.DebugMode);
             Cassie.Message($"SCP 0 0 8 containedsuccessfully . noscpsleft", false, true);
         }
     }
 }
Пример #8
0
        private void CountAndRespawnKills(DiedEventArgs ev)
        {
            ev.Target.ClearInventory();
            if (ev.Killer.Role != ev.Target.Role)
            {
                AddToKda(ev.Killer.Id);
                UpdateKdaOfUser(ev.Killer);
                AddToKda(ev.Target.Id, false);
                UpdateKdaOfUser(ev.Target);
                if (ev.Killer.Role == RoleType.ChaosInsurgency)
                {
                    _chaosKills++;
                }
                else
                {
                    _ntfKills++;
                }
            }

            foreach (var player in Player.List)
            {
                if (player.Role == RoleType.Spectator)
                {
                    Timing.RunCoroutine(SpawnPlayer(player));
                }
            }

            if (_chaosKills >= _maxScore || _ntfKills >= _maxScore)
            {
                if (_chaosKills > _ntfKills)
                {
                    Common.Broadcast(30, "Chaos Wins!", true);
                    Common.LockRound(false);
                    Common.ForceEndRound(RoleType.ChaosInsurgency);
                }
                else if (_chaosKills < _ntfKills)
                {
                    Common.Broadcast(30, "NTF Wins!", true);
                    Common.LockRound(false);
                    Common.ForceEndRound(RoleType.NtfCommander);
                }
                else
                {
                    Common.Broadcast(30, "Tie?", true);
                    Common.LockRound(false);
                    Common.ForceEndRound(RoleType.None);
                }
            }
            else
            {
                Common.Broadcast(60, FormatScore(), true);
                Timing.RunCoroutine(SpawnPlayer(ev.Target));
            }
        }
Пример #9
0
        private static void OnDied(DiedEventArgs ev)
        {
            if (BurningHandler.Get(ev.Target) is BurningHandler burningHandler)
            {
                burningHandler.BurnTime = 0f;
            }

            if (Scp457.Get(ev.Target) is Scp457 scp457)
            {
                scp457.Destroy();
            }
        }
Пример #10
0
        public static void OnPlayerDied(DiedEventArgs ev)
        {
            if (ev.Killer != null)
            {
                YouTubeTutorialPlugin.PlayerData.GetOrAdd(ev.Killer.UserId, () => new PlayerData()).Kills++;
            }

            if (ev.Target != null)
            {
                YouTubeTutorialPlugin.PlayerData.GetOrAdd(ev.Target.UserId, () => new PlayerData()).Deaths++;
            }
        }
Пример #11
0
        private void OnDied(DiedEventArgs ev)
        {
            if (ev.Killer == _player)
            {
                Disguise(ev.Target.Role);
            }

            if (ev.Target == _player)
            {
                Destroy(this);
            }
        }
Пример #12
0
        public void OnPlayerDeath(DiedEventArgs ev)
        {
            if (ev.Target.Role != RoleType.Spectator)
            {
                PlayerDamage data = new PlayerDamage
                {
                    eventName = "PlayerDeath",
                    victim    = PlyToUser(ev.Target),
                    attacker  = PlyToUser(ev.Killer),
                    damage    = (int)ev.HitInformations.Amount,
                    weapon    = ev.HitInformations.GetDamageName().ToString()
                };

                DamageTypes.DamageType type = ev.HitInformations.GetDamageType();
                if (type == DamageTypes.Tesla)
                {
                    data.eventName += "Tesla";
                }
                else if (type == DamageTypes.Decont)
                {
                    data.eventName += "Decont";
                }
                else if (type == DamageTypes.Falldown)
                {
                    data.eventName += "Fall";
                }
                else if (type == DamageTypes.Flying)
                {
                    data.eventName += "Flying";
                }
                else if (type == DamageTypes.Lure)
                {
                    data.eventName += "Lure";
                }
                else if (type == DamageTypes.Nuke)
                {
                    data.eventName += "Nuke";
                }
                else if (type == DamageTypes.Pocket)
                {
                    data.eventName += "Pocket";
                }
                else if (type == DamageTypes.Recontainment)
                {
                    data.eventName += "Recont";
                }

                tcp.SendData(data);
            }
        }
Пример #13
0
        public void OnPlayerDie(DiedEventArgs ev)
        {
            if (spies.ContainsKey(ev.Killer) && ev.Killer != ev.Target)
            {
                ev.Target.Broadcast(7, "<i>Fuiste asesinado por un <color=red>espia de la chaos insurgency</color></i>");
            }

            if (spies.ContainsKey(ev.Target))
            {
                spies.Remove(ev.Target);
            }

            CheckSpies(ev.Target);
        }
Пример #14
0
 public void OnDied(DiedEventArgs ev)
 {
     if (beenShot == null || bleeding == null)
     {
         return;
     }
     if (beenShot.ContainsKey(ev.Target.Id))
     {
         beenShot.Remove(ev.Target.Id);
     }
     if (bleeding.ContainsKey(ev.Target.Id))
     {
         bleeding.Remove(ev.Target.Id);
     }
 }
Пример #15
0
        public void OnDied(DiedEventArgs ev)
        {
            if (TrackingAndMethods.QueuedHints.ContainsKey(ev.Target.Id))
            {
                TrackingAndMethods.QueuedHints[ev.Target.Id].RemoveAll((BetterHint hint) => hint.DisableOnDeath);
            }

            if (ev.Target.ReferenceHub.TryGetComponent(out BetterHintComponent comp))
            {
                if (comp.CurrentlyShownHint != null && comp.CurrentlyShownHint.DisableOnDeath)
                {
                    comp.ShowNextHint();
                }
            }
        }
Пример #16
0
 public void OnPlayerDeath(DiedEventArgs ev)
 {
     if (ev.Killer.Team == Team.SCP)
     {
         if (ev.Killer.Role == RoleType.Scp93989 || ev.Killer.Role == RoleType.Scp93953)
         {
             if (HealthOnKill.instance.Config.isHealthRegenRandom)
             {
                 int rand   = r.Next(HealthOnKill.instance.Config.scp939HealthOnKillRandomLowerBounds, HealthOnKill.instance.Config.scp939HealthOnKillRandomUpperBounds);
                 int health = (int)ev.Killer.Health + rand;
                 ev.Killer.Health = health < ev.Killer.MaxHealth ? health : ev.Killer.MaxHealth;
             }
             else
             {
                 int health = (int)ev.Killer.Health + HealthOnKill.instance.Config.scp939HealthOnKillSet;
                 ev.Killer.Health = health < ev.Killer.MaxHealth ? health : ev.Killer.MaxHealth;
             }
         }
         else if (ev.Killer.Role == RoleType.Scp173)
         {
             if (HealthOnKill.instance.Config.isHealthRegenRandom)
             {
                 int rand   = r.Next(HealthOnKill.instance.Config.scp173HealthOnKillRandomLowerBounds, HealthOnKill.instance.Config.scp173HealthOnKillRandomUpperBounds);
                 int health = (int)ev.Killer.Health + rand;
                 ev.Killer.Health = health < ev.Killer.MaxHealth ? health : ev.Killer.MaxHealth;
             }
             else
             {
                 int health = (int)ev.Killer.Health + HealthOnKill.instance.Config.scp173HealthOnKillSet;
                 ev.Killer.Health = health < ev.Killer.MaxHealth ? health : ev.Killer.MaxHealth;
             }
         }
         else if (ev.Killer.Role == RoleType.Scp0492)
         {
             if (HealthOnKill.instance.Config.isHealthRegenRandom)
             {
                 int rand   = r.Next(HealthOnKill.instance.Config.scp0492HealthOnKillRandomLowerBounds, HealthOnKill.instance.Config.scp0492HealthOnKillRandomUpperBounds);
                 int health = (int)ev.Killer.Health + rand;
                 ev.Killer.Health = health < ev.Killer.MaxHealth ? health : ev.Killer.MaxHealth;
             }
             else
             {
                 int health = (int)ev.Killer.Health + HealthOnKill.instance.Config.scp0492HealthOnKillSet;
                 ev.Killer.Health = health < ev.Killer.MaxHealth ? health : ev.Killer.MaxHealth;
             }
         }
     }
 }
Пример #17
0
        private static void Postfix(PlayerStats __instance, ref PlayerStats.HitInfo info, GameObject go)
        {
            API.Features.Player attacker = API.Features.Player.Get(__instance.gameObject);
            API.Features.Player target   = API.Features.Player.Get(go);

            if ((target != null && (target.Role != RoleType.Spectator || target.IsGodModeEnabled || target.IsHost)) || attacker == null)
            {
                return;
            }

            var ev = new DiedEventArgs(API.Features.Player.Get(__instance.gameObject), target, info);

            Player.OnDied(ev);

            info = ev.HitInformations;
        }
Пример #18
0
        public void OnDied(DiedEventArgs ev)
        {
            if (API.IsSerpent(ev.Target))
            {
                Extensions.DestroySH(ev.Target);
                return;
            }

            if (ev.Target.Role == RoleType.Scp106 && !config.SerpentsHandModifiers.FriendlyFire)
            {
                foreach (Player player in Player.List.Where(x => x.CurrentRoom.Type == RoomType.Pocket))
                {
                    player.Hurt(new CustomReasonDamageHandler("WORLD", 50000f));
                }
            }
        }
        private static void PlayerEvents_Died(DiedEventArgs ev)
        {
            var killer = ev.Killer;
            var player = ev.Target;

            // Not SCP and Killed by SCP or suicide.
            if (player.Team != Team.SCP &&
                (killer.Team == Team.SCP ||
                 killer.Id == player.Id))
            {
                _playerDeaths++;
                _messageTimer = 0;
                Map.ClearBroadcasts();
                Map.Broadcast(Config.MessageTime, string.Format(Config.DisplayMessageFormat, LivesLeft));
            }
        }
Пример #20
0
 internal void OnPlayerDeath(DiedEventArgs ev)
 {
     if (ev.Target.UserId != string.Empty && ev.Killer.UserId != string.Empty && ev.Killer != ev.Target)
     {
         foreach (Player player in killFeedPlayers)
         {
             string damagetype = VerifyDamageType(ev.HitInformations.GetDamageType());
             string msg        = KillFeed.instance.Config.KillMessage
                                 .Replace("%killername", $"<color=#{GetColor(ev.Killer.Role)}>{ev.Killer.Nickname}</color>")
                                 .Replace("%killerid", ev.Killer.Id.ToString())
                                 .Replace("%victimname", $"<color=#{GetColor(ev.Target.Role)}>{ev.Target.Nickname}</color>")
                                 .Replace("%victimid", ev.Target.Id.ToString())
                                 .Replace("%weapon", damagetype != string.Empty ? damagetype : ev.HitInformations.GetDamageName());
             player.SendConsoleMessage(msg, KillFeed.instance.Config.KillColor);
         }
     }
 }
Пример #21
0
        internal void Died(DiedEventArgs ev)
        {
            if (Plugin.Instance.Config.Died == "")
            {
                return;
            }
            string message = Plugin.Instance.Config.Died.Replace("%player%", ev.Target.ToString());

            message = message.Replace("%attacker%", ev.Killer.ToString());


            if (Plugin.Instance.Config.debug_to_console)
            {
                Log.Debug(message: "[ " + Plugin.Instance.Config.player_name + "] " + message);
            }
            Plugin.sendWebHook(Plugin.Instance.Config.player_url, message, Plugin.Instance.Config.player_name);
        }
Пример #22
0
        public void OnDied(DiedEventArgs ev)
        {
            if (scps.ContainsKey(ev.Target.Id))
            {
                scps.Remove(ev.Target.Id);
            }
            string name = ev.Target.DisplayNickname;

            if (!Plugin.Instance.Config.CanRepeat)
            {
                usedNames.Remove(name);
                if (!usedNames.Contains(name)) // In case the names were used more than once
                {
                    names.Add(ev.Target.DisplayNickname);
                }
            }
            ev.Target.DisplayNickname = null;
        }
Пример #23
0
        internal void OnPlayerDeath(DiedEventArgs ev)
        {
            if (ev.Handler.Type == Exiled.API.Enums.DamageType.PocketDimension)
            {
                Player scp106 = Player.List.FirstOrDefault(x => x.Role == RoleType.Scp106);
                if (scp106 != null)
                {
                    IncrementScpKill(scp106);
                }
            }

            if (ev.Killer.Id == ev.Target.Id)
            {
                return;
            }

            Player scp035 = null;

            if (StatsDisplay.isScp035)
            {
                scp035 = TryGet035().FirstOrDefault();
            }

            if (ev.Killer.Role.Team == Team.SCP || ev.Killer.Id == scp035?.Id)
            {
                IncrementScpKill(ev.Killer);
            }
            else if (ev.Target.Role.Team == Team.SCP || ev.Target.Id == scp035?.Id)
            {
                if (!humanKills.ContainsKey(ev.Killer))
                {
                    humanKills.Add(ev.Killer, new KillData()
                    {
                        kills    = 1,
                        lastRole = ev.Killer.Role
                    });
                }
                else
                {
                    humanKills[ev.Killer].kills++;
                    humanKills[ev.Killer].lastRole = ev.Killer.Role;
                }
            }
        }
Пример #24
0
        private void OnKill(DiedEventArgs ev)
        {
            Player dboy = null;

            foreach (Player player in Player.List)
            {
                if (player == ev.Target || player == ev.Killer)
                {
                    continue;
                }
                if (player.Role == RoleType.ClassD)
                {
                    if (dboy == null)
                    {
                        //Found 1 dboy
                        dboy = player;
                    }
                    else
                    {
                        //Found 2, skipping rest of OnKill event
                        return;
                    }
                }
            }
            //Only 0/1 dboy exists
            if (dboy != null)
            {
                dboy.Broadcast(3, Constant.PEANUT_CHAMBER_DBOY_WIN);
                foreach (Player player in Player.List)
                {
                    if (player.Role == RoleType.Spectator || player == ev.Target)
                    {
                        Timing.RunCoroutine(SetPeanutCoroutine(player));
                        player.Broadcast(3, Constant.PEANUT_CHAMBER_DBOY_ELLAMINATE);
                    }
                }
            }
            else
            {
                Common.Broadcast(3, Constant.PEANUT_CHAMBER_END);
                Common.LockRound(false);
            }
        }
Пример #25
0
        internal void OnDied(DiedEventArgs ev)
        {
            if (!Plugin.GhostSettings.ContainsKey(ev.Target.UserId) ||
                Plugin.GhostSettings[ev.Target.UserId].Specmode != GhostSettings.Specmodes.Ghost)
            {
                if (!string.IsNullOrEmpty(Plugin.Instance.Config.SpecMessage))
                {
                    ev.Target.Broadcast(6, Plugin.Instance.Config.SpecMessage);
                }
                return;
            }

            if (!Plugin.GhostList.Contains(ev.Target))
            {
                Plugin.Log.Debug($"{ev.Target.Nickname} added to list of ghost spectators.");
                Plugin.GhostList.Add(ev.Target);
            }
            Timing.RunCoroutine(SpawnGhost(ev.Target, 0.2f));
        }
Пример #26
0
        public void OnDied(DiedEventArgs ev)
        {
            try
            {
                Log.Debug(ev.Killer.AdvancedTeam(), plugin.Config.Debug);

                ev.Target.SetAdvancedTeam(Team.RIP.GetNormalAdvancedTeam());

                Methods.CheckRoundEnd();

                if (assemblyAdvancedSubclass)
                {
                    if (Methods.HasAdvancedSubclass(ev.Killer))
                    {
                        return;
                    }
                }

                if (ev.Target != ev.Killer)
                {
                    if (ev.Killer.AdvancedTeam().IsTeamFriendly(ev.Target.AdvancedTeam()))
                    {
                        ev.Target.Broadcast(5, Instance.Translation.TeamKillBroadcast);
                    }
                    else
                    {
                        ev.Target.Broadcast(5, Instance.Translation.KilledByNonfriendlyPlayer);
                    }
                }
            }
            catch (Exception)
            {
                if (ev.Target != null)
                {
                    ev.Target.SetAdvancedTeam(Team.RIP.GetNormalAdvancedTeam());
                }

                Methods.CheckRoundEnd();

                Log.Debug("Caught On died error. this probably happened because someone left", this.plugin.Config.Debug);
            }
        }
Пример #27
0
 public void onPlayerDeath(DiedEventArgs ev)
 {
     try
     {
         Log.Info($"{ev.Target}");
         Log.Info($"{ev.Killer}");
         if (!(GulagRef.hasBeenInGulag(ev.Target) || GulagRef.isInGulag(ev.Target)))
         {
             Log.Info($"{ev.Target.Nickname} dead");
             GulagRef.AddInQueue(ev.Target);
         }
         if (GulagRef.isInGulag(ev.Target))
         {
             GulagRef.getWinner(ev.Target);
         }
     }catch (Exception ex)
     {
         Log.Info(ex.ToString());
     }
 }
Пример #28
0
 internal void OnPlayerDeath(DiedEventArgs ev)
 {
     if (ev.Killer.Team == Team.SCP)
     {
         if (ev.Killer.Role == RoleType.Scp93989 || ev.Killer.Role == RoleType.Scp93953)
         {
             int health = HealthOnKill.instance.Config.isHealthRegenRandom ?
                          (int)ev.Killer.Health + Random.Range(HealthOnKill.instance.Config.scp939HealthOnKillRandomLowerBounds, HealthOnKill.instance.Config.scp939HealthOnKillRandomUpperBounds) :
                          (int)ev.Killer.Health + HealthOnKill.instance.Config.scp939HealthOnKillSet;
             ev.Killer.Health = Mathf.Clamp(health, 0f, ev.Killer.MaxHealth);
         }
         else if (ev.Killer.Role == RoleType.Scp173)
         {
             int health = HealthOnKill.instance.Config.isHealthRegenRandom ?
                          (int)ev.Killer.Health + Random.Range(HealthOnKill.instance.Config.scp173HealthOnKillRandomLowerBounds, HealthOnKill.instance.Config.scp173HealthOnKillRandomUpperBounds) :
                          (int)ev.Killer.Health + HealthOnKill.instance.Config.scp173HealthOnKillSet;
             ev.Killer.Health = Mathf.Clamp(health, 0f, ev.Killer.MaxHealth);
         }
         else if (ev.Killer.Role == RoleType.Scp0492)
         {
             if (ev.Killer.SessionVariables.ContainsKey("is966") && (bool)ev.Killer.SessionVariables["is966"])
             {
                 ev.Killer.Health = Mathf.Clamp(ev.Killer.Health + 15, 0f, ev.Killer.MaxHealth);
             }
             else
             {
                 int health = HealthOnKill.instance.Config.isHealthRegenRandom ?
                              (int)ev.Killer.Health + Random.Range(HealthOnKill.instance.Config.scp0492HealthOnKillRandomLowerBounds, HealthOnKill.instance.Config.scp0492HealthOnKillRandomUpperBounds) :
                              (int)ev.Killer.Health + HealthOnKill.instance.Config.scp0492HealthOnKillSet;
                 ev.Killer.Health = Mathf.Clamp(health, 0f, ev.Killer.MaxHealth);
             }
         }
         else if (ev.Killer.Role == RoleType.Scp106 && Warhead.IsDetonated)
         {
             int health = HealthOnKill.instance.Config.isHealthRegenRandom ?
                          (int)ev.Killer.Health + Random.Range(5, 15) :
                          (int)ev.Killer.Health + HealthOnKill.instance.Config.scp106HealthOnKillSet;
             ev.Killer.Health = Mathf.Clamp(health, 0f, ev.Killer.MaxHealth);
         }
     }
 }
Пример #29
0
 public void OnDied(DiedEventArgs ev)
 {
     if (ev.Killer != null && ev.Target.Role != RoleType.Scp049)
     {
         if (!BloodLust049.Instance.Config.DisableInstantRevive && ev.Killer.Role == RoleType.Scp049 && (BloodLust049.Instance.bloodLustActive || BloodLust049.Instance.Config.AlwaysInstantRevive))
         {
             Log.Debug("049 killed player, respawning", BloodLust049.Instance.Config.Debug);
             Timing.CallDelayed(0.5f, () =>
             {
                 if (ev.Target != null)
                 {
                     ev.Target.Role = RoleType.Scp0492;
                 }
             });
         }
     }
     else if (ev.Target.Role == RoleType.Scp049)
     {
         BloodLust049.Instance.Scp049InGame = false;
     }
 }
Пример #30
0
        public void OnPlayerDeath(DiedEventArgs ev)
        {
            if (shPlayers.Contains(ev.Target.Id))
            {
                shPlayers.Remove(ev.Target.Id);
            }

            if (ev.Target.Role == RoleType.Scp106 && !SerpentsHand.instance.Config.FriendlyFire)
            {
                foreach (Player player in Player.List.Where(x => shPocketPlayers.Contains(x.Id)))
                {
                    player.ReferenceHub.playerStats.HurtPlayer(new PlayerStats.HitInfo(50000, "WORLD", ev.HitInformations.GetDamageType(), player.Id), player.GameObject);
                }
            }

            /* for (int i = shPlayers.Count - 1; i >= 0; i--)
             * {
             *   if (Player.Get(shPlayers[i]).Role == RoleType.Spectator)
             *   {
             *       shPlayers.RemoveAt(i);
             *   }
             * }*/
        }