@Override public void init(Ability source, Game game) { super.init(source, game); amount = new DevotionCount(ColoredManaSymbol.W).calculate(game, source, this); }
public Mana computeMana(String color, Game game, Ability source) { Mana mana = new Mana(); if (color != null && !color.isEmpty()) { switch (color) { case "Red": mana.setRed(new DevotionCount(ColoredManaSymbol.R).calculate(game, source, this)); break; case "Blue": mana.setBlue(new DevotionCount(ColoredManaSymbol.U).calculate(game, source, this)); break; case "White": mana.setWhite(new DevotionCount(ColoredManaSymbol.W).calculate(game, source, this)); break; case "Black": mana.setBlack(new DevotionCount(ColoredManaSymbol.B).calculate(game, source, this)); break; case "Green": mana.setGreen(new DevotionCount(ColoredManaSymbol.G).calculate(game, source, this)); break; } } return mana; } }
@Override public void adjustTargets(Ability ability, Game game) { ability.getTargets().clear(); int numbTargets = new DevotionCount(ColoredManaSymbol.B).calculate(game, ability, null); if (numbTargets > 0) { ability.addTarget(new TargetCreaturePermanent(0, numbTargets)); } } }
@Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { int lifeLost = 0; int damage = new DevotionCount(ColoredManaSymbol.B).calculate(game, source, this); if (damage > 0) { for (UUID playerId : game.getOpponents(source.getControllerId())) { Player opponent = game.getPlayer(playerId); if (opponent != null) { lifeLost += opponent.loseLife(damage, game, false); } } } controller.gainLife(lifeLost, game, source); 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) { int devotion = new DevotionCount(ColoredManaSymbol.B).calculate(game, source, this); Player targetPlayer = game.getPlayer(targetPointer.getFirst(game, source)); if (devotion > 0 && targetPlayer != null) {