MArcomage

Free multiplayer on-line fantasy card game

Please log in


13 U
Master hunter
Master hunter

Far sight Banish

Attack: 13
Discard highest cost Recruits only card from opponent's hand

Id
510
Name
Master hunter
Rarity
Uncommon
Keywords
Cost (B / G / R)
0 / 0 / 13
Modes
0
Level
10
Created
20. Jan, 2010
Modified
24. Jun, 2012
Played
661 / 5381
Discarded
135 / 1519
Drawn
938 / 8225

BB code

Effect

Attack: 13
Discard highest cost Recruits only card from opponent's hand

Code

$t->hisData()->attack(13);
    $card_costs = $max_cards = array(); $max = 0;
    for ($i = 1; $i <= $t->handSize(); $i++) {
      $cur_card = $t->getCard($t->hisData()->Hand[$i]);
      if ($cur_card->getResources('Bricks') == 0 && $cur_card->getResources('Gems') == 0 && $cur_card->getResources('Recruits') > 0) {
        $cur_cost = $card_costs[$i] = $cur_card->getResources('Recruits');
        if ($cur_cost > $max) {
          $max = $cur_cost;
        }
      }
    }
    if (count($card_costs) > 0) {
      foreach ($card_costs as $i => $cost) {
        if ($cost == $max) {
          $max_cards[] = $i;
        }
      }
      $dis_pos = $max_cards[$t->arrayRand($max_cards)];
      $t->setCard('his', $dis_pos, $t->drawCard($t->hisDeck(), $t->hisData()->Hand, $dis_pos, 'drawCardDifferent'));
    }