MArcomage

Free multiplayer on-line fantasy card game

Please log in

Keywords > Aria

Icon

Aria

Effect

Wind of change - if Round is divisible by 5, discards N lowest cost common cards from hand, N based on played card rarity (C-1, U-2, R-4).

Lore

Element of Air is often underestimated by novice mages, because other elements such as Fire produces much more immediate effects. Moreover, mastering it requires much effort and patience and even then it takes perfect timing to put it to good use. Successful execution however, is rewarded with the ability to dramatically change the conditions on the battlefield, thus producing unexpected turn of events and hampering opponent's strategy.

Code

    if (($t->round() % 5) == 0) {
      $storage = array();
      for ($i = 1; $i <= $t->handSize(); $i++) {
        if ($i != $t->cardPos()) {
          $cur_card = $this->getCard($t->myData()->Hand[$i]);
          if ($cur_card->getRarity() == 'Common') {
            $storage[$i] = $cur_card->getResources();
          }
        }
      }
      if (count($storage) > 0) {
        asort($storage);
        $amounts = ['Common' => 1, 'Uncommon' => 2, 'Rare' => 4];
        $amount = $amounts[$t->card()->getRarity()]; $i = 0;

        foreach ($storage as $discarded_pos => $cost) {
          if ($i == $amount) {
            break;
          }

          $this->setCard('my', $discarded_pos, $this->drawCard($t->myDeck(), $t->myData()->Hand, $discarded_pos, 'drawCardRandom'));
          $i++;
        }
      }
    }