use of mage.abilities.common.delayed.ReflexiveTriggeredAbility in project mage by magefree.
the class TigerTribeHunterEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
if (player == null) {
return false;
}
TargetPermanent target = new TargetPermanent(0, 1, StaticFilters.FILTER_CONTROLLED_ANOTHER_CREATURE, true);
player.choose(outcome, target, source.getSourceId(), game);
Permanent permanent = game.getPermanent(target.getFirstTarget());
if (permanent == null) {
return false;
}
int power = Math.max(permanent.getPower().getValue(), 0);
if (!permanent.sacrifice(source, game)) {
return false;
}
ReflexiveTriggeredAbility ability = new ReflexiveTriggeredAbility(new DamageTargetEffect(power), false, "{this} deals damage equal to the sacrificed creature's power to target creature.");
ability.addTarget(new TargetCreaturePermanent());
game.fireReflexiveTriggeredAbility(ability, source);
return true;
}
use of mage.abilities.common.delayed.ReflexiveTriggeredAbility in project mage by magefree.
the class EdgarsAwakeningTriggeredAbility method makeAbility.
private static final ReflexiveTriggeredAbility makeAbility() {
ReflexiveTriggeredAbility ability = new ReflexiveTriggeredAbility(new ReturnFromGraveyardToHandTargetEffect(), false, "return target creature card from your graveyard to your hand");
ability.addTarget(new TargetCardInYourGraveyard(StaticFilters.FILTER_CARD_CREATURE_YOUR_GRAVEYARD));
return ability;
}
use of mage.abilities.common.delayed.ReflexiveTriggeredAbility in project mage by magefree.
the class ExplosionOfRichesEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
for (UUID playerId : game.getState().getPlayersInRange(source.getControllerId(), game)) {
Player player = game.getPlayer(playerId);
if (player == null) {
continue;
}
if (!playerId.equals(source.getControllerId()) && !player.chooseUse(outcome, "Draw a card?", source, game)) {
continue;
}
if (player.drawCards(1, source, game) >= 1) {
continue;
}
ReflexiveTriggeredAbility ability = new ReflexiveTriggeredAbility(new DamageTargetEffect(5), false, "{this} deals damage to target opponent chosen at random");
Target target = new TargetOpponent();
target.setRandom(true);
ability.addTarget(target);
game.fireReflexiveTriggeredAbility(ability, source);
}
return true;
}
use of mage.abilities.common.delayed.ReflexiveTriggeredAbility 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.common.delayed.ReflexiveTriggeredAbility 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;
}
Aggregations