MArcomage

Free multiplayer on-line fantasy card game

Please log in

Keywords > Burning

Icon

Burning

Effect

Basic gain 3, bonus gain 6, Fire blast - replace highest rarity non-Burning card from opponent's hand of the same or lower rarity as the played card with Searing fire.

Lore

It is said that burning creatures are those who were blessed by the sun god himself. Others say, that they are devil's pawns destines to serve him for eternity. Element of fire is know to consume everything eventually, but despite that many creatures are attracted by its power regardless of the price they have to pay to wield it.

Burning creatures are able to accumulate their destructive power and completely destroy its target, leaving only burned ashes behind.

Code

    // target card is discarded only if it has same or lower rarity than the played card
    $rarities = ['Common' => 0, 'Uncommon' => 1, 'Rare' => 2];
    $storage = ['Common' => array(), 'Uncommon' => array(), 'Rare' => array()];
    $played_rank = $rarities[$t->card()->getRarity()];
    
    for ($i = 1; $i <= $t->handSize(); $i++) {
      $dis_card = $this->getCard($t->hisData()->Hand[$i]);
      $dis_rarity = $dis_card->getRarity();
      $dis_rank = $rarities[$dis_rarity];
      
      // pick only cards that can be discarded by played card
      if (!$dis_card->hasKeyword('Burning') && $dis_rank <= $played_rank) {
        $storage[$dis_rarity][] = $i;
      }
    }
    
    if ((count($storage['Common']) + count($storage['Uncommon']) + count($storage['Rare'])) > 0) {
      // pick preferably cards with higher rarity, but choose random card within the rarity group
      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);
      $this->setCard('his', $discarded_pos, 248, ['reveal' => true]);
    }