use of mage.abilities.effects.common.DamageTargetEffect in project mage by magefree.
the class MountVelusManticoreEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
if (player == null) {
return false;
}
Card card = player.discard(0, 1, false, source, game).getRandom(game);
if (card == null) {
return false;
}
ReflexiveTriggeredAbility ability = new ReflexiveTriggeredAbility(new DamageTargetEffect(card.getCardType(game).size()), false, "{this} deals X damage " + "to any target, where X is the number of card types the discarded card has");
ability.addTarget(new TargetAnyTarget());
game.fireReflexiveTriggeredAbility(ability, source);
return true;
}
use of mage.abilities.effects.common.DamageTargetEffect in project mage by magefree.
the class StompingSlabsEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
Cards cards = new CardsImpl(controller.getLibrary().getTopCards(game, 7));
if (!cards.isEmpty()) {
controller.revealCards("Stomping Slabs", cards, game);
boolean stompingSlabsFound = false;
for (UUID cardId : cards) {
Card card = game.getCard(cardId);
if (card != null && card.getName().equals("Stomping Slabs")) {
stompingSlabsFound = true;
break;
}
}
controller.putCardsOnBottomOfLibrary(cards, game, source, true);
if (stompingSlabsFound) {
Effect effect = new DamageTargetEffect(7);
effect.setTargetPointer(new FixedTarget(this.getTargetPointer().getFirst(game, source)));
effect.apply(game, source);
}
}
return true;
}
return false;
}
use of mage.abilities.effects.common.DamageTargetEffect in project mage by magefree.
the class TheRoyalScionsCreateReflexiveTriggerEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
effect.apply(game, source);
ReflexiveTriggeredAbility ability = new ReflexiveTriggeredAbility(new DamageTargetEffect(CardsInControllerHandCount.instance), false, "{this} deals damage to any target equal to the number of cards in your hand");
ability.addTarget(new TargetAnyTarget());
game.fireReflexiveTriggeredAbility(ability, source);
return true;
}
use of mage.abilities.effects.common.DamageTargetEffect in project mage by magefree.
the class OutcomesTest method test_FromEffects_Single.
/**
* Normal outcome from effects
*/
@Test
public void test_FromEffects_Single() {
Ability abilityGood = new SimpleStaticAbility(new GainLifeEffect(10));
Assert.assertEquals(1, abilityGood.getEffects().getOutcomeScore(abilityGood));
Ability abilityBad = new SimpleStaticAbility(new DamageTargetEffect(10));
Assert.assertEquals(-1, abilityBad.getEffects().getOutcomeScore(abilityBad));
}
use of mage.abilities.effects.common.DamageTargetEffect in project mage by magefree.
the class KothOfTheHammerThirdEffect method apply.
@Override
public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) {
switch(layer) {
case AbilityAddingRemovingEffects_6:
if (sublayer == SubLayer.NA) {
for (Permanent permanent : game.getBattlefield().getActivePermanents(mountains, source.getControllerId(), source.getSourceId(), game)) {
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(1), new TapSourceCost());
ability.addTarget(new TargetAnyTarget());
permanent.addAbility(ability, source.getSourceId(), game);
}
}
break;
}
return true;
}
Aggregations