Search in sources :

Example 6 with PutCardFromHandOntoBattlefieldEffect

use of mage.abilities.effects.common.PutCardFromHandOntoBattlefieldEffect in project mage by magefree.

the class HuntedWumpusEffect method apply.

@Override
public boolean apply(Game game, Ability source) {
    Player controller = game.getPlayer(source.getControllerId());
    if (controller != null) {
        for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) {
            if (!playerId.equals(controller.getId())) {
                Effect effect = new PutCardFromHandOntoBattlefieldEffect(StaticFilters.FILTER_CARD_CREATURE_A, true);
                effect.setTargetPointer(new FixedTarget(playerId));
                effect.apply(game, source);
            }
        }
        return true;
    }
    return false;
}
Also used : FixedTarget(mage.target.targetpointer.FixedTarget) Player(mage.players.Player) OneShotEffect(mage.abilities.effects.OneShotEffect) Effect(mage.abilities.effects.Effect) PutCardFromHandOntoBattlefieldEffect(mage.abilities.effects.common.PutCardFromHandOntoBattlefieldEffect) PutCardFromHandOntoBattlefieldEffect(mage.abilities.effects.common.PutCardFromHandOntoBattlefieldEffect) UUID(java.util.UUID)

Example 7 with PutCardFromHandOntoBattlefieldEffect

use of mage.abilities.effects.common.PutCardFromHandOntoBattlefieldEffect in project mage by magefree.

the class CovertTechnicianEffect method apply.

@Override
public boolean apply(Game game, Ability source) {
    int damage = (Integer) getValue("damage");
    FilterCard filter = new FilterArtifactCard("artifact card with mana value " + damage + " or less");
    filter.add(new ManaValuePredicate(ComparisonType.FEWER_THAN, damage + 1));
    return new PutCardFromHandOntoBattlefieldEffect(filter).apply(game, source);
}
Also used : FilterCard(mage.filter.FilterCard) ManaValuePredicate(mage.filter.predicate.mageobject.ManaValuePredicate) FilterArtifactCard(mage.filter.common.FilterArtifactCard) PutCardFromHandOntoBattlefieldEffect(mage.abilities.effects.common.PutCardFromHandOntoBattlefieldEffect)

Aggregations

PutCardFromHandOntoBattlefieldEffect (mage.abilities.effects.common.PutCardFromHandOntoBattlefieldEffect)7 UUID (java.util.UUID)3 OneShotEffect (mage.abilities.effects.OneShotEffect)3 FilterCreatureCard (mage.filter.common.FilterCreatureCard)3 Permanent (mage.game.permanent.Permanent)3 Player (mage.players.Player)3 Effect (mage.abilities.effects.Effect)2 FilterCard (mage.filter.FilterCard)2 ManaValuePredicate (mage.filter.predicate.mageobject.ManaValuePredicate)2 FixedTarget (mage.target.targetpointer.FixedTarget)2 List (java.util.List)1 Ability (mage.abilities.Ability)1 Cost (mage.abilities.costs.Cost)1 DrawCardSourceControllerEffect (mage.abilities.effects.common.DrawCardSourceControllerEffect)1 ReturnToHandSourceEffect (mage.abilities.effects.common.ReturnToHandSourceEffect)1 ReturnToHandTargetEffect (mage.abilities.effects.common.ReturnToHandTargetEffect)1 MorphAbility (mage.abilities.keyword.MorphAbility)1 CardImpl (mage.cards.CardImpl)1 CardSetInfo (mage.cards.CardSetInfo)1 Cards (mage.cards.Cards)1