Ejemplo n.º 1
0
        public static void KillPlayer(this PlayerControl killer, PlayerControl target, PlayerControl killerAnimation)
        {
            DeadPlayers.Add(new DeadPlayer(target, killerAnimation, DateTime.UtcNow));
            KillOverlayShowOnePatch.killerAnimation = killerAnimation.Data;
            killer.MurderPlayer(target);

            if (killerAnimation.GetRole().Faction != Faction.Mafia || LocalRole.Faction != Faction.Mafia ||
                killerAnimation == LocalPlayer)
            {
                return;
            }

            switch (Main.OptionMafiaSharedKillCooldown)
            {
            case 0:     // None
                break;

            case 1:     // Killer
                LocalPlayer.GetAbility <AbilityKill>()
                ?.SetCooldown(killerAnimation.GetAbility <AbilityKill>().Cooldown);
                break;

            case 2:     // Self
                LocalPlayer.GetAbility <AbilityKill>()?.SetOnCooldown();
                break;

            case 3:     // Custom
                float cooldown = Main.OptionMafiaCustomSharedKillCooldown;
                LocalPlayer.GetAbility <AbilityKill>()?.SetCooldown(cooldown);
                break;
            }
        }
Ejemplo n.º 2
0
        private void AddNewDeadPlayer(Player victim)
        {
            var player = FindPlayer(victim.Id);

            if (player == null)
            {
                player = victim;
            }

            var newDeadPlayer = new DeadPlayer(player.Id, player.Name);

            newDeadPlayer.Sum();
            DeadPlayers.Add(newDeadPlayer);
        }