Exemplo n.º 1
0
 private void CheckIfCharacterExists(string name)
 {
     if (!Party.Any(c => c.Name == name))
     {
         throw new ArgumentException($"Character {name} not found!");
     }
 }
Exemplo n.º 2
0
 public void HandlePartyNewMemberMessage(Bot bot, PartyNewMemberMessage message)
 {
     if (Party == null)
     {
         Party = new List <PartyMemberInformations>();
     }
     if (!Party.Any(member => member.id == message.memberInformations.id))
     {
         Party.Add(message.memberInformations);
     }
 }
Exemplo n.º 3
0
        public string GetStats()
        {
            var builder = new StringBuilder();

            foreach (var character in Party.OrderByDescending(c => c.IsAlive).ThenByDescending(c => c.Health))
            {
                builder.AppendLine(character.ToString());
            }
            if (!Party.Any())
            {
                return("");
            }

            return(builder.ToString().TrimEnd());
        }
 public override bool DoesScenarioMeetRequirements(StorySubject story, Day day, Player player, Party party)
 {
     return party.Any(p => p.PlayerArchetype == this._archetype);
 }
Exemplo n.º 5
0
 public static Func <bool> GetVisitProcessCondition(Flags flags, Party party)
 {
     return(() => flags.Time != TimeOfDay.NIGHT && party.Any(c => c.Stats.State == State.ALIVE));
 }
Exemplo n.º 6
0
        public void RandomParty()
        {
            Party.Clear();
            Artifacts.Clear();

            for (var i = 0; i < 8; i++)
            {
                switch (Dice.Roll(1, 6))
                {
                case 1:
                    Party.Add(SlayerRecruit.Wizard());
                    break;

                case 2:
                    Party.Add(SlayerRecruit.Warrior());
                    break;

                case 3:
                    Party.Add(SlayerRecruit.Archer());
                    break;

                case 4:
                    Party.Add(SlayerRecruit.MenAtArms());
                    Party.Add(SlayerRecruit.MenAtArms());
                    break;

                case 5:
                    Artifacts.Add(SlayerArtifact.RandomArtifact());
                    break;

                case 6:
                    if (!Party.Any(_ => _.Type == ERecruitType.MenAtArms))
                    {
                        Party.Add(SlayerRecruit.MenAtArms());
                        Party.Add(SlayerRecruit.MenAtArms());
                    }
                    else if (!Party.Any(_ => _.Type == ERecruitType.Warrior))
                    {
                        Party.Add(SlayerRecruit.Warrior());
                    }
                    else
                    {
                        switch (Dice.Roll(1, 3))
                        {
                        case 1:
                            Party.Add(SlayerRecruit.Wizard());
                            break;

                        case 2:
                            Party.Add(SlayerRecruit.Archer());
                            break;

                        default:
                            Artifacts.Add(SlayerArtifact.RandomArtifact());
                            break;
                        }
                    }
                    break;
                }
            }
        }