use of mage.abilities.costs.common.TapSourceCost in project mage by magefree.
the class HeliodsPunishmentEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Permanent sourceEnchantment = game.getPermanentOrLKIBattlefield(source.getSourceId());
if (sourceEnchantment != null && sourceEnchantment.getAttachedTo() != null) {
Permanent attachedTo = game.getPermanent(sourceEnchantment.getAttachedTo());
if (attachedTo != null) {
attachedTo.removeAllAbilities(source.getSourceId(), game);
HeliodsPunishmentEffect effect = new HeliodsPunishmentEffect(sourceEnchantment.getName());
Ability ability = new SimpleActivatedAbility(effect, new TapSourceCost());
effect.setSourceEnchantment(sourceEnchantment.getId());
attachedTo.addAbility(ability, source.getSourceId(), game);
}
}
return true;
}
use of mage.abilities.costs.common.TapSourceCost 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.costs.common.TapSourceCost in project mage by magefree.
the class HankyuCost method apply.
@Override
public boolean apply(Game game, Ability source) {
Permanent permanent = source.getSourcePermanentIfItStillExists(game);
if (permanent == null) {
return false;
}
Permanent creature = game.getPermanent(permanent.getAttachedTo());
if (creature == null) {
return false;
}
creature.addAbility(new SimpleActivatedAbility(new AddCountersTargetEffect(CounterType.AIM.createInstance()).setTargetPointer(new FixedTarget(permanent, game)).setText("put an aim counter on " + permanent.getName()), new TapSourceCost()), source.getSourceId(), game);
Ability ability = new SimpleActivatedAbility(new DamageTargetEffect(HankyuValue.instance).setText("this creature deals damage to any target equal " + "to the number of aim counters removed this way"), new TapSourceCost());
ability.addCost(new HankyuCost().setMageObjectReference(source, game));
ability.addTarget(new TargetAnyTarget());
creature.addAbility(ability, source.getSourceId(), game);
return true;
}
use of mage.abilities.costs.common.TapSourceCost in project mage by magefree.
the class ThespiansStageCopyEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Permanent sourcePermanent = game.getPermanent(source.getSourceId());
Permanent copyFromPermanent = game.getPermanent(getTargetPointer().getFirst(game, source));
if (sourcePermanent != null && copyFromPermanent != null) {
Permanent newPermanent = game.copyPermanent(copyFromPermanent, sourcePermanent.getId(), source, new EmptyCopyApplier());
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ThespiansStageCopyEffect(), new GenericManaCost(2));
ability.addCost(new TapSourceCost());
ability.addTarget(new TargetLandPermanent());
newPermanent.addAbility(ability, source.getSourceId(), game);
return true;
}
return false;
}
use of mage.abilities.costs.common.TapSourceCost in project mage by magefree.
the class OldGrowthTrollContinuousEffect method makeAbility.
private static final Ability makeAbility() {
Ability activatedAbility = new SimpleActivatedAbility(new CreateTokenEffect(new TrollWarriorToken(), 1, true, false), new GenericManaCost(1));
activatedAbility.addCost(new TapSourceCost());
Cost cost = new SacrificeSourceCost();
cost.setText("sacrifice this land");
activatedAbility.addCost(cost);
Ability ability = new SimpleStaticAbility(new GainAbilityAttachedEffect(new SimpleManaAbility(Zone.BATTLEFIELD, Mana.GreenMana(2), new TapSourceCost()), AttachmentType.AURA).setText("enchanted Forest has \"{T}: Add {G}{G}\""));
ability.addEffect(new GainAbilityAttachedEffect(activatedAbility, AttachmentType.AURA).setText("and \"{1}, {T}, Sacrifice this land: Create a tapped 4/4 green Troll Warrior creature token with trample.\""));
return ability;
}
Aggregations