use of mage.abilities.effects.common.combat.GoadTargetEffect 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.combat.GoadTargetEffect in project mage by magefree.
the class AgitatorAntEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
for (Player player : game.getState().getPlayersInRange(source.getControllerId(), game).stream().map(game::getPlayer).filter(Objects::nonNull).collect(Collectors.toList())) {
if (game.getBattlefield().countAll(StaticFilters.FILTER_PERMANENT_CREATURE, player.getId(), game) < 1 || !player.chooseUse(Outcome.BoostCreature, "Put two +1/+1 counters on a creature you control?", source, game)) {
continue;
}
TargetPermanent targetPermanent = new TargetControlledCreaturePermanent(0, 1);
targetPermanent.setNotTarget(true);
player.choose(Outcome.BoostCreature, targetPermanent, source.getSourceId(), game);
Permanent permanent = game.getPermanent(targetPermanent.getFirstTarget());
if (permanent == null || !permanent.addCounters(CounterType.P1P1.createInstance(2), player.getId(), source, game)) {
continue;
}
game.addEffect(new GoadTargetEffect().setTargetPointer(new FixedTarget(permanent, game)), source);
}
return true;
}
use of mage.abilities.effects.common.combat.GoadTargetEffect in project mage by magefree.
the class KaimaTheFracturedCalmEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
int goaded = 0;
for (Permanent permanent : game.getBattlefield().getActivePermanents(StaticFilters.FILTER_OPPONENTS_PERMANENT_CREATURE, source.getControllerId(), source.getSourceId(), game)) {
if (permanent.getAttachments().stream().map(game::getPermanent).filter(Objects::nonNull).noneMatch(p -> p.isControlledBy(source.getControllerId()) && p.hasSubtype(SubType.AURA, game))) {
continue;
}
game.addEffect(new GoadTargetEffect().setTargetPointer(new FixedTarget(permanent, game)), source);
goaded++;
}
if (goaded < 1) {
return false;
}
Permanent permanent = source.getSourcePermanentIfItStillExists(game);
if (permanent != null) {
permanent.addCounters(CounterType.P1P1.createInstance(goaded), source, game);
}
return true;
}
Aggregations