@Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); Permanent iceCauldron = game.getPermanent(source.getSourceId()); if (controller != null && iceCauldron != null) { game.getState().setValue("IceCauldronMana" + source.getSourceId().toString(), source.getManaCostsToPay().getUsedManaToPay()); //store the mana used to pay manaUsedString = source.getManaCostsToPay().getUsedManaToPay().toString(); iceCauldron.addInfo("MANA USED", CardUtil.addToolTipMarkTags("Mana used last: " + manaUsedString), game); return true; } return false; } }
@Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); Permanent jeweledAmulet = game.getPermanent(source.getSourceId()); if (controller != null && jeweledAmulet != null) { game.getState().setValue("JeweledAmulet" + source.getSourceId().toString(), source.getManaCostsToPay().getUsedManaToPay()); //store the mana used to pay manaUsedString = source.getManaCostsToPay().getUsedManaToPay().toString(); jeweledAmulet.addInfo("MANA USED", CardUtil.addToolTipMarkTags("Mana used last: " + manaUsedString), game); return true; } return false; } }
@Override public void init(Ability source, Game game) { target.setNotTarget(true); target.setRequired(false); Player controller = game.getPlayer(source.getControllerId()); Permanent protectiveSphere = game.getPermanent(source.getSourceId()); if (controller != null && protectiveSphere != null) { game.getState().setValue("ProtectiveSphere" + source.getSourceId().toString(), source.getManaCostsToPay().getUsedManaToPay()); //store the mana used to pay protectiveSphere.addInfo("MANA USED", CardUtil.addToolTipMarkTags("Last mana used for protective ability: " + source.getManaCostsToPay().getUsedManaToPay()), game); } this.target.choose(Outcome.PreventDamage, source.getControllerId(), source.getSourceId(), game); super.init(source, game); }
Mana mana = spell.getSpellAbility().getManaCostsToPay().getUsedManaToPay(); if (mana.getBlack() > 0) { count++;