use of mage.abilities.effects.common.continuous.BoostTargetEffect in project mage by magefree.
the class FoulRenewalEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
Card card = game.getCard(targetPointer.getFirst(game, source));
if (card != null) {
int xValue = card.getToughness().getValue() * -1;
controller.moveCards(card, Zone.HAND, source, game);
if (xValue != 0) {
ContinuousEffect effect = new BoostTargetEffect(xValue, xValue, Duration.EndOfTurn);
effect.setTargetPointer(new FixedTarget(source.getTargets().get(1).getFirstTarget()));
game.addEffect(effect, source);
}
}
return true;
}
return false;
}
use of mage.abilities.effects.common.continuous.BoostTargetEffect in project mage by magefree.
the class GrimHirelingEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
int xValue = GetXValue.instance.calculate(game, source, this);
game.addEffect(new BoostTargetEffect(-xValue, -xValue), source);
return true;
}
use of mage.abilities.effects.common.continuous.BoostTargetEffect in project mage by magefree.
the class MacabreMockeryEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Card card = game.getCard(getTargetPointer().getFirst(game, source));
if (card == null) {
return false;
}
Player controller = game.getPlayer(source.getControllerId());
if (controller == null || !controller.moveCards(card, Zone.BATTLEFIELD, source, game)) {
return false;
}
Permanent permanent = game.getPermanent(card.getId());
if (permanent == null) {
return false;
}
ContinuousEffect effect = new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.Custom);
effect.setTargetPointer(new FixedTarget(permanent, game));
game.addEffect(effect, source);
effect = new BoostTargetEffect(2, 0, Duration.EndOfTurn);
effect.setTargetPointer(new FixedTarget(permanent, game));
game.addEffect(effect, source);
Effect sacrificeEffect = new SacrificeTargetEffect("sacrifice " + permanent.getLogName(), controller.getId());
sacrificeEffect.setTargetPointer(new FixedTarget(permanent, game));
game.addDelayedTriggeredAbility(new AtTheBeginOfNextEndStepDelayedTriggeredAbility(sacrificeEffect), source);
return true;
}
use of mage.abilities.effects.common.continuous.BoostTargetEffect in project mage by magefree.
the class MightOfMurasaEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
int i = KickedCondition.instance.apply(game, source) ? 5 : 3;
game.addEffect(new BoostTargetEffect(i, i, Duration.EndOfTurn), source);
return true;
}
use of mage.abilities.effects.common.continuous.BoostTargetEffect in project mage by magefree.
the class ParoxysmEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Permanent aura = game.getPermanent(source.getSourceId());
if (aura != null) {
Permanent creatureAttachedTo = game.getPermanent(aura.getAttachedTo());
if (creatureAttachedTo != null) {
Player controllerOfCreature = game.getPlayer(creatureAttachedTo.getControllerId());
if (controllerOfCreature != null) {
Card revealCardFromTop = controllerOfCreature.getLibrary().getFromTop(game);
if (revealCardFromTop != null) {
Cards cards = new CardsImpl(revealCardFromTop);
controllerOfCreature.revealCards(source, cards, game);
if (revealCardFromTop.isLand(game)) {
creatureAttachedTo.destroy(source, game, false);
} else {
ContinuousEffect effect = new BoostTargetEffect(3, 3, Duration.EndOfTurn);
effect.setTargetPointer(new FixedTarget(creatureAttachedTo.getId(), game));
game.addEffect(effect, source);
}
return true;
}
}
}
}
return false;
}
Aggregations