use of mage.abilities.effects.common.continuous.BoostTargetEffect in project mage by magefree.
the class NightshadeSeerEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
RevealTargetFromHandCost cost = new RevealTargetFromHandCost(new TargetCardInHand(0, Integer.MAX_VALUE, filter));
if (!cost.pay(source, game, source, source.getControllerId(), true)) {
return false;
}
int xValue = -1 * cost.getNumberRevealedCards();
game.addEffect(new BoostTargetEffect(xValue, xValue, Duration.EndOfTurn), source);
return true;
}
use of mage.abilities.effects.common.continuous.BoostTargetEffect in project mage by magefree.
the class OrcishCaptainEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
Permanent permanent = game.getPermanent(getTargetPointer().getFirst(game, source));
if (controller != null && permanent != null) {
if (controller.flipCoin(source, game, true)) {
game.informPlayers("Orcish Captain: Won flip. Target Orc creature gets +2/+0 until end of turn.");
game.addEffect(new BoostTargetEffect(2, 0, Duration.EndOfTurn), source);
return true;
} else {
game.informPlayers("Orcish Captain: Lost flip. Target Orc creature gets -0/-2 until end of turn.");
game.addEffect(new BoostTargetEffect(-0, -2, Duration.EndOfTurn), source);
return true;
}
}
return false;
}
use of mage.abilities.effects.common.continuous.BoostTargetEffect in project mage by magefree.
the class ContinuousEffectImplTest method isDependentTo.
@Test
public void isDependentTo() {
BoostTargetEffect ghe = new BoostTargetEffect(0, 0, Duration.Custom);
ghe.setDependedToType(DependencyType.AuraAddingRemoving);
Set<UUID> x = ghe.isDependentTo(new ArrayList<>());
Assert.assertThat(x.size(), is(0));
}
use of mage.abilities.effects.common.continuous.BoostTargetEffect in project mage by magefree.
the class FuriousResistanceEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Permanent target = game.getPermanent(source.getFirstTarget());
if (target == null) {
return false;
}
ContinuousEffect effect = new BoostTargetEffect(3, 0, Duration.EndOfTurn);
ContinuousEffect effect2 = new GainAbilityTargetEffect(FirstStrikeAbility.getInstance(), Duration.EndOfTurn);
effect.setTargetPointer(new FixedTarget(target.getId(), game));
effect2.setTargetPointer(new FixedTarget(target.getId(), game));
game.addEffect(effect, source);
game.addEffect(effect2, source);
return true;
}
use of mage.abilities.effects.common.continuous.BoostTargetEffect in project mage by magefree.
the class JoustEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Permanent creature1 = game.getPermanent(source.getTargets().get(0).getFirstTarget());
Permanent creature2 = game.getPermanent(source.getTargets().get(1).getFirstTarget());
if (creature1 == null) {
return false;
}
if (creature1.hasSubtype(SubType.KNIGHT, game)) {
ContinuousEffect effect = new BoostTargetEffect(2, 1, Duration.EndOfTurn);
effect.setTargetPointer(new FixedTarget(creature1.getId(), game));
game.addEffect(effect, source);
}
if (creature2 == null) {
return true;
}
game.getState().processAction(game);
return creature1.fight(creature2, source, game);
}
Aggregations