MArcomage

Free multiplayer on-line fantasy card game

Please log in

Keywords > Siege

Icon

Siege

Effect

Demolition - if played card damages opponent's Tower or Wall and opponent raised his Tower or Wall last round, he suffers additional damage to Tower or Wall based on played card rarity (C-1, U-2, R-5) for Tower and (C-2, U-4, R-10) for Wall. The additional damage can't exceed the Tower or Wall increase.

Lore

Powerful creatures and war machines are often used as a siege weapons during the battle. Their attack is so powerful that fortifications that were built only recently may fail to endure such force and break apart.

Code

    $rarities = ['Common' => 1, 'Uncommon' => 2, 'Rare' => 5];
    $factor = $rarities[$t->card()->getRarity()];
    if ($t->hisChange('Tower') > 0 && $t->hisDataInit()['Tower'] > $t->hisData()->Tower) {
      $t->hisData()->addTower(-min($t->hisChange('Tower'), $factor));
    }

    if ($t->hisChange('Wall') > 0 && $t->hisDataInit()['Wall'] > $t->hisData()->Wall) {
      $t->hisData()->addWall(-min($t->hisChange('Wall'), 2 * $factor));
    }