use of mage.abilities.effects.common.continuous.GainAbilityTargetEffect in project mage by magefree.
the class BurnDownTheHouseEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Token token = new DevilToken();
token.putOntoBattlefield(3, game, source, source.getControllerId());
game.addEffect(new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.EndOfTurn).setTargetPointer(new FixedTargets(token, game)), source);
return true;
}
use of mage.abilities.effects.common.continuous.GainAbilityTargetEffect in project mage by magefree.
the class EwokAmbushCreateTokenEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
CreateTokenEffect effect = new CreateTokenEffect(new EwokToken(), 2);
effect.apply(game, source);
for (UUID tokenId : effect.getLastAddedTokenIds()) {
Permanent token = game.getPermanent(tokenId);
if (token != null) {
ContinuousEffect continuousEffect = new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.EndOfTurn);
continuousEffect.setTargetPointer(new FixedTarget(tokenId));
game.addEffect(continuousEffect, source);
}
}
return true;
}
return false;
}
use of mage.abilities.effects.common.continuous.GainAbilityTargetEffect 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.common.continuous.GainAbilityTargetEffect in project mage by magefree.
the class HammerHelperEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
Permanent targetCreature = game.getPermanent(source.getFirstTarget());
if (controller != null && targetCreature != null) {
source.getEffects().get(0).setTargetPointer(new FixedTarget(targetCreature.getId(), game));
game.addEffect(new GainControlTargetEffect(Duration.EndOfTurn), source);
targetCreature.untap(game);
int amount = controller.rollDice(outcome, source, game, 6);
game.addEffect(new BoostTargetEffect(amount, 0, Duration.EndOfTurn), source);
game.addEffect(new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.EndOfTurn), source);
return true;
}
return false;
}
use of mage.abilities.effects.common.continuous.GainAbilityTargetEffect 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