@Override public int calculate(Game game, Ability sourceAbility, Effect effect) { int chroma = 0; chroma += permanent.getManaCost().getMana().getWhite(); return chroma; }
@Override public int calculate(Game game, Ability sourceAbility, Effect effect) { int chroma = 0; for (Card card : revealed.getCards(game)) { chroma += card.getManaCost().getMana().getBlue(); } return chroma; }
@Override public int calculate(Game game, Ability sourceAbility, Effect effect) { chroma = 0; Player you = game.getPlayer(sourceAbility.getControllerId()); if (you == null) { return 0; } for (Card card : you.getGraveyard().getCards(game)) { chroma += card.getManaCost().getMana().getBlack(); } return chroma; }
@Override public int calculate(Game game, Ability sourceAbility, Effect effect) { chroma = 0; for (Card card : game.getBattlefield().getAllActivePermanents(new FilterControlledPermanent(), sourceAbility.getControllerId(), game)) { chroma += card.getManaCost().getMana().getGreen(); } return chroma; }
@Override public boolean apply(Game game, Ability source, Ability abilityToModify) { Player controller = game.getPlayer(abilityToModify.getControllerId()); if (controller != null) { Mana mana = abilityToModify.getManaCostsToPay().getMana(); if (mana.count() > 1 && mana.getGeneric() > 0) { CardUtil.reduceCost(abilityToModify, 1); } return true; } return false; }
@Override public boolean apply(Game game, Ability source, Ability abilityToModify) { int blackSymbols = abilityToModify.getManaCosts().getMana().getBlack(); TargetControlledPermanent target = new TargetControlledPermanent(blackSymbols, blackSymbols, filter, true); target.setRequired(false); abilityToModify.addCost(new SacrificeTargetCost(target)); return true; }
@Override public boolean apply(Game game, Ability source, Ability abilityToModify) { Player controller = game.getPlayer(abilityToModify.getControllerId()); if (controller != null) { Mana mana = abilityToModify.getManaCostsToPay().getMana(); if (mana.count() > 1 && mana.getGeneric() > 0) { CardUtil.reduceCost(abilityToModify, 1); } return true; } return false; }
@Override public int calculate(Game game, Ability sourceAbility, Effect effect) { chroma = 0; for (Card card : game.getBattlefield().getAllActivePermanents(new FilterControlledPermanent(), sourceAbility.getControllerId(), game)) { chroma += card.getManaCost().getMana().getRed(); } return chroma; }
@Override public int calculate(Game game, Ability sourceAbility, Effect effect) { chroma = 0; for (Card card : game.getBattlefield().getAllActivePermanents(new FilterControlledPermanent(), sourceAbility.getControllerId(), game)) { chroma += card.getManaCost().getMana().getRed(); } return chroma; }
@Override public int calculate(Game game, Ability sourceAbility, Effect effect) { int chroma = 0; for (Permanent permanent : game.getBattlefield().getAllActivePermanents(new FilterPermanent(), sourceAbility.getControllerId(), game)) { chroma += permanent.getManaCost().getMana().getWhite(); } return chroma; }
@Override public boolean apply(Game game, Ability source, Ability abilityToModify) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { int generic = abilityToModify.getManaCostsToPay().getMana().getGeneric(); if (generic > 0) { ChoiceImpl choice = new ChoiceImpl(false); Set<String> set = new LinkedHashSet<>(); for (int i = 0; i <= Math.min(2, generic); i++) { set.add(String.valueOf(i)); } choice.setChoices(set); MageObject mageObject = game.getObject(abilityToModify.getSourceId()); choice.setMessage("Reduce cost of " + (mageObject != null ? mageObject.getIdName() : filter.getMessage())); if (controller.choose(Outcome.Benefit, choice, game)) { generic = Integer.parseInt(choice.getChoice()); } CardUtil.reduceCost(abilityToModify, generic); } return true; } return false; }
@Override public boolean apply(Game game, Ability source, Ability abilityToModify) { SpellAbility spellAbility = (SpellAbility) abilityToModify; Mana mana = spellAbility.getManaCostsToPay().getMana(); if (mana.getGeneric() > 0) { int count = game.getOpponents(source.getControllerId()).size(); int newCount = mana.getGeneric() - count; if (newCount < 0) { newCount = 0; } mana.setGeneric(newCount); spellAbility.getManaCostsToPay().load(mana.toString()); return true; } return false; }
@Override public boolean apply(Game game, Ability source, Ability abilityToModify) { SpellAbility spellAbility = (SpellAbility) abilityToModify; Mana mana = spellAbility.getManaCostsToPay().getMana(); if (mana.getGeneric() > 0) { int newCount = mana.getGeneric() - 6; if (newCount < 0) { newCount = 0; } mana.setGeneric(newCount); spellAbility.getManaCostsToPay().load(mana.toString()); return true; } return false; }
@Override public boolean apply(Game game, Ability source, Ability abilityToModify) { SpellAbility spellAbility = (SpellAbility) abilityToModify; Mana mana = spellAbility.getManaCostsToPay().getMana(); if (mana.getGeneric() > 0) { int newCount = mana.getGeneric() - 6; if (newCount < 0) { newCount = 0; } mana.setGeneric(newCount); spellAbility.getManaCostsToPay().load(mana.toString()); return true; } return false; }
@Override public boolean apply(Game game, Ability source, Ability abilityToModify) { SpellAbility spellAbility = (SpellAbility) abilityToModify; Mana mana = spellAbility.getManaCostsToPay().getMana(); if (mana.getGeneric() > 0) { int newCount = mana.getGeneric() - 6; if (newCount < 0) { newCount = 0; } mana.setGeneric(newCount); spellAbility.getManaCostsToPay().load(mana.toString()); return true; } return false; }
@Override public boolean apply(Game game, Ability source, Ability abilityToModify) { Player controller = game.getPlayer(abilityToModify.getControllerId()); if (controller != null) { Mana mana = abilityToModify.getManaCostsToPay().getMana(); int reduce = mana.getGeneric(); if (reduce > 0 && mana.count() == mana.getGeneric()) { reduce--; } if (reduce > 2) { reduce = 2; } CardUtil.reduceCost(abilityToModify, reduce); } return true; }
@Override public boolean apply(Game game, Ability source, Ability abilityToModify) { SpellAbility spellAbility = (SpellAbility) abilityToModify; Mana mana = spellAbility.getManaCostsToPay().getMana(); if (mana.getGeneric() > 0) { int newCount = mana.getGeneric() - 2; if (newCount < 0) { newCount = 0; } mana.setGeneric(newCount); spellAbility.getManaCostsToPay().load(mana.toString()); return true; } return false; }
@Override public boolean apply(Game game, Ability source, Ability abilityToModify) { SpellAbility spellAbility = (SpellAbility)abilityToModify; Mana mana = spellAbility.getManaCostsToPay().getMana(); if (mana.getGeneric() > 0) { int count = new DevotionCount(ColoredManaSymbol.B).calculate(game, source, this); int newCount = mana.getGeneric() - count; if (newCount < 0) { newCount = 0; } mana.setGeneric(newCount); spellAbility.getManaCostsToPay().load(mana.toString()); return true; } return false; }
@Override public boolean apply(Game game, Ability source, Ability abilityToModify) { SpellAbility spellAbility = (SpellAbility) abilityToModify; Mana mana = spellAbility.getManaCostsToPay().getMana(); Player player = game.getPlayer(source.getControllerId()); if (mana.getGeneric() > 0 && player != null && player.getLife() < 4) { int newCount = mana.getGeneric() - 6; if (newCount < 0) { newCount = 0; } mana.setGeneric(newCount); spellAbility.getManaCostsToPay().load(mana.toString()); return true; } return false; }
@Override public boolean apply(Game game, Ability source, Ability abilityToModify) { SpellAbility spellAbility = (SpellAbility)abilityToModify; Mana mana = spellAbility.getManaCostsToPay().getMana(); if (mana.getGeneric() > 0) { int count = game.getBattlefield().count(filter, source.getSourceId(), source.getControllerId(), game); int newCount = mana.getGeneric() - count; if (newCount < 0) { newCount = 0; } mana.setGeneric(newCount); spellAbility.getManaCostsToPay().load(mana.toString()); return true; } return false; }