public override void Kill(int timeLeft) { foreach (Action <ProceduralSpellProj> action in Kills.Where(action => action != null)) { action(this); } if (timeLeft > 0) { //Main.PlaySound(SoundID.Dig, projectile.position); SoundManager.PlaySound(Sounds.Dig, projectile.position); } }
private void OnKillsCollectionChanged(object sender, NotifyCollectionChangedEventArgs e) { KillCount = Kills.Count; JumpKillCount = Kills.Count(killEvent => killEvent.KillerVelocityZ > 0); CrouchKillCount = Kills.Count(killEvent => killEvent.IsKillerCrouching); TradeKillCount = Kills.Count(k => k.IsTradeKill); var kills = Kills.Where(k => k.KillerSide != k.KilledSide && k.KillerSteamId != 0) .GroupBy(k => k.KillerSteamId) .Select(group => new { SteamId = group.Key, KillCount = group.Count() }).ToList(); OneKillCount = kills.Count(k => k.KillCount == 1); TwoKillCount = kills.Count(k => k.KillCount == 2); ThreeKillCount = kills.Count(k => k.KillCount == 3); FourKillCount = kills.Count(k => k.KillCount == 4); FiveKillCount = kills.Count(k => k.KillCount == 5); }