MArcomage

Free multiplayer on-line fantasy card game

Please log in


10 15 R
Beastmaster
Beastmaster

Beast Durable

Replace a non-Beast highest rarity card in opponent's hand with common Beast
Attack: 5N
N = #Beast in game

Id
323
Name
Beastmaster
Rarity
Rare
Keywords
Cost (B / G / R)
0 / 10 / 15
Modes
0
Level
8
Created
4. Oct, 2007
Modified
7. Apr, 2012
Played
662 / 4884
Discarded
110 / 1133
Drawn
417 / 3806

BB code

Effect

Replace a non-Beast highest rarity card in opponent's hand with common Beast
Attack: 5N
N = #Beast in game

Code

    $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();
      if (!$cur_card->hasKeyword('Beast')) {
        $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, $t->drawCard($t->getList(['rarity'=>'Common', 'keyword'=>'Beast']), $t->hisData()->Hand, $discarded_pos, 'drawCardList'));
    }
    $tmp = $t->keywordCount($t->myData()->Hand, 'Beast') + $t->keywordCount($t->hisData()->Hand, 'Beast');
    $t->hisData()->attack(5 * $tmp);