[CMR] Implemented Liesa, Shroud of Dusk

This commit is contained in:
Evan Kranzler 2020-11-08 17:45:33 -05:00
parent 7d8baaf345
commit b8feae7f3a
7 changed files with 98 additions and 19 deletions

View file

@ -13,6 +13,8 @@ import mage.filter.FilterMana;
import mage.game.Game;
import mage.game.GameState;
import mage.game.permanent.Permanent;
import mage.util.ManaUtil;
import mage.watchers.common.CommanderPlaysCountWatcher;
import java.util.List;
import java.util.UUID;
@ -180,4 +182,13 @@ public interface Card extends MageObject {
default boolean isOwnedBy(UUID controllerId) {
return getOwnerId().equals(controllerId);
}
default boolean commanderCost(Game game, Ability source, Ability abilityToModify) {
CommanderPlaysCountWatcher watcher = game.getState().getWatcher(CommanderPlaysCountWatcher.class);
int castCount = watcher.getPlaysCount(getId());
if (castCount > 0) {
abilityToModify.getManaCostsToPay().add(ManaUtil.createManaCost(2 * castCount, false));
}
return true;
}
}