use of mage.abilities.common.SimpleActivatedAbility in project mage by magefree.
the class StoryweaveWatcher method makeAbility.
public static Ability makeAbility() {
// for testing purposes
Ability ability = new SimpleActivatedAbility(new StoryweaveReplacementEffect(), new GenericManaCost(0));
ability.addWatcher(new StoryweaveWatcher());
return ability;
}
use of mage.abilities.common.SimpleActivatedAbility in project mage by magefree.
the class VolrathTheShapestealerCopyApplier method apply.
@Override
public boolean apply(Game game, MageObject blueprint, Ability source, UUID copyToObjectId) {
Ability ability = new SimpleActivatedAbility(new VolrathTheShapestealerEffect(), new GenericManaCost(1));
ability.addTarget(new TargetPermanent(VolrathTheShapestealer.filter));
blueprint.getAbilities().add(ability);
blueprint.removePTCDA();
blueprint.getPower().modifyBaseValue(7);
blueprint.getToughness().modifyBaseValue(5);
return true;
}
use of mage.abilities.common.SimpleActivatedAbility 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.common.SimpleActivatedAbility in project mage by magefree.
the class SakashimaTheImpostorCopyApplier method apply.
@Override
public boolean apply(Game game, MageObject blueprint, Ability source, UUID copyToObjectId) {
blueprint.addSuperType(SuperType.LEGENDARY);
blueprint.setName("Sakashima the Impostor");
// {2}{U}{U}: Return Sakashima the Impostor to its owner's hand at the beginning of the next end step
blueprint.getAbilities().add(new SimpleActivatedAbility(Zone.BATTLEFIELD, new CreateDelayedTriggeredAbilityEffect(new AtTheBeginOfNextEndStepDelayedTriggeredAbility(new ReturnToHandSourceEffect(true)), false), new ManaCostsImpl("{2}{U}{U}")));
return true;
}
use of mage.abilities.common.SimpleActivatedAbility 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;
}
Aggregations