$deck_cards = array_merge($t->myDeck()->Common, $t->myDeck()->Uncommon, $t->myDeck()->Rare);
$count = 0;
for ($i = 1; $i <= $t->handSize(); $i++) {
if (!in_array($t->myData()->Hand[$i], $deck_cards) && $i != $t->cardPos()) {
$count++;
}
}
$t->myData()->addStock(min($count, 4));