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
685 / 3434
Discarded
441 / 2040
Drawn
1534 / 7778

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'));
      }
    }