use of mage.abilities.effects.common.DontUntapInControllersNextUntapStepTargetEffect in project mage by magefree.
the class ExertSourceCost method pay.
@Override
public boolean pay(Ability ability, Game game, Ability source, UUID controllerId, boolean noMana, Cost costToPay) {
Player player = game.getPlayer(controllerId);
Permanent permanent = game.getPermanent(source.getSourceId());
if (player != null && permanent != null) {
game.fireEvent(GameEvent.getEvent(GameEvent.EventType.BECOMES_EXERTED, permanent.getId(), source, source.getControllerId()));
ContinuousEffect effect = new DontUntapInControllersNextUntapStepTargetEffect("", permanent.getControllerId());
effect.setTargetPointer(new FixedTarget(permanent, game));
game.addEffect(effect, ability);
paid = true;
}
return paid;
}
use of mage.abilities.effects.common.DontUntapInControllersNextUntapStepTargetEffect in project mage by magefree.
the class PollenLullabyEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(getTargetPointer().getFirst(game, source));
if (player != null) {
List<Permanent> doNotUntapNextUntapStep = new ArrayList<>();
for (Permanent creature : game.getBattlefield().getAllActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, player.getId(), game)) {
doNotUntapNextUntapStep.add(creature);
}
if (!doNotUntapNextUntapStep.isEmpty()) {
ContinuousEffect effect = new DontUntapInControllersNextUntapStepTargetEffect("This creature");
effect.setTargetPointer(new FixedTargets(doNotUntapNextUntapStep, game));
game.addEffect(effect, source);
}
return true;
}
return false;
}
use of mage.abilities.effects.common.DontUntapInControllersNextUntapStepTargetEffect in project mage by magefree.
the class BreachingLeviathanEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
List<Permanent> doNotUntapNextUntapStep = new ArrayList<>();
for (Permanent creature : game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source.getSourceId(), game)) {
creature.tap(source, game);
doNotUntapNextUntapStep.add(creature);
}
if (!doNotUntapNextUntapStep.isEmpty()) {
ContinuousEffect effect = new DontUntapInControllersNextUntapStepTargetEffect("This creature");
effect.setTargetPointer(new FixedTargets(doNotUntapNextUntapStep, game));
game.addEffect(effect, source);
}
return true;
}
use of mage.abilities.effects.common.DontUntapInControllersNextUntapStepTargetEffect in project mage by magefree.
the class ChandrasRevolutionEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
boolean applied = false;
// Chandra's Revolution deals 4 damage to target creature.
Permanent permanent = game.getPermanent(source.getTargets().get(0).getFirstTarget());
if (permanent != null) {
applied |= permanent.damage(4, source.getSourceId(), source, game, false, true) > 0;
}
permanent = game.getPermanent(source.getTargets().get(1).getFirstTarget());
if (permanent != null) {
// Tap target land. That land doesn't untap during its controller's next untap step.
permanent.tap(source, game);
ContinuousEffect effect = new DontUntapInControllersNextUntapStepTargetEffect("that land");
effect.setTargetPointer(new FixedTarget(permanent, game));
game.addEffect(effect, source);
}
return applied;
}
use of mage.abilities.effects.common.DontUntapInControllersNextUntapStepTargetEffect in project mage by magefree.
the class ClingingMistsEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
List<Permanent> doNotUntapNextUntapStep = new ArrayList<>();
for (Permanent creature : game.getBattlefield().getActivePermanents(StaticFilters.FILTER_ATTACKING_CREATURES, source.getControllerId(), source.getSourceId(), game)) {
creature.tap(source, game);
doNotUntapNextUntapStep.add(creature);
}
if (!doNotUntapNextUntapStep.isEmpty()) {
ContinuousEffect effect = new DontUntapInControllersNextUntapStepTargetEffect("This creature");
effect.setTargetPointer(new FixedTargets(doNotUntapNextUntapStep, game));
game.addEffect(effect, source);
}
return true;
}
Aggregations