MArcomage

Free multiplayer on-line fantasy card game

Please log in


11 U
Elementalist
Elementalist

Mage Swift Banish

Players discard up to 6 Unliving cards
Players lose 10 bricks and 1 quarry for each card they discarded above 4

Id
419
Name
Elementalist
Rarity
Uncommon
Keywords
Cost (B / G / R)
0 / 11 / 0
Modes
0
Level
10
Created
11. Apr, 2009
Modified
1. Nov, 2010
Played
1647 / 11149
Discarded
542 / 3918
Drawn
2532 / 17302

BB code

Effect

Players discard up to 6 Unliving cards
Players lose 10 bricks and 1 quarry for each card they discarded above 4

Code

    $my_temp = $his_temp = array();
    for ($i = 1; $i <= $t->handSize(); $i++) {
      if ($t->getCard($t->myData()->Hand[$i])->hasKeyword('Unliving')) {
        $my_temp[$i] = $i;
      }
      if ($t->getCard($t->hisData()->Hand[$i])->hasKeyword('Unliving')) {
        $his_temp[$i] = $i;
      }
    }
    shuffle($my_temp); shuffle($his_temp);
    if (count($my_temp) > 0) {
      for ($i = 0; $i < count($my_temp) && $i < 6; $i++) {
        $t->setCard('my', $my_temp[$i], $t->drawCard($t->myDeck(), $t->myData()->Hand, $my_temp[$i], 'drawCardRandom'));
      }
      $amount = max(($i - 4), 0); $t->myData()->addBricks(-$amount * 10)->addQuarry(-$amount);
    }
    if (count($his_temp) > 0) {
      for ($j = 0; $j < count($his_temp) && $j < 6; $j++) {
        $t->setCard('his', $his_temp[$j], $t->drawCard($t->hisDeck(), $t->hisData()->Hand, $his_temp[$j], 'drawCardRandom'));
      }
      $amount = max(($j - 4), 0); $t->hisData()->addBricks(-$amount * 10)->addQuarry(-$amount);
    }