use of mage.abilities.effects.common.DamageMultiEffect in project mage by magefree.
the class TargetPriorityTest method test_targetAmount_BadCase.
@Test
public void test_targetAmount_BadCase() {
// choose targets as enters battlefield (e.g. can't be canceled)
SpellAbility spell = new SpellAbility(new ManaCostsImpl("R"), "damage 3", Zone.HAND);
Ability ability = new EntersBattlefieldTriggeredAbility(new DamageMultiEffect(3));
ability.addTarget(new TargetCreaturePermanentAmount(3));
addCustomCardWithSpell(playerA, spell, ability, CardType.ENCHANTMENT);
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 1);
//
// 1/1
addCard(Zone.BATTLEFIELD, playerA, "Memnite", 3);
// 2/2
addCard(Zone.BATTLEFIELD, playerA, "Balduvian Bears", 3);
// 2/2 with ability
addCard(Zone.BATTLEFIELD, playerA, "Ashcoat Bear", 3);
// 4/3
addCard(Zone.BATTLEFIELD, playerA, "Golden Bear", 3);
// 4/4 with ability
addCard(Zone.BATTLEFIELD, playerA, "Battering Sliver", 3);
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "damage 3");
// must damage x3 Balduvian Bears by -1 to keep alive
checkDamage("pt after", 1, PhaseStep.BEGIN_COMBAT, playerA, "Balduvian Bears", 1);
// showBattlefield("after", 1, PhaseStep.BEGIN_COMBAT, playerA);
setStopAt(1, PhaseStep.BEGIN_COMBAT);
execute();
assertAllCommandsUsed();
assertPermanentCount(playerA, "damage 3", 1);
assertPermanentCount(playerA, "Memnite", 3);
assertPermanentCount(playerA, "Balduvian Bears", 3);
assertPermanentCount(playerA, "Ashcoat Bear", 3);
assertPermanentCount(playerA, "Golden Bear", 3);
assertPermanentCount(playerA, "Battering Sliver", 3);
}
use of mage.abilities.effects.common.DamageMultiEffect in project mage by magefree.
the class RavenousGigantotheriumEffect method checkTrigger.
@Override
public boolean checkTrigger(GameEvent event, Game game) {
if (!super.checkTrigger(event, game)) {
return false;
}
Permanent permanent = game.getPermanentOrLKIBattlefield(event.getTargetId());
if (permanent == null) {
return false;
}
int power = Math.max(permanent.getPower().getValue(), 0);
this.getEffects().clear();
this.addEffect(new DamageMultiEffect(power));
this.addEffect(new RavenousGigantotheriumEffect());
this.getTargets().clear();
if (power < 1) {
return true;
}
this.addTarget(new TargetCreaturePermanentAmount(power));
return true;
}
use of mage.abilities.effects.common.DamageMultiEffect in project mage by magefree.
the class TargetPriorityTest method test_targetAmount_Performance.
@Test
// do not enable it in production, only for devs
@Ignore
public void test_targetAmount_Performance() {
int cardsMultiplier = 3;
Ability ability = new SimpleActivatedAbility(Zone.ALL, new DamageMultiEffect(3), new ManaCostsImpl("R"));
ability.addTarget(new TargetCreaturePermanentAmount(3));
addCustomCardWithAbility("damage 3", playerA, ability);
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 1);
//
// 1/1
addCard(Zone.BATTLEFIELD, playerB, "Memnite", 1 * cardsMultiplier);
// 2/2
addCard(Zone.BATTLEFIELD, playerB, "Balduvian Bears", 1 * cardsMultiplier);
// 2/2 with ability
addCard(Zone.BATTLEFIELD, playerB, "Ashcoat Bear", 1 * cardsMultiplier);
// 4/3
addCard(Zone.BATTLEFIELD, playerB, "Golden Bear", 1 * cardsMultiplier);
// 4/4 with ability
addCard(Zone.BATTLEFIELD, playerB, "Battering Sliver", 1 * cardsMultiplier);
activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{R}: ");
setStopAt(1, PhaseStep.BEGIN_COMBAT);
execute();
assertAllCommandsUsed();
assertPermanentCount(playerB, "Memnite", 1 * cardsMultiplier);
assertPermanentCount(playerB, "Balduvian Bears", 1 * cardsMultiplier);
assertPermanentCount(playerB, "Ashcoat Bear", 1 * cardsMultiplier);
assertPermanentCount(playerB, "Golden Bear", 1 * cardsMultiplier - 1);
assertPermanentCount(playerB, "Battering Sliver", 1 * cardsMultiplier);
}
use of mage.abilities.effects.common.DamageMultiEffect in project mage by magefree.
the class TargetPriorityTest method test_targetAmount_NormalCase.
@Test
public void test_targetAmount_NormalCase() {
Ability ability = new SimpleActivatedAbility(Zone.ALL, new DamageMultiEffect(3), new ManaCostsImpl("R"));
ability.addTarget(new TargetCreaturePermanentAmount(3));
addCustomCardWithAbility("damage 3", playerA, ability);
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 1);
//
// 1/1
addCard(Zone.BATTLEFIELD, playerB, "Memnite", 3);
// 2/2
addCard(Zone.BATTLEFIELD, playerB, "Balduvian Bears", 3);
// 2/2 with ability
addCard(Zone.BATTLEFIELD, playerB, "Ashcoat Bear", 3);
// 4/3
addCard(Zone.BATTLEFIELD, playerB, "Golden Bear", 3);
// 4/4 with ability
addCard(Zone.BATTLEFIELD, playerB, "Battering Sliver", 3);
activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{R}: ");
setStopAt(1, PhaseStep.BEGIN_COMBAT);
execute();
assertAllCommandsUsed();
assertPermanentCount(playerB, "Memnite", 3);
assertPermanentCount(playerB, "Balduvian Bears", 3);
assertPermanentCount(playerB, "Ashcoat Bear", 3);
assertPermanentCount(playerB, "Golden Bear", 3 - 1);
assertPermanentCount(playerB, "Battering Sliver", 3);
}
Aggregations