use of mage.abilities.common.SimpleActivatedAbility in project mage by magefree.
the class CustomTestCard method addCustomEffect_TargetDamage.
/**
* Add target damage ability that can be called by text: "target damage xxx"
*
* @param controller
* @param damageAmount
*/
protected void addCustomEffect_TargetDamage(TestPlayer controller, int damageAmount) {
Ability ability = new SimpleActivatedAbility(new DamageTargetEffect(damageAmount).setText("target damage " + damageAmount), new ManaCostsImpl(""));
ability.addTarget(new TargetAnyTarget());
addCustomCardWithAbility("target damage " + damageAmount + " for " + controller.getName(), controller, ability);
}
use of mage.abilities.common.SimpleActivatedAbility in project mage by magefree.
the class OldGrowthTrollContinuousEffect method makeAbility.
private static final Ability makeAbility() {
Ability activatedAbility = new SimpleActivatedAbility(new CreateTokenEffect(new TrollWarriorToken(), 1, true, false), new GenericManaCost(1));
activatedAbility.addCost(new TapSourceCost());
Cost cost = new SacrificeSourceCost();
cost.setText("sacrifice this land");
activatedAbility.addCost(cost);
Ability ability = new SimpleStaticAbility(new GainAbilityAttachedEffect(new SimpleManaAbility(Zone.BATTLEFIELD, Mana.GreenMana(2), new TapSourceCost()), AttachmentType.AURA).setText("enchanted Forest has \"{T}: Add {G}{G}\""));
ability.addEffect(new GainAbilityAttachedEffect(activatedAbility, AttachmentType.AURA).setText("and \"{1}, {T}, Sacrifice this land: Create a tapped 4/4 green Troll Warrior creature token with trample.\""));
return ability;
}
use of mage.abilities.common.SimpleActivatedAbility in project mage by magefree.
the class RakdosRiteknifeEffect method makeAbility.
private static Ability makeAbility(Permanent permanent, Game game) {
Ability ability = new SimpleActivatedAbility(new AddCountersTargetEffect(CounterType.BLOOD.createInstance()).setText("put a blood counter on " + permanent.getName()).setTargetPointer(new FixedTarget(permanent, game)), new TapSourceCost());
ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT)));
return ability;
}
use of mage.abilities.common.SimpleActivatedAbility 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.common.SimpleActivatedAbility 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