Search in sources :

Example 6 with SimpleActivatedAbility

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;
}
Also used : SimpleActivatedAbility(mage.abilities.common.SimpleActivatedAbility) Ability(mage.abilities.Ability) GenericManaCost(mage.abilities.costs.mana.GenericManaCost) SimpleActivatedAbility(mage.abilities.common.SimpleActivatedAbility)

Example 7 with SimpleActivatedAbility

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;
}
Also used : BeginningOfCombatTriggeredAbility(mage.abilities.common.BeginningOfCombatTriggeredAbility) SimpleActivatedAbility(mage.abilities.common.SimpleActivatedAbility) Ability(mage.abilities.Ability) GenericManaCost(mage.abilities.costs.mana.GenericManaCost) SimpleActivatedAbility(mage.abilities.common.SimpleActivatedAbility) TargetPermanent(mage.target.TargetPermanent)

Example 8 with SimpleActivatedAbility

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;
}
Also used : FixedTarget(mage.target.targetpointer.FixedTarget) SimpleActivatedAbility(mage.abilities.common.SimpleActivatedAbility) SimpleStaticAbility(mage.abilities.common.SimpleStaticAbility) EquipAbility(mage.abilities.keyword.EquipAbility) Ability(mage.abilities.Ability) Permanent(mage.game.permanent.Permanent) SimpleActivatedAbility(mage.abilities.common.SimpleActivatedAbility) DamageTargetEffect(mage.abilities.effects.common.DamageTargetEffect) AddCountersTargetEffect(mage.abilities.effects.common.counter.AddCountersTargetEffect) TapSourceCost(mage.abilities.costs.common.TapSourceCost) TargetAnyTarget(mage.target.common.TargetAnyTarget)

Example 9 with SimpleActivatedAbility

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;
}
Also used : AtTheBeginOfNextEndStepDelayedTriggeredAbility(mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility) ReturnToHandSourceEffect(mage.abilities.effects.common.ReturnToHandSourceEffect) CreateDelayedTriggeredAbilityEffect(mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect) SimpleActivatedAbility(mage.abilities.common.SimpleActivatedAbility) ManaCostsImpl(mage.abilities.costs.mana.ManaCostsImpl)

Example 10 with SimpleActivatedAbility

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;
}
Also used : SimpleActivatedAbility(mage.abilities.common.SimpleActivatedAbility) ColorlessManaAbility(mage.abilities.mana.ColorlessManaAbility) Ability(mage.abilities.Ability) TargetLandPermanent(mage.target.common.TargetLandPermanent) Permanent(mage.game.permanent.Permanent) EmptyCopyApplier(mage.util.functions.EmptyCopyApplier) GenericManaCost(mage.abilities.costs.mana.GenericManaCost) SimpleActivatedAbility(mage.abilities.common.SimpleActivatedAbility) TargetLandPermanent(mage.target.common.TargetLandPermanent) TapSourceCost(mage.abilities.costs.common.TapSourceCost)

Aggregations

SimpleActivatedAbility (mage.abilities.common.SimpleActivatedAbility)30 Ability (mage.abilities.Ability)27 ManaCostsImpl (mage.abilities.costs.mana.ManaCostsImpl)21 SimpleStaticAbility (mage.abilities.common.SimpleStaticAbility)12 Test (org.junit.Test)12 TapSourceCost (mage.abilities.costs.common.TapSourceCost)8 DamageTargetEffect (mage.abilities.effects.common.DamageTargetEffect)8 TargetAnyTarget (mage.target.common.TargetAnyTarget)7 SpellAbility (mage.abilities.SpellAbility)6 Permanent (mage.game.permanent.Permanent)6 SimpleManaAbility (mage.abilities.mana.SimpleManaAbility)5 TargetPermanent (mage.target.TargetPermanent)5 GenericManaCost (mage.abilities.costs.mana.GenericManaCost)4 AddConditionalManaEffect (mage.abilities.effects.mana.AddConditionalManaEffect)4 EntersBattlefieldAbility (mage.abilities.common.EntersBattlefieldAbility)3 EntersBattlefieldTriggeredAbility (mage.abilities.common.EntersBattlefieldTriggeredAbility)3 AddCountersTargetEffect (mage.abilities.effects.common.counter.AddCountersTargetEffect)3 EnchantAbility (mage.abilities.keyword.EnchantAbility)3 Effect (mage.abilities.effects.Effect)2 CounterUnlessPaysEffect (mage.abilities.effects.common.CounterUnlessPaysEffect)2