use of mage.abilities.effects.ContinuousEffect in project mage by magefree.
the class GodEternalRhonasEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Permanent godEternalRhonas = game.getPermanent(source.getSourceId());
for (Permanent permanent : game.getBattlefield().getAllActivePermanents(filter, source.getControllerId(), game)) {
if (permanent == null || godEternalRhonas != null && permanent == godEternalRhonas) {
continue;
}
ContinuousEffect effect = new BoostTargetEffect(permanent.getPower().getValue(), 0, Duration.EndOfTurn);
effect.setTargetPointer(new FixedTarget(permanent, game));
game.addEffect(effect, source);
ContinuousEffect effect2 = new GainAbilityTargetEffect(VigilanceAbility.getInstance(), Duration.EndOfTurn);
effect2.setTargetPointer(new FixedTarget(permanent, game));
game.addEffect(effect2, source);
}
return true;
}
use of mage.abilities.effects.ContinuousEffect in project mage by magefree.
the class HalfdaneSetPowerToughnessEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
Permanent permanent = game.getPermanent(this.getTargetPointer().getFirst(game, source));
if (permanent != null) {
ContinuousEffect effect = new HalfdaneSetPowerToughnessEffect(permanent.getPower().getValue(), permanent.getToughness().getValue());
game.addEffect(effect, source);
return true;
}
}
return false;
}
use of mage.abilities.effects.ContinuousEffect in project mage by magefree.
the class GuardianOfTazeemEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Permanent land = getTargetPointer().getFirstTargetPermanentOrLKI(game, source);
Permanent targetCreature = game.getPermanent(source.getFirstTarget());
if (land != null && targetCreature != null && land.hasSubtype(SubType.ISLAND, game)) {
ContinuousEffect effect = new DontUntapInControllersNextUntapStepTargetEffect("that creature");
effect.setTargetPointer(new FixedTarget(targetCreature, game));
game.addEffect(effect, source);
}
return true;
}
use of mage.abilities.effects.ContinuousEffect in project mage by magefree.
the class KnacksawCliqueCastFromExileEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Player opponent = game.getPlayer(targetPointer.getFirst(game, source));
MageObject sourceObject = game.getObject(source.getSourceId());
if (sourceObject != null && opponent != null) {
if (opponent.getLibrary().hasCards()) {
Library library = opponent.getLibrary();
Card card = library.getFromTop(game);
if (card != null) {
opponent.moveCardToExileWithInfo(card, source.getSourceId(), sourceObject.getName(), source, game, Zone.LIBRARY, true);
ContinuousEffect effect = new KnacksawCliqueCastFromExileEffect();
effect.setTargetPointer(new FixedTarget(card.getId(), game));
game.addEffect(effect, source);
}
}
return true;
}
return false;
}
use of mage.abilities.effects.ContinuousEffect in project mage by magefree.
the class MassMutinyEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
boolean result = false;
for (Target target : source.getTargets()) {
if (target instanceof TargetCreaturePermanent) {
Permanent targetCreature = game.getPermanent(target.getFirstTarget());
if (targetCreature != null) {
ContinuousEffect effect1 = new GainControlTargetEffect(Duration.EndOfTurn);
effect1.setTargetPointer(new FixedTarget(targetCreature.getId(), game));
game.addEffect(effect1, source);
ContinuousEffect effect2 = new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.EndOfTurn);
effect2.setTargetPointer(new FixedTarget(targetCreature.getId(), game));
game.addEffect(effect2, source);
targetCreature.untap(game);
result = true;
}
}
}
return result;
}
Aggregations