Search in sources :

Example 1 with BecomesCreatureTargetEffect

use of mage.abilities.effects.common.continuous.BecomesCreatureTargetEffect in project mage by magefree.

the class ElvishBranchbenderToken method apply.

@Override
public boolean apply(Game game, Ability source) {
    int xValue = new PermanentsOnBattlefieldCount(filter).calculate(game, source, this);
    // fix
    ContinuousEffect effect = new BecomesCreatureTargetEffect(new ElvishBranchbenderToken(xValue), false, false, Duration.EndOfTurn);
    effect.setTargetPointer(targetPointer);
    game.addEffect(effect, source);
    return false;
}
Also used : BecomesCreatureTargetEffect(mage.abilities.effects.common.continuous.BecomesCreatureTargetEffect) PermanentsOnBattlefieldCount(mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount) ContinuousEffect(mage.abilities.effects.ContinuousEffect)

Example 2 with BecomesCreatureTargetEffect

use of mage.abilities.effects.common.continuous.BecomesCreatureTargetEffect in project mage by magefree.

the class AwakenElementalToken method apply.

@Override
public boolean apply(Game game, Ability source) {
    UUID targetId = null;
    for (Target target : source.getTargets()) {
        targetId = target.getFirstTarget();
    }
    if (targetId != null) {
        FixedTarget fixedTarget = new FixedTarget(targetId, game);
        ContinuousEffect continuousEffect = new BecomesCreatureTargetEffect(new AwakenElementalToken(), false, true, Duration.EndOfGame);
        continuousEffect.setTargetPointer(fixedTarget);
        game.addEffect(continuousEffect, source);
        Effect effect = new AddCountersTargetEffect(CounterType.P1P1.createInstance(3));
        effect.setTargetPointer(fixedTarget);
        return effect.apply(game, source);
    }
    return true;
}
Also used : FixedTarget(mage.target.targetpointer.FixedTarget) Target(mage.target.Target) FixedTarget(mage.target.targetpointer.FixedTarget) BecomesCreatureTargetEffect(mage.abilities.effects.common.continuous.BecomesCreatureTargetEffect) ContinuousEffect(mage.abilities.effects.ContinuousEffect) AddCountersTargetEffect(mage.abilities.effects.common.counter.AddCountersTargetEffect) OneShotEffect(mage.abilities.effects.OneShotEffect) BecomesCreatureTargetEffect(mage.abilities.effects.common.continuous.BecomesCreatureTargetEffect) Effect(mage.abilities.effects.Effect) ContinuousEffect(mage.abilities.effects.ContinuousEffect) UUID(java.util.UUID) AddCountersTargetEffect(mage.abilities.effects.common.counter.AddCountersTargetEffect)

Example 3 with BecomesCreatureTargetEffect

use of mage.abilities.effects.common.continuous.BecomesCreatureTargetEffect in project mage by magefree.

the class PrimalAdversaryToken method apply.

@Override
public boolean apply(Game game, Ability source) {
    Integer timesPaid = (Integer) getValue("timesPaid");
    if (timesPaid == null || timesPaid <= 0) {
        return false;
    }
    ReflexiveTriggeredAbility ability = new ReflexiveTriggeredAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance(timesPaid)), false, staticText);
    ability.addEffect(new BecomesCreatureTargetEffect(new PrimalAdversaryToken(), false, true, Duration.Custom));
    ability.addTarget(new TargetPermanent(0, timesPaid, StaticFilters.FILTER_CONTROLLED_PERMANENT_LANDS));
    game.fireReflexiveTriggeredAbility(ability, source);
    return true;
}
Also used : AddCountersSourceEffect(mage.abilities.effects.common.counter.AddCountersSourceEffect) ReflexiveTriggeredAbility(mage.abilities.common.delayed.ReflexiveTriggeredAbility) BecomesCreatureTargetEffect(mage.abilities.effects.common.continuous.BecomesCreatureTargetEffect) TargetPermanent(mage.target.TargetPermanent)

Example 4 with BecomesCreatureTargetEffect

use of mage.abilities.effects.common.continuous.BecomesCreatureTargetEffect in project mage by magefree.

the class EmergentSequenceWatcher method apply.

@Override
public boolean apply(Game game, Ability source) {
    Player player = game.getPlayer(source.getControllerId());
    if (player == null) {
        return false;
    }
    // put land
    TargetCardInLibrary target = new TargetCardInLibrary(StaticFilters.FILTER_CARD_BASIC_LAND_A);
    player.searchLibrary(target, source, game);
    Card card = player.getLibrary().getCard(target.getFirstTarget(), game);
    Permanent permanent = null;
    if (card != null) {
        player.moveCards(card, Zone.BATTLEFIELD, source, game, true, false, false, null);
        permanent = game.getPermanent(target.getFirstTarget());
    }
    player.shuffleLibrary(source, game);
    if (permanent == null) {
        return true;
    }
    // boost land
    game.addEffect(new BecomesCreatureTargetEffect(new FractalToken(), false, true, Duration.Custom).setTargetPointer(new FixedTarget(permanent, game)), source);
    // rules
    // The last sentence of Emergent Sequence’s ability counts the land it put onto the battlefield.
    // (2021-04-16)
    // no ETB yet, so add +1 manually
    int amount = 1 + EmergentSequenceWatcher.getAmount(source.getControllerId(), game);
    permanent.addCounters(CounterType.P1P1.createInstance(amount), source.getControllerId(), source, game);
    return true;
}
Also used : FixedTarget(mage.target.targetpointer.FixedTarget) FractalToken(mage.game.permanent.token.FractalToken) Player(mage.players.Player) Permanent(mage.game.permanent.Permanent) BecomesCreatureTargetEffect(mage.abilities.effects.common.continuous.BecomesCreatureTargetEffect) TargetCardInLibrary(mage.target.common.TargetCardInLibrary) Hint(mage.abilities.hint.Hint) Card(mage.cards.Card)

Example 5 with BecomesCreatureTargetEffect

use of mage.abilities.effects.common.continuous.BecomesCreatureTargetEffect in project mage by magefree.

the class DestinySpinnerEffect method apply.

@Override
public boolean apply(Game game, Ability source) {
    int pt = DestinySpinnerCount.instance.calculate(game, source, this);
    game.addEffect(new BecomesCreatureTargetEffect(new CreatureToken(pt, pt, "").withSubType(SubType.ELEMENTAL).withAbility(TrampleAbility.getInstance()).withAbility(HasteAbility.getInstance()), false, true, Duration.EndOfTurn), source);
    return true;
}
Also used : BecomesCreatureTargetEffect(mage.abilities.effects.common.continuous.BecomesCreatureTargetEffect) ValueHint(mage.abilities.hint.ValueHint) CreatureToken(mage.game.permanent.token.custom.CreatureToken)

Aggregations

BecomesCreatureTargetEffect (mage.abilities.effects.common.continuous.BecomesCreatureTargetEffect)12 ContinuousEffect (mage.abilities.effects.ContinuousEffect)5 Permanent (mage.game.permanent.Permanent)4 Player (mage.players.Player)4 FixedTarget (mage.target.targetpointer.FixedTarget)4 CreatureToken (mage.game.permanent.token.custom.CreatureToken)3 TargetPermanent (mage.target.TargetPermanent)3 UUID (java.util.UUID)2 PermanentsOnBattlefieldCount (mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount)2 Effect (mage.abilities.effects.Effect)2 OneShotEffect (mage.abilities.effects.OneShotEffect)2 Card (mage.cards.Card)2 TargetCardInLibrary (mage.target.common.TargetCardInLibrary)2 ReflexiveTriggeredAbility (mage.abilities.common.delayed.ReflexiveTriggeredAbility)1 ConditionalOneShotEffect (mage.abilities.decorator.ConditionalOneShotEffect)1 UntapTargetEffect (mage.abilities.effects.common.UntapTargetEffect)1 AddCountersSourceEffect (mage.abilities.effects.common.counter.AddCountersSourceEffect)1 AddCountersTargetEffect (mage.abilities.effects.common.counter.AddCountersTargetEffect)1 SearchLibraryPutInPlayEffect (mage.abilities.effects.common.search.SearchLibraryPutInPlayEffect)1 Hint (mage.abilities.hint.Hint)1