Example #1
0
 public override bool Cast(BoardTarget target, DeckManager manager)
 {
     if (manager.energy < cost)
     {
         manager.Alert("Not enough energy!");
         return(false);
     }
     if (discard)
     {
         var hand = manager.handTransform.GetComponentsInChildren <CardUI>();
         num = hand.Length;
         foreach (var c in hand)
         {
             manager.Discard(c.card);
             Destroy(c.gameObject);
         }
     }
     else
     {
         manager.Discard(this);
     }
     for (int i = 0; i < num; i++)
     {
         manager.DrawToHand();
     }
     manager.energy -= cost;
     return(true);
 }
Example #2
0
 public override bool Cast(BoardTarget target, DeckManager manager)
 {
     if (manager.energy < cost)
     {
         manager.Alert("Not enough energy!");
         return(false);
     }
     if (target == null || target.unit == null)
     {
         manager.Alert("Invalid target!");
         return(false);
     }
     else
     {
         if (target.unit.team == manager)
         {
             manager.Alert("Target is friendly!");
             return(false);
         }
         target.unit.moveDist = Mathf.Max(1.1f, target.unit.moveDist * 0.6f);
         if (damage < 0)
         {
             target.unit.Heal(-damage);
         }
         else
         {
             target.unit.Damage(damage);
         }
         manager.Discard(this);
         manager.energy -= cost;
         return(true);
     }
 }
Example #3
0
 public override bool Cast(BoardTarget target, DeckManager manager)
 {
     if (manager.energy < cost)
     {
         manager.Alert("Not enough energy!");
         return(false);
     }
     foreach (var b in target.board.targets)
     {
         if (b.unit != null && (b.transform.localPosition - target.transform.localPosition).sqrMagnitude < radius * radius)
         {
             if (damage < 0)
             {
                 b.unit.Heal(-damage);
             }
             else
             {
                 b.unit.Damage(damage);
             }
         }
     }
     manager.Discard(this);
     manager.energy -= cost;
     return(true);
 }
Example #4
0
 public void DiscardPlayedCard()
 {
     if (playedCard)
     {
         playedCard.inPlay = false;
         deck.Discard(playedCard);
         playedCard = null;
     }
 }
Example #5
0
 public virtual bool Cast(BoardTarget target, DeckManager manager)
 {
     Debug.Log("Casted 'Test Card' on " + target);
     manager.Discard(this);
     return(true);
 }