Пример #1
0
        public override ActiveSkill GetSkill(CombatMonster monster)
        {
            var allActiveSkills = monster.Monster.Species.Skills
                                  .Where(s => s is ActiveSkill)
                                  .ToList();

            var sb = new StringBuilder();

            sb.AppendLine(monster.ToString());

            var i = 1;

            foreach (var skill in allActiveSkills)
            {
                var activeSkill = (ActiveSkill)skill;
                // var isOnCooldown = activeSkill.Cooldown > 0;

                sb.Append($"[{i}] {activeSkill.Name} - {activeSkill.Description}");

                // if (isOnCooldown)
                // sb.Append(" [on cooldown]");

                sb.AppendLine();

                i++;
            }

            Console.Write(sb);

            Console.Write("> ");
            var input = Console.ReadLine();

            Console.WriteLine();

            if (!int.TryParse(input, out var skillIndex))
            {
                throw new Exception("Invalid input");
            }

            return(allActiveSkills[skillIndex - 1] as ActiveSkill);
        }
Пример #2
0
 public override ActiveSkill GetSkill(CombatMonster monster)
 {
     throw new System.NotImplementedException();
 }
Пример #3
0
 public abstract ActiveSkill GetSkill(CombatMonster monster);