$t->hisData()->attack(13);
$storage = array();
for ($i = 1; $i <= $t->handSize(); $i++) {
if ($t->getCard($t->hisData()->Hand[$i])->hasKeyword('Legend')) {
$storage[] = $i;
}
}
if (count($storage) > 0) {
$discarded_pos = $storage[$t->arrayRand($storage)];
$t->setCard('his', $discarded_pos, $t->drawCard($t->hisDeck(), $t->hisData()->Hand, $discarded_pos, 'drawCardDifferent'));
$t->hisData()->addMagic(-1);
}