use of mage.abilities.effects.common.continuous.SetPowerToughnessTargetEffect in project mage by magefree.
the class DanceOfTheManseEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
if (player == null) {
return false;
}
Cards cards = new CardsImpl(source.getTargets().stream().map(Target::getTargets).flatMap(Collection::stream).map(game::getCard).filter(Objects::nonNull).collect(Collectors.toSet()));
player.moveCards(cards, Zone.BATTLEFIELD, source, game);
if (source.getManaCostsToPay().getX() < 6) {
return true;
}
cards.stream().map(game::getPermanent).filter(Objects::nonNull).forEach(permanent -> {
ContinuousEffect effect = new AddCardTypeTargetEffect(Duration.EndOfGame, CardType.CREATURE);
effect.setTargetPointer(new FixedTarget(permanent, game));
game.addEffect(effect, source);
effect = new SetPowerToughnessTargetEffect(4, 4, Duration.EndOfGame);
effect.setTargetPointer(new FixedTarget(permanent, game));
game.addEffect(effect, source);
});
return true;
}
use of mage.abilities.effects.common.continuous.SetPowerToughnessTargetEffect in project mage by magefree.
the class VhatiIlDalEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
DynamicValue power = null;
DynamicValue toughness = null;
if (controller.chooseUse(outcome, "Set power? (otherwise toughness is set)", source, game)) {
power = StaticValue.get(1);
} else {
toughness = StaticValue.get(1);
}
ContinuousEffect effect = new SetPowerToughnessTargetEffect(power, toughness, Duration.EndOfTurn);
game.addEffect(effect, source);
return true;
}
return false;
}
use of mage.abilities.effects.common.continuous.SetPowerToughnessTargetEffect in project mage by magefree.
the class KatsumasaTheAnimatorEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Permanent permanent = game.getPermanent(source.getFirstTarget());
if (permanent == null) {
return false;
}
game.addEffect(new AddCardTypeTargetEffect(Duration.EndOfTurn, CardType.ARTIFACT, CardType.CREATURE), source);
game.addEffect(new GainAbilityTargetEffect(FlyingAbility.getInstance(), Duration.EndOfTurn), source);
if (permanent.hasSubtype(SubType.VEHICLE, game)) {
game.addEffect(new SetPowerToughnessTargetEffect(1, 1, Duration.EndOfTurn), source);
}
return true;
}
use of mage.abilities.effects.common.continuous.SetPowerToughnessTargetEffect in project mage by magefree.
the class SingingTreeEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Permanent targetCreature = game.getPermanent(source.getFirstTarget());
if (targetCreature != null) {
int toughness = targetCreature.getToughness().getBaseValueModified();
game.addEffect(new SetPowerToughnessTargetEffect(0, toughness, Duration.EndOfTurn), source);
return true;
}
return false;
}
use of mage.abilities.effects.common.continuous.SetPowerToughnessTargetEffect in project mage by magefree.
the class MinscBelovedRangerEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
int xValue = source.getManaCostsToPay().getX();
game.addEffect(new SetPowerToughnessTargetEffect(xValue, xValue, Duration.EndOfTurn), source);
game.addEffect(new AddCardSubTypeTargetEffect(SubType.GIANT, Duration.EndOfTurn), source);
return true;
}
Aggregations