$t->hisData()->attack(25)->addMagic(-1); $t->myData()->addMagic(1);
$storage = array();
for ($i = 1; $i <= $t->handSize(); $i++) {
if ($t->getCard($t->myData()->Hand[$i])->hasKeyword('Mage')) {
$storage[] = $i;
}
}
if (count($storage) > 0) {
$discarded_pos = $storage[$t->arrayRand($storage)];
$t->setCard('my', $discarded_pos, $t->drawCard($t->myDeck(), $t->myData()->Hand, $discarded_pos, 'drawCardRandom'));
$t->myData()->addGems(30);
}