use of mage.abilities.effects.common.continuous.BoostTargetEffect in project mage by magefree.
the class NyleasColossusEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Permanent permanent = game.getPermanent(source.getFirstTarget());
if (permanent == null) {
return false;
}
int power = permanent.getPower().getValue();
int toughness = permanent.getToughness().getValue();
game.addEffect(new BoostTargetEffect(power, toughness, Duration.EndOfTurn), source);
return true;
}
use of mage.abilities.effects.common.continuous.BoostTargetEffect in project mage by magefree.
the class ToxicStenchEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
ContinuousEffect effect = new BoostTargetEffect(-1, -1, Duration.EndOfTurn);
Permanent permanent = game.getPermanent(source.getFirstTarget());
if (permanent != null) {
effect.setTargetPointer(new FixedTarget(permanent, game));
game.addEffect(effect, source);
return true;
}
return false;
}
use of mage.abilities.effects.common.continuous.BoostTargetEffect in project mage by magefree.
the class ZulaportDuelistEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
game.addEffect(new BoostTargetEffect(-2, 0), source);
Permanent permanent = game.getPermanent(source.getFirstTarget());
if (permanent == null) {
return false;
}
Player player = game.getPlayer(permanent.getControllerId());
if (player == null) {
return false;
}
player.millCards(2, source, game);
return true;
}
use of mage.abilities.effects.common.continuous.BoostTargetEffect in project mage by magefree.
the class AleatoryEffect 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 CemeteryDesecratorRemoveCountersEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
TargetCardInGraveyard target = new TargetCardInGraveyard(filter);
target.setNotTarget(true);
controller.choose(outcome, target, source.getSourceId(), game);
Card card = game.getCard(target.getFirstTarget());
if (card != null) {
int manaValue = card.getManaValue();
if (controller.moveCards(card, Zone.EXILED, source, game)) {
ReflexiveTriggeredAbility ability = new ReflexiveTriggeredAbility(new CemeteryDesecratorRemoveCountersEffect(manaValue), false, triggerText);
ability.addTarget(new TargetPermanent());
Mode mode = new Mode(new BoostTargetEffect(-manaValue, -manaValue, Duration.EndOfTurn).setText("Target creature an opponent controls gets -X/-X until end of turn, where X is the mana value of the exiled card"));
mode.addTarget(new TargetOpponentsCreaturePermanent());
ability.addMode(mode);
game.fireReflexiveTriggeredAbility(ability, source);
return true;
}
}
}
return false;
}
Aggregations