use of mage.abilities.effects.common.continuous.BoostTargetEffect in project mage by magefree.
the class DevouringRageEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
int numberSpirits = 0;
for (Cost cost : source.getCosts()) {
if (cost instanceof SacrificeTargetCost) {
numberSpirits = ((SacrificeTargetCost) cost).getPermanents().size();
}
}
int amount = 3 + (numberSpirits * 3);
Permanent targetCreature = game.getPermanent(getTargetPointer().getFirst(game, source));
if (targetCreature != null) {
ContinuousEffect effect = new BoostTargetEffect(amount, 0, Duration.EndOfTurn);
effect.setTargetPointer(new FixedTarget(targetCreature.getId(), game));
game.addEffect(effect, source);
return true;
}
return false;
}
use of mage.abilities.effects.common.continuous.BoostTargetEffect in project mage by magefree.
the class AureliaExemplarOfJusticeEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Permanent creature = game.getPermanent(source.getFirstTarget());
if (creature == null) {
return false;
}
game.addEffect(new BoostTargetEffect(2, 0, Duration.EndOfTurn), source);
if (creature.getColor(game).isRed()) {
game.addEffect(new GainAbilityTargetEffect(TrampleAbility.getInstance(), Duration.EndOfTurn), source);
}
if (creature.getColor(game).isWhite()) {
game.addEffect(new GainAbilityTargetEffect(VigilanceAbility.getInstance(), Duration.EndOfTurn), source);
}
return true;
}
use of mage.abilities.effects.common.continuous.BoostTargetEffect in project mage by magefree.
the class BronzeCudgelsEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Permanent permanent = source.getSourcePermanentOrLKI(game);
if (permanent == null || game.getPermanent(permanent.getAttachedTo()) == null) {
return false;
}
int resolvedCount = AbilityResolvedWatcher.getResolutionCount(game, source);
if (resolvedCount < 1) {
return false;
}
game.addEffect(new BoostTargetEffect(resolvedCount, 0).setTargetPointer(new FixedTarget(permanent.getOwnerId(), game)), source);
return true;
}
use of mage.abilities.effects.common.continuous.BoostTargetEffect in project mage by magefree.
the class ChaoticStrikeEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
Permanent permanent = game.getPermanent(getTargetPointer().getFirst(game, source));
if (controller != null && permanent != null) {
if (controller.flipCoin(source, game, true)) {
game.addEffect(new BoostTargetEffect(1, 1, Duration.EndOfTurn), source);
return true;
}
}
return false;
}
use of mage.abilities.effects.common.continuous.BoostTargetEffect in project mage by magefree.
the class ConsumeStrengthEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Permanent permanent = game.getPermanent(source.getFirstTarget());
if (permanent != null) {
ContinuousEffect effect = new BoostTargetEffect(2, 2, Duration.EndOfTurn);
effect.setTargetPointer(new FixedTarget(permanent, game));
game.addEffect(effect, source);
}
permanent = game.getPermanent(source.getTargets().get(1).getFirstTarget());
if (permanent != null) {
ContinuousEffect effect = new BoostTargetEffect(-2, -2, Duration.EndOfTurn);
effect.setTargetPointer(new FixedTarget(permanent, game));
game.addEffect(effect, source);
}
return true;
}
Aggregations