Search in sources :

Example 6 with TapSourceCost

use of mage.abilities.costs.common.TapSourceCost in project mage by magefree.

the class RakdosRiteknifeEffect method makeAbility.

private static Ability makeAbility(Permanent permanent, Game game) {
    Ability ability = new SimpleActivatedAbility(new AddCountersTargetEffect(CounterType.BLOOD.createInstance()).setText("put a blood counter on " + permanent.getName()).setTargetPointer(new FixedTarget(permanent, game)), new TapSourceCost());
    ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT)));
    return ability;
}
Also used : SimpleStaticAbility(mage.abilities.common.SimpleStaticAbility) EquipAbility(mage.abilities.keyword.EquipAbility) SimpleActivatedAbility(mage.abilities.common.SimpleActivatedAbility) Ability(mage.abilities.Ability) FixedTarget(mage.target.targetpointer.FixedTarget) SacrificeTargetCost(mage.abilities.costs.common.SacrificeTargetCost) SimpleActivatedAbility(mage.abilities.common.SimpleActivatedAbility) AddCountersTargetEffect(mage.abilities.effects.common.counter.AddCountersTargetEffect) TapSourceCost(mage.abilities.costs.common.TapSourceCost) TargetControlledCreaturePermanent(mage.target.common.TargetControlledCreaturePermanent)

Example 7 with TapSourceCost

use of mage.abilities.costs.common.TapSourceCost in project mage by magefree.

the class KothOfTheHammerThirdEffect method apply.

@Override
public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) {
    switch(layer) {
        case AbilityAddingRemovingEffects_6:
            if (sublayer == SubLayer.NA) {
                for (Permanent permanent : game.getBattlefield().getActivePermanents(mountains, source.getControllerId(), source.getSourceId(), game)) {
                    Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(1), new TapSourceCost());
                    ability.addTarget(new TargetAnyTarget());
                    permanent.addAbility(ability, source.getSourceId(), game);
                }
            }
            break;
    }
    return true;
}
Also used : SimpleActivatedAbility(mage.abilities.common.SimpleActivatedAbility) SimpleStaticAbility(mage.abilities.common.SimpleStaticAbility) Ability(mage.abilities.Ability) FilterLandPermanent(mage.filter.common.FilterLandPermanent) Permanent(mage.game.permanent.Permanent) SimpleActivatedAbility(mage.abilities.common.SimpleActivatedAbility) DamageTargetEffect(mage.abilities.effects.common.DamageTargetEffect) TapSourceCost(mage.abilities.costs.common.TapSourceCost) TargetAnyTarget(mage.target.common.TargetAnyTarget)

Example 8 with TapSourceCost

use of mage.abilities.costs.common.TapSourceCost in project mage by magefree.

the class ArcheryTrainingValue method apply.

@Override
public boolean apply(Game game, Ability source) {
    Permanent aura = game.getPermanent(source.getSourceId());
    if (aura == null) {
        return false;
    }
    Permanent permanent = game.getPermanent(aura.getAttachedTo());
    if (permanent == null) {
        return false;
    }
    String rule = "this creature deals X damage to target attacking or blocking creature, " + "where X is the number of arrow counters on " + aura.getName();
    Ability ability = new SimpleActivatedAbility(new DamageTargetEffect(new ArcheryTrainingValue(aura)).setText(rule), new TapSourceCost());
    ability.addTarget(new TargetAttackingOrBlockingCreature());
    permanent.addAbility(ability, source.getSourceId(), game);
    return true;
}
Also used : SimpleActivatedAbility(mage.abilities.common.SimpleActivatedAbility) SimpleStaticAbility(mage.abilities.common.SimpleStaticAbility) EnchantAbility(mage.abilities.keyword.EnchantAbility) BeginningOfUpkeepTriggeredAbility(mage.abilities.common.BeginningOfUpkeepTriggeredAbility) Ability(mage.abilities.Ability) Permanent(mage.game.permanent.Permanent) TargetCreaturePermanent(mage.target.common.TargetCreaturePermanent) TargetPermanent(mage.target.TargetPermanent) SimpleActivatedAbility(mage.abilities.common.SimpleActivatedAbility) DamageTargetEffect(mage.abilities.effects.common.DamageTargetEffect) TapSourceCost(mage.abilities.costs.common.TapSourceCost) TargetAttackingOrBlockingCreature(mage.target.common.TargetAttackingOrBlockingCreature)

Aggregations

Ability (mage.abilities.Ability)8 SimpleActivatedAbility (mage.abilities.common.SimpleActivatedAbility)8 TapSourceCost (mage.abilities.costs.common.TapSourceCost)8 SimpleStaticAbility (mage.abilities.common.SimpleStaticAbility)6 Permanent (mage.game.permanent.Permanent)5 DamageTargetEffect (mage.abilities.effects.common.DamageTargetEffect)3 EnchantAbility (mage.abilities.keyword.EnchantAbility)3 TargetCreaturePermanent (mage.target.common.TargetCreaturePermanent)3 EntersBattlefieldAbility (mage.abilities.common.EntersBattlefieldAbility)2 GenericManaCost (mage.abilities.costs.mana.GenericManaCost)2 AddCountersTargetEffect (mage.abilities.effects.common.counter.AddCountersTargetEffect)2 EquipAbility (mage.abilities.keyword.EquipAbility)2 TargetPermanent (mage.target.TargetPermanent)2 TargetAnyTarget (mage.target.common.TargetAnyTarget)2 FixedTarget (mage.target.targetpointer.FixedTarget)2 SpellAbility (mage.abilities.SpellAbility)1 BeginningOfUpkeepTriggeredAbility (mage.abilities.common.BeginningOfUpkeepTriggeredAbility)1 DiesSourceTriggeredAbility (mage.abilities.common.DiesSourceTriggeredAbility)1 Cost (mage.abilities.costs.Cost)1 SacrificeSourceCost (mage.abilities.costs.common.SacrificeSourceCost)1