MArcomage

Free multiplayer on-line fantasy card game

Please log in


9 9 9 U
Necromancy amplifier
Necromancy amplifier

Stock: +2
Replace non-rare Undead in hand with Undead cards of upgraded rarity

Id
307
Name
Necromancy amplifier
Rarity
Uncommon
Keywords
Cost (B / G / R)
9 / 9 / 9
Modes
0
Level
10
Created
19. Aug, 2007
Modified
1. Aug, 2015
Played
677 / 3426
Discarded
434 / 2033
Drawn
1512 / 7756

BB code

Effect

Stock: +2
Replace non-rare Undead in hand with Undead cards of upgraded rarity

Code

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