use of mage.abilities.effects.common.DamageTargetEffect in project mage by magefree.
the class GuileSonicSoldierEffect method makeAbility.
private static final ReflexiveTriggeredAbility makeAbility() {
ReflexiveTriggeredAbility ability = new ReflexiveTriggeredAbility(new DamageTargetEffect(4), false);
ability.addTarget(new TargetAnyTarget());
Mode mode = new Mode(new GainAbilitySourceEffect(LifelinkAbility.getInstance(), Duration.EndOfTurn).setText("{this} gains lifelink"));
mode.addEffect(new GainAbilitySourceEffect(IndestructibleAbility.getInstance(), Duration.EndOfTurn).setText("and indestructible until end of turn"));
ability.withFirstModeFlavorWord("Sonic Boom").addMode(mode.withFlavorWord("Flash Kick"));
return ability;
}
use of mage.abilities.effects.common.DamageTargetEffect in project mage by magefree.
the class HidetsuguDevouringChaosEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
if (player == null) {
return false;
}
Card card = player.getLibrary().getFromTop(game);
if (card == null) {
return false;
}
PlayFromNotOwnHandZoneTargetEffect.exileAndPlayFromExile(game, source, card, TargetController.YOU, Duration.EndOfTurn, false, false, false);
if (card.isLand(game)) {
return true;
}
ReflexiveTriggeredAbility ability = new ReflexiveTriggeredAbility(new DamageTargetEffect(card.getManaValue()), false);
ability.addTarget(new TargetAnyTarget());
game.fireReflexiveTriggeredAbility(ability, source);
return true;
}
use of mage.abilities.effects.common.DamageTargetEffect in project mage by magefree.
the class QuestingBeastTriggeredAbility method checkTrigger.
@Override
public boolean checkTrigger(GameEvent event, Game game) {
Player opponent = game.getPlayer(event.getPlayerId());
if (opponent == null || !event.getSourceId().equals(this.getSourceId()) || !opponent.hasOpponent(this.getControllerId(), game) || !((DamagedEvent) event).isCombatDamage()) {
return false;
}
this.getEffects().clear();
this.addEffect(new DamageTargetEffect(event.getAmount()));
FilterPermanent filter = new FilterPlaneswalkerPermanent("planeswalker " + opponent.getLogName() + " controls");
filter.add(new ControllerIdPredicate(opponent.getId()));
this.getTargets().clear();
this.addTarget(new TargetPermanent(filter));
return true;
}
use of mage.abilities.effects.common.DamageTargetEffect in project mage by magefree.
the class RoarOfTheCrowdEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
if (player != null) {
Choice typeChoice = new ChoiceCreatureType(game.getObject(source.getSourceId()));
if (!player.choose(Outcome.LoseLife, typeChoice, game)) {
return false;
}
FilterControlledPermanent filter = new FilterControlledPermanent();
filter.add(SubType.byDescription(typeChoice.getChoice()).getPredicate());
return new DamageTargetEffect(new PermanentsOnBattlefieldCount(filter)).apply(game, source);
}
return false;
}
use of mage.abilities.effects.common.DamageTargetEffect in project mage by magefree.
the class WeightOfSpiresEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Permanent creature = game.getPermanent(source.getFirstTarget());
if (creature == null) {
return false;
}
Player player = game.getPlayer(creature.getControllerId());
if (player == null) {
return false;
}
int damage = game.getBattlefield().getAllActivePermanents(StaticFilters.FILTER_LANDS_NONBASIC, player.getId(), game).size();
return new DamageTargetEffect(damage).apply(game, source);
}
Aggregations