use of mage.abilities.effects.common.UntapTargetEffect in project mage by magefree.
the class BesmirchEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
if (game.getPermanent(source.getFirstTarget()) != null) {
TargetPointer target = new FixedTarget(source.getFirstTarget(), game);
// gain control
game.addEffect(new GainControlTargetEffect(Duration.EndOfTurn).setTargetPointer(target), source);
// haste
game.addEffect(new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.EndOfTurn).setTargetPointer(target), source);
// goad
game.addEffect(new GoadTargetEffect().setTargetPointer(target), source);
// untap
new UntapTargetEffect().setTargetPointer(target).apply(game, source);
return true;
}
return false;
}
use of mage.abilities.effects.common.UntapTargetEffect in project mage by magefree.
the class DomineeringWillEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Player targetPlayer = game.getPlayer(getTargetPointer().getFirst(game, source));
if (targetPlayer != null) {
ContinuousEffect effect = new GainControlTargetEffect(Duration.EndOfTurn, targetPlayer.getId());
effect.setTargetPointer(new SecondTargetPointer());
effect.setText("Target player gains control of up to three target nonattacking creatures until end of turn");
game.addEffect(effect, source);
Effect effect2 = new UntapTargetEffect();
effect2.setTargetPointer(new SecondTargetPointer());
effect2.setText("Untap those creatures");
effect2.apply(game, source);
RequirementEffect effect3 = new BlocksIfAbleTargetEffect(Duration.EndOfTurn);
effect3.setTargetPointer(new SecondTargetPointer());
effect3.setText("They block this turn if able");
game.addEffect(effect3, source);
return true;
}
return false;
}
use of mage.abilities.effects.common.UntapTargetEffect in project mage by magefree.
the class HuntingWildsToken method apply.
@Override
public boolean apply(Game game, Ability source) {
for (Effect sourceEffect : source.getEffects()) {
if (sourceEffect instanceof SearchLibraryPutInPlayEffect) {
Cards foundCards = new CardsImpl(((SearchLibraryPutInPlayEffect) sourceEffect).getTargets());
if (!foundCards.isEmpty()) {
FixedTargets fixedTargets = new FixedTargets(foundCards, game);
UntapTargetEffect untapEffect = new UntapTargetEffect();
untapEffect.setTargetPointer(fixedTargets);
untapEffect.apply(game, source);
BecomesCreatureTargetEffect becomesCreatureEffect = new BecomesCreatureTargetEffect(new HuntingWildsToken(), false, true, Duration.Custom);
becomesCreatureEffect.setTargetPointer(fixedTargets);
game.addEffect(becomesCreatureEffect, source);
}
return true;
}
}
return false;
}
use of mage.abilities.effects.common.UntapTargetEffect in project mage by magefree.
the class FrenziedFugueTriggeredAbility method checkTrigger.
@Override
public boolean checkTrigger(GameEvent event, Game game) {
this.getEffects().clear();
boolean result;
if (event.getType() == GameEvent.EventType.ENTERS_THE_BATTLEFIELD) {
result = event.getTargetId().equals(this.getSourceId());
} else {
result = event.getPlayerId().equals(this.getControllerId());
}
if (result) {
Permanent enchantment = game.getPermanentOrLKIBattlefield(getSourceId());
if (enchantment != null && enchantment.getAttachedTo() != null) {
Effect effect = new GainControlTargetEffect(Duration.EndOfTurn, true);
effect.setTargetPointer(new FixedTarget(enchantment.getAttachedTo(), game));
this.getEffects().add(effect);
effect = new UntapTargetEffect();
effect.setTargetPointer(new FixedTarget(enchantment.getAttachedTo(), game));
this.getEffects().add(effect);
effect = new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.EndOfTurn);
effect.setTargetPointer(new FixedTarget(enchantment.getAttachedTo(), game));
this.getEffects().add(effect);
} else {
result = false;
}
}
return result;
}
Aggregations