MArcomage

Free multiplayer on-line fantasy card game

Please log in


15 U
Monster slayer
Monster slayer

Far sight

Attack: 16
Discard highest rarity Unliving, Undead or Dragon from opponent's hand

Id
409
Name
Monster slayer
Rarity
Uncommon
Keywords
Cost (B / G / R)
0 / 0 / 15
Modes
0
Level
10
Created
24. Dec, 2008
Modified
24. Jun, 2012
Played
360 / 4219
Discarded
118 / 1460
Drawn
600 / 7207

BB code

Effect

Attack: 16
Discard highest rarity Unliving, Undead or Dragon from opponent's hand

Code

    $t->hisData()->attack(16);
    $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('Dragon') || $cur_card->hasKeyword('Undead') || $cur_card->hasKeyword('Unliving')) {
        $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->hisDeck(), $t->hisData()->Hand, $discarded_pos, 'drawCardDifferent'));
    }