use of mage.abilities.effects.common.continuous.BoostSourceEffect in project mage by magefree.
the class OutcomesTest method test_FromEffects_Multi.
@Test
public void test_FromEffects_Multi() {
Ability abilityGood = new SimpleStaticAbility(new GainLifeEffect(10));
abilityGood.addEffect(new BoostSourceEffect(10, 10, Duration.EndOfTurn));
Assert.assertEquals(1 + 1, abilityGood.getEffects().getOutcomeScore(abilityGood));
Ability abilityBad = new SimpleStaticAbility(new DamageTargetEffect(10));
abilityBad.addEffect(new ExileTargetEffect());
Assert.assertEquals(-1 + -1, abilityBad.getEffects().getOutcomeScore(abilityBad));
}
use of mage.abilities.effects.common.continuous.BoostSourceEffect in project mage by magefree.
the class OutcomesTest method test_FromAbility_MultiCombine.
@Test
public void test_FromAbility_MultiCombine() {
Ability ability = new SimpleStaticAbility(new GainLifeEffect(10));
ability.addEffect(new BoostSourceEffect(10, 10, Duration.EndOfTurn));
ability.addEffect(new ExileTargetEffect());
// must "convert" all effects to good
ability.addCustomOutcome(Outcome.Neutral);
Assert.assertEquals(1 + 1 + 1, ability.getEffects().getOutcomeScore(ability));
}
use of mage.abilities.effects.common.continuous.BoostSourceEffect in project mage by magefree.
the class OutcomesTest method test_FromAbility_Multi.
@Test
public void test_FromAbility_Multi() {
Ability abilityGood = new SimpleStaticAbility(new GainLifeEffect(10));
abilityGood.addEffect(new BoostSourceEffect(10, 10, Duration.EndOfTurn));
abilityGood.addCustomOutcome(Outcome.Detriment);
Assert.assertEquals(-1 + -1, abilityGood.getEffects().getOutcomeScore(abilityGood));
Ability abilityBad = new SimpleStaticAbility(new DamageTargetEffect(10));
abilityBad.addEffect(new ExileTargetEffect());
abilityBad.addCustomOutcome(Outcome.Neutral);
Assert.assertEquals(1 + 1, abilityBad.getEffects().getOutcomeScore(abilityBad));
}
use of mage.abilities.effects.common.continuous.BoostSourceEffect in project mage by magefree.
the class BarbarianBullyEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Permanent permanent = game.getPermanentOrLKIBattlefield(source.getSourceId());
if (permanent == null) {
return false;
}
boolean costPaid = false;
for (UUID playerId : game.getState().getPlayerList(source.getControllerId())) {
Player player = game.getPlayer(playerId);
if (player == null) {
continue;
}
if (player.chooseUse(Outcome.UnboostCreature, "Have " + permanent.getName() + " deal 4 damage to you?", source, game)) {
player.damage(4, permanent.getId(), source, game);
costPaid = true;
}
}
if (!costPaid) {
return new BoostSourceEffect(2, 2, Duration.EndOfTurn).apply(game, source);
}
return true;
}
use of mage.abilities.effects.common.continuous.BoostSourceEffect in project mage by magefree.
the class ManaplasmAbility method checkTrigger.
@Override
public boolean checkTrigger(GameEvent event, Game game) {
Spell spell = game.getStack().getSpell(event.getTargetId());
if (spell != null && spell.isControlledBy(controllerId)) {
this.getEffects().remove(0);
int x = spell.getManaValue();
this.addEffect(new BoostSourceEffect(x, x, Duration.EndOfTurn));
this.getEffects().get(0).setTargetPointer(new FixedTarget(event.getPlayerId()));
return true;
}
return false;
}
Aggregations