$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'));
}