MArcomage

Free multiplayer on-line fantasy card game

Please log in


5 U
Call of the wilds
Call of the wilds

Replace non-rare Beast in hand with Beast cards of upgraded rarity
Production x0

Id
347
Name
Call of the wilds
Rarity
Uncommon
Keywords
Cost (B / G / R)
0 / 0 / 5
Modes
0
Level
10
Created
12. Feb, 2008
Modified
1. Aug, 2015
Played
315 / 3697
Discarded
97 / 1657
Drawn
547 / 7110

BB code

Effect

Replace non-rare Beast in hand with Beast cards of upgraded rarity
Production x0

Code

    $t->production()->multiply(0);
    $rarities = array();
    $upgrades = ['Common' => 'Uncommon', 'Uncommon' => 'Rare'];
    for ($i = 1; $i <= $t->handSize(); $i++) {
      if ($t->getCard($t->myData()->Hand[$i])->hasKeyword('Beast')) {
        $rarities[$i] = $t->getCard($t->myData()->Hand[$i])->getRarity();
      }
    }
    foreach ($rarities as $i => $val) {
      if (in_array($val, ['Common', 'Uncommon'])) {
        $t->setCard('my', $i, $t->drawCard($t->getList(['rarity'=>$upgrades[$val], 'keyword'=>'Beast']), $t->myData()->Hand, $i, 'drawCardList'));
      }
    }