Ejemplo n.º 1
0
        /// <summary>
        /// Checks for game logic and then kills a character.
        /// This runs checks for:
        ///     - Scarlet Woman
        /// </summary>
        /// <param name="player"></param>
        /// <param name="causeOfDeath"></param>
        public void KillPlayer(Player player, CauseOfDeath causeOfDeath)
        {
            //If the Demon dies and there is an alive Scarlet Woman and there is 5 or more non traveller players change the scarlet woman to the demon
            if (Players.PlayersList.Where(x => x.IsAlive && x.Role.Type != RoleType.Traveller).Count() >= 5 &&
                player.Role.Type == RoleType.Demon &&
                Players.PlayersList.Any(x => x.Role.Name == "Scarlet Woman" && x.IsAlive))
            {
                Players.PlayersList.Where(x => x.Role.Name == "Scarlet Woman" && x.IsAlive).First().ChangeRole(player.Role);
            }

            player.KillPlayer(causeOfDeath, CurrentDay);
        }