Exemplo n.º 1
0
        public Game(int startingChoice, Killer killer)
        {
            Survivors     = Enumerable.Range(0, 4).Select(s => new Survivor(killer.Rank)).Where(s => s.Status != Status.Nonexistent).ToArray();
            GensRemaining = 5 - (4 - Survivors.Length);
            GameOver      = !Survivors.Any() || Survivors.All(s => s.Status == Status.DCed);
            Killer        = killer;

            int saltModifier = Utils.RANDOM.Next(5, 10) * (4 - Survivors.Count(s => s.Status != Status.DCed));

            switch (killer.Name)
            {
            case KillerName.Doctor:
                saltModifier += Utils.RANDOM.Next(10, 20);
                break;

            case KillerName.Nightmare:
                saltModifier += Utils.RANDOM.Next(5, 30);
                break;

            case KillerName.Nurse:
                saltModifier += Utils.RANDOM.Next(0, 15);
                break;
            }

            for (int i = 0; i < Survivors.Length; ++i)
            {
                Survivors[i].Saltiness += saltModifier;
            }
        }
        public void AddSurvivor(Survivor survivor)
        {
            if (Survivors.Any(s => s.Name == survivor.Name))
            {
                return;
            }

            Survivors.Add(survivor);
            History.LogEvent(new HistoryEvent(survivor.Name, nameof(Survivor), "ADDED_TO_GAME"));
        }
Exemplo n.º 3
0
        public bool AddSurvivorToGame(Survivor newSurvivor)
        {
            var retVal          = false;
            var newSurvivorName = newSurvivor.Name;

            if (!Survivors.Any(s => s.Name.Equals(newSurvivorName)))
            {
                newSurvivor.Notifier = _notifier;
                Survivors.Add(newSurvivor);
                Notify($"Survivor {newSurvivor.Name} was added to the game");

                retVal = true;
            }

            return(retVal);
        }