use of mage.abilities.common.EntersBattlefieldTriggeredAbility in project mage by magefree.
the class GaleaKindlerOfHopeEffect method makeAbility.
private static Ability makeAbility() {
Ability ability = new EntersBattlefieldTriggeredAbility(new AttachEffect(Outcome.BoostCreature, "attach it to target creature you control"), false).setTriggerPhrase("When this Equipment enters the battlefield, ");
ability.addTarget(new TargetControlledCreaturePermanent());
return ability;
}
use of mage.abilities.common.EntersBattlefieldTriggeredAbility 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.common.EntersBattlefieldTriggeredAbility in project mage by magefree.
the class MythosOfIllunaEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Permanent permanent = game.getPermanent(source.getFirstTarget());
if (permanent == null) {
return false;
}
CreateTokenCopyTargetEffect effect = new CreateTokenCopyTargetEffect(source.getControllerId());
if (condition.apply(game, source)) {
Ability ability = new ConditionalInterveningIfTriggeredAbility(new EntersBattlefieldTriggeredAbility(new FightTargetSourceEffect()), MythosOfIllunaCondition.instance, "When this permanent enters the battlefield, " + "if it's a creature, it fights up to one target creature you don't control.");
ability.addTarget(new TargetPermanent(0, 1, StaticFilters.FILTER_CREATURE_YOU_DONT_CONTROL, false));
effect.addAdditionalAbilities(ability);
}
return effect.apply(game, source);
}
use of mage.abilities.common.EntersBattlefieldTriggeredAbility in project mage by magefree.
the class CherishedHatchlingTriggeredAbility method getEffectToAdd.
private static Effect getEffectToAdd() {
Ability abilityToAdd = new EntersBattlefieldTriggeredAbility(new FightTargetSourceEffect().setText("you may have it fight another target creature"), true);
abilityToAdd.addTarget(new TargetCreaturePermanent(filter));
Effect effect = new GainAbilityTargetEffect(abilityToAdd, Duration.EndOfTurn, "it gains \"When this creature enters the battlefield, you may have it fight another target creature.\"", true);
return effect;
}
Aggregations