MArcomage

Free multiplayer on-line fantasy card game

Please log in


6 R
Steelbeard
Steelbeard

Brigand Durable

If last card played wasn't Steelbeard
Production x0
Replace highest rarity card in opponent's hand with Hidden treasure

Id
669
Name
Steelbeard
Rarity
Rare
Keywords
Cost (B / G / R)
0 / 0 / 6
Modes
0
Level
9
Created
24. Jun, 2012
Modified
26. Sep, 2015
Played
881 / 6719
Discarded
256 / 1848
Drawn
613 / 3791

BB code

Effect

If last card played wasn't Steelbeard
Production x0
Replace highest rarity card in opponent's hand with Hidden treasure

Code

    if ($t->myLastAction() != 'play' || $t->myLastCard()->id() != $t->card()->id()) {
      $t->production()->multiply(0);
      $storage = ['Common' => array(), 'Uncommon' => array(), 'Rare' => array()];
      for ($i = 1; $i <= $t->handSize(); $i++) {
        $cur_card = $t->getCard($t->hisData()->Hand[$i]);
        $rarity = $cur_card->getRarity();
        $storage[$rarity][] = $i;
      }
      if ((count($storage['Common']) + count($storage['Uncommon']) + count($storage['Rare'])) > 0) {
        shuffle($storage['Common']);
        shuffle($storage['Uncommon']);
        shuffle($storage['Rare']);
        $storage_temp = array_merge($storage['Common'], $storage['Uncommon'], $storage['Rare']);
        $discarded_pos = array_pop($storage_temp);
        $t->setCard('his', $discarded_pos, 274, ['reveal' => true]);
      }
    }