MArcomage

Free multiplayer on-line fantasy card game

Please log in


25 U
Pirate bay
Pirate bay

Wall: +10
Enemy stock: -3
Replace up to 3 non-Brigand non-rare cards in hand with non-common Brigand

Id
472
Name
Pirate bay
Rarity
Uncommon
Keywords
Cost (B / G / R)
25 / 0 / 0
Modes
0
Level
10
Created
24. Oct, 2009
Modified
24. Oct, 2009
Played
326 / 5278
Discarded
106 / 1560
Drawn
477 / 7987

BB code

Effect

Wall: +10
Enemy stock: -3
Replace up to 3 non-Brigand non-rare cards in hand with non-common Brigand

Code

    $t->myData()->addWall(10);
    $t->hisData()->addStock(-3);
    $storage = array();
    for ($i = 1; $i <= $t->handSize(); $i++) {
      $cur_card = $t->getCard($t->myData()->Hand[$i]);
      if (!$cur_card->hasKeyword('Brigand') && $cur_card->getRarity() != 'Rare' && $i != $t->cardPos()) {
        $storage[] = $i;
      }
    }
    if (count($storage) > 0) {
      shuffle($storage);
      $brigand_list = array_merge($t->getList(['rarity'=>'Uncommon', 'keyword'=>'Brigand']), $t->getList(['rarity'=>'Rare', 'keyword'=>'Brigand']));
      for ($i = 0; $i < count($storage) && $i < 3; $i++) {
        $t->setCard('my', $storage[$i], $t->drawCard($brigand_list, $t->myData()->Hand, $storage[$i], 'drawCardList'));
      }
    }