MArcomage

Free multiplayer on-line fantasy card game

Please log in


6 C
Chaos gargoyle
Chaos gargoyle

Unliving Durable

Attack: 5
Discard a common card from hand
If discarded card wasn't Unliving
Wall: +5

Id
533
Name
Chaos gargoyle
Rarity
Common
Keywords
Cost (B / G / R)
6 / 0 / 0
Modes
0
Level
10
Created
21. Jun, 2010
Modified
24. Dec, 2012
Played
2561 / 33269
Discarded
2614 / 18092
Drawn
3581 / 30341

BB code

Effect

Attack: 5
Discard a common card from hand
If discarded card wasn't Unliving
Wall: +5

Code

    $t->hisData()->attack(5);
    $storage = array();
    for ($i = 1; $i <= $t->handSize(); $i++) {
      if ($i != $t->cardPos() && $t->getCard($t->myData()->Hand[$i])->getRarity() == 'Common') {
        $storage[] = $i;
      }
    }
    if (count($storage) > 0) {
      $dis_index = $storage[$t->arrayRand($storage)];
      if (!$t->getCard($t->myData()->Hand[$dis_index])->hasKeyword('Unliving')) {
        $t->myData()->addWall(5);
      }
      $t->setCard('my', $dis_index, $t->drawCard($t->myDeck(), $t->myData()->Hand, $dis_index, 'drawCardRandom'));
    }