Пример #1
0
    public void Attack(ITargets target)
    {
        this.weapon.Attack(target);

        if (target.IsDead())
        {
            this.experience += target.GiveExperience();
        }
    }
Пример #2
0
    public void Attack(ITargets target)
    {
        if (this.durabilityPoints <= 0)
        {
            throw new InvalidOperationException("Weapon is broken.");
        }

        target.TakeAttack(this.attackPoints);
        this.durabilityPoints -= 1;
    }
Пример #3
0
 public bool TargetExists(IEntity source, ITargets targets)
 {
     foreach (Player p in GameManager.players)
     {
         if (targets.CanTarget(p))
         {
             return(true);
         }
         foreach (Card c in p.field.cards)
         {
             if (targets.CanTarget(c))
             {
                 return(true);
             }
         }
     }
     return(false);
 }