$my_counter = $his_counter = 0;
for ($i = 1; $i <= $t->handSize(); $i++) {
if ($t->getCard($t->myData()->Hand[$i])->hasKeyword('Mage') && $i != $t->cardPos()) {
$t->setCard('my', $i, $t->drawCard($t->myDeck(), $t->myData()->Hand, $i, 'drawCardRandom'));
$my_counter++;
}
if ($t->getCard($t->hisData()->Hand[$i])->hasKeyword('Mage')) {
$t->setCard('his', $i, $t->drawCard($t->hisDeck(), $t->hisData()->Hand, $i, 'drawCardRandom'));
$his_counter++;
}
}
$t->myData()->addTower($my_counter * 4)->addWall($my_counter * 8)->addGems($my_counter * 4);
$t->hisData()->addTower($his_counter * 4)->addWall($his_counter * 8)->addGems($his_counter * 4);