MArcomage

Free multiplayer on-line fantasy card game

Please log in

Keywords > Undead

Icon

Undead

Effect

Basic gain 5, bonus gain 5, Eternal servitude - a part of the total cost of the played card will be returned. Returned amount is based on number of different resources present in the card cost (3 - third, 2 - half, 1 - two thirds).

Lore

Mages that were corrupted by the promise of eternal life are transformed to liches. These powerful creatures are able to conjure vast armies of undead to fight for their cause. An undead can't die, therefore much of the corpses can be reanimated after the battle to plague the living once again.

Code

    $coef = (($t->card()->getResources('Bricks') > 0) ? 1 : 0) + (($t->card()->getResources('Gems') > 0) ? 1 : 0) + (($t->card()->getResources('Recruits') > 0) ? 1 : 0);
    $bonuses = [0 => 0, 1 => 2/3, 2 => 1/2, 3 => 1/3];
    $bonus = $bonuses[$coef];
    $t->myData()
      ->addBricks(round($t->card()->getResources('Bricks') * $bonus))
      ->addGems(round($t->card()->getResources('Gems') * $bonus))
      ->addRecruits(round($t->card()->getResources('Recruits') * $bonus));