use of mage.abilities.Ability in project mage by magefree.
the class EvilTwinPredicate method apply.
@Override
public boolean apply(Game game, MageObject blueprint, Ability source, UUID copyToObjectId) {
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DestroyTargetEffect(), new ManaCostsImpl("{U}{B}"));
ability.addCost(new TapSourceCost());
ability.addTarget(new TargetCreaturePermanent(filter));
blueprint.getAbilities().add(ability);
return true;
}
use of mage.abilities.Ability 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.Ability in project mage by magefree.
the class HonorTheFallenEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
if (controller == null) {
return false;
}
Cards cards = new CardsImpl();
for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) {
Player player = game.getPlayer(playerId);
if (player == null) {
continue;
}
cards.addAll(player.getGraveyard().getCards(StaticFilters.FILTER_CARD_CREATURE, game));
}
controller.moveCards(cards, Zone.EXILED, source, game);
int count = cards.stream().map(game.getState()::getZone).map(Zone.EXILED::equals).mapToInt(x -> x ? 1 : 0).sum();
controller.gainLife(count, game, source);
return true;
}
use of mage.abilities.Ability in project mage by magefree.
the class NarsetTranscendentGainReboundEffect method addReboundAbility.
private void addReboundAbility(Card card, Game game) {
boolean found = false;
for (Ability ability : card.getAbilities(game)) {
if (ability instanceof ReboundAbility) {
found = true;
break;
}
}
if (!found) {
Ability ability = new ReboundAbility();
game.getState().addOtherAbility(card, ability);
}
}
use of mage.abilities.Ability in project mage by magefree.
the class ProteanThaumaturgeCopyApplier method createAbility.
static Ability createAbility() {
Ability ability = new ConstellationAbility(new CopyPermanentEffect(StaticFilters.FILTER_PERMANENT_CREATURE, new ProteanThaumaturgeCopyApplier(), true).setText("{this} become a copy of another target creature, except it has this ability"), true, false);
ability.addTarget(new TargetPermanent(filter));
return ability;
}
Aggregations