MArcomage

Free multiplayer on-line fantasy card game

Please log in


1 C
Goblin intruder
Goblin intruder

Horde

Replace a non-rare highest rarity card in opponent's hand with Goblin intruder

Id
415
Name
Goblin intruder
Rarity
Common
Keywords
Cost (B / G / R)
0 / 0 / 1
Modes
0
Level
10
Created
11. Apr, 2009
Modified
26. Sep, 2015
Played
1524 / 21402
Discarded
1087 / 11098
Drawn
1574 / 19297

BB code

Effect

Replace a non-rare highest rarity card in opponent's hand with Goblin intruder

Code

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