Search in sources :

Example 1 with MustBeBlockedByAtLeastOneTargetEffect

use of mage.abilities.effects.common.combat.MustBeBlockedByAtLeastOneTargetEffect in project mage by magefree.

the class JoragaInvocationEffect method apply.

@Override
public boolean apply(Game game, Ability source) {
    Player controller = game.getPlayer(source.getControllerId());
    if (controller != null) {
        for (Permanent permanent : game.getBattlefield().getAllActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, game)) {
            ContinuousEffect effect = new MustBeBlockedByAtLeastOneTargetEffect();
            effect.setTargetPointer(new FixedTarget(permanent, game));
            game.addEffect(effect, source);
        }
        return true;
    }
    return false;
}
Also used : FixedTarget(mage.target.targetpointer.FixedTarget) Player(mage.players.Player) Permanent(mage.game.permanent.Permanent) ContinuousEffect(mage.abilities.effects.ContinuousEffect) MustBeBlockedByAtLeastOneTargetEffect(mage.abilities.effects.common.combat.MustBeBlockedByAtLeastOneTargetEffect)

Example 2 with MustBeBlockedByAtLeastOneTargetEffect

use of mage.abilities.effects.common.combat.MustBeBlockedByAtLeastOneTargetEffect in project mage by magefree.

the class NeyithOfTheDireHuntEffect method apply.

@Override
public boolean apply(Game game, Ability source) {
    Permanent permanent = game.getPermanent(source.getFirstTarget());
    if (permanent == null) {
        return false;
    }
    int power = permanent.getPower().getValue();
    game.addEffect(new BoostTargetEffect(power, 0, Duration.EndOfTurn), source);
    game.addEffect(new MustBeBlockedByAtLeastOneTargetEffect(Duration.EndOfCombat), source);
    return true;
}
Also used : Permanent(mage.game.permanent.Permanent) TargetCreaturePermanent(mage.target.common.TargetCreaturePermanent) BoostTargetEffect(mage.abilities.effects.common.continuous.BoostTargetEffect) MustBeBlockedByAtLeastOneTargetEffect(mage.abilities.effects.common.combat.MustBeBlockedByAtLeastOneTargetEffect)

Aggregations

MustBeBlockedByAtLeastOneTargetEffect (mage.abilities.effects.common.combat.MustBeBlockedByAtLeastOneTargetEffect)2 Permanent (mage.game.permanent.Permanent)2 ContinuousEffect (mage.abilities.effects.ContinuousEffect)1 BoostTargetEffect (mage.abilities.effects.common.continuous.BoostTargetEffect)1 Player (mage.players.Player)1 TargetCreaturePermanent (mage.target.common.TargetCreaturePermanent)1 FixedTarget (mage.target.targetpointer.FixedTarget)1