MArcomage

Free multiplayer on-line fantasy card game

Please log in


0 U
Mediator
Mediator

Discard a card from opponent's hand and pay half its cost
If not enough stock
Highest facility: -1

Id
414
Name
Mediator
Rarity
Uncommon
Keywords
Cost (B / G / R)
0 / 0 / 0
Modes
8
Level
6
Created
11. Apr, 2009
Modified
29. Oct, 2016
Played
666 / 9532
Discarded
461 / 5162
Drawn
1435 / 17330

BB code

Effect

Discard a card from opponent's hand and pay half its cost
If not enough stock
Highest facility: -1

Code

    $dis_card = $t->getCard($t->hisData()->Hand[$t->mode()]);
    $t->setCard('his', $t->mode(), $t->drawCard($t->hisDeck(), $t->hisData()->Hand, $t->mode(), 'drawCardDifferent'));
    $resources = ['Quarry' => 'Bricks', 'Magic' => 'Gems', 'Dungeons' => 'Recruits'];
    foreach ($resources as $facility => $resource) {
      $t->myData()->$resource-= round($dis_card->getResources($resource) / 2);
    }
    foreach ($resources as $facility => $resource) {
      if ($t->myData()->$resource < 0) {
        $t->myData()->addHighestFacility(-1);
        break;
      }
    }