MArcomage

Free multiplayer on-line fantasy card game

Please log in


10 C
Duelist
Duelist

Soldier

Recruits: +10
Discard highest cost non-rare Recruits only card from opponent's hand

Id
20
Name
Duelist
Rarity
Common
Keywords
Cost (B / G / R)
0 / 0 / 10
Modes
0
Level
10
Created
1. May, 2006
Modified
24. Dec, 2011
Played
2359 / 19132
Discarded
725 / 6203
Drawn
3795 / 31565

BB code

Effect

Recruits: +10
Discard highest cost non-rare Recruits only card from opponent's hand

Code

    $t->myData()->addRecruits(10);
    $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->getRarity() != 'Rare' && $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'));
    }