Search in sources :

Example 1 with GainAbilitySourceEffect

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

the class FigureOfDestinyWarriorEffect method apply.

@Override
public boolean apply(Game game, Ability source) {
    Permanent permanent = source.getSourcePermanentIfItStillExists(game);
    if (permanent == null || !permanent.hasSubtype(SubType.WARRIOR, game)) {
        return false;
    }
    game.addEffect(new AddCardSubTypeSourceEffect(Duration.Custom, SubType.KITHKIN, SubType.SPIRIT, SubType.WARRIOR, SubType.AVATAR), source);
    game.addEffect(new SetPowerToughnessSourceEffect(8, 8, Duration.Custom, SubLayer.SetPT_7b), source);
    game.addEffect(new GainAbilitySourceEffect(FlyingAbility.getInstance(), Duration.Custom), source);
    game.addEffect(new GainAbilitySourceEffect(FirstStrikeAbility.getInstance(), Duration.Custom), source);
    return true;
}
Also used : SetPowerToughnessSourceEffect(mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect) Permanent(mage.game.permanent.Permanent) GainAbilitySourceEffect(mage.abilities.effects.common.continuous.GainAbilitySourceEffect) AddCardSubTypeSourceEffect(mage.abilities.effects.common.continuous.AddCardSubTypeSourceEffect)

Example 2 with GainAbilitySourceEffect

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

the class WardenOfTheFirstTreeEffect method apply.

@Override
public boolean apply(Game game, Ability source) {
    Permanent permanent = source.getSourcePermanentIfItStillExists(game);
    if (permanent == null || !permanent.hasSubtype(SubType.WARRIOR, game)) {
        return false;
    }
    game.addEffect(new AddCardSubTypeSourceEffect(Duration.Custom, SubType.HUMAN, SubType.SPIRIT, SubType.WARRIOR), source);
    game.addEffect(new GainAbilitySourceEffect(TrampleAbility.getInstance(), Duration.Custom), source);
    game.addEffect(new GainAbilitySourceEffect(LifelinkAbility.getInstance(), Duration.Custom), source);
    return true;
}
Also used : FilterPermanent(mage.filter.FilterPermanent) Permanent(mage.game.permanent.Permanent) GainAbilitySourceEffect(mage.abilities.effects.common.continuous.GainAbilitySourceEffect) AddCardSubTypeSourceEffect(mage.abilities.effects.common.continuous.AddCardSubTypeSourceEffect)

Example 3 with GainAbilitySourceEffect

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

the class MoltenSentryEffect method apply.

@Override
public boolean apply(Game game, Ability source) {
    Player controller = game.getPlayer(source.getControllerId());
    Permanent permanent = game.getPermanentEntering(source.getSourceId());
    if (controller != null && permanent != null) {
        if (controller.flipCoin(source, game, false)) {
            game.informPlayers("Heads: " + permanent.getLogName() + " enters the battlefield as a 5/2 creature with haste");
            permanent.getPower().modifyBaseValue(5);
            permanent.getToughness().modifyBaseValue(2);
            game.addEffect(new GainAbilitySourceEffect(HasteAbility.getInstance(), Duration.WhileOnBattlefield), source);
            return true;
        } else {
            game.informPlayers("Tails: " + permanent.getLogName() + " enters the battlefield as a 2/5 creature with defender");
            permanent.getPower().modifyBaseValue(2);
            permanent.getToughness().modifyBaseValue(5);
            game.addEffect(new GainAbilitySourceEffect(DefenderAbility.getInstance(), Duration.WhileOnBattlefield), source);
            return true;
        }
    }
    return false;
}
Also used : Player(mage.players.Player) Permanent(mage.game.permanent.Permanent) GainAbilitySourceEffect(mage.abilities.effects.common.continuous.GainAbilitySourceEffect)

Example 4 with GainAbilitySourceEffect

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

the class UrzasAvengerEffect method apply.

@Override
public boolean apply(Game game, Ability source) {
    Permanent sourceObject = game.getPermanent(source.getSourceId());
    if (sourceObject != null) {
        sourceObject.addPower(-1);
        sourceObject.addToughness(-1);
        game.addEffect(new GainAbilitySourceEffect(gainedAbility, Duration.EndOfTurn), source);
        return true;
    }
    return false;
}
Also used : Permanent(mage.game.permanent.Permanent) GainAbilitySourceEffect(mage.abilities.effects.common.continuous.GainAbilitySourceEffect)

Example 5 with GainAbilitySourceEffect

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

the class CruelDeceiverEffect method apply.

@Override
public boolean apply(Game game, Ability source) {
    Player controller = game.getPlayer(source.getControllerId());
    MageObject sourceObject = source.getSourceObject(game);
    if (controller != null && sourceObject != null) {
        Cards cards = new CardsImpl();
        Card card = controller.getLibrary().getFromTop(game);
        if (card != null) {
            cards.add(card);
            controller.revealCards(sourceObject.getIdName(), cards, game);
            if (card.isLand(game)) {
                game.addEffect(new GainAbilitySourceEffect(new DealsDamageToACreatureTriggeredAbility(new DestroyTargetEffect(true), false, false, true), Duration.EndOfTurn), source);
            }
        }
        return true;
    }
    return false;
}
Also used : Player(mage.players.Player) DealsDamageToACreatureTriggeredAbility(mage.abilities.common.DealsDamageToACreatureTriggeredAbility) GainAbilitySourceEffect(mage.abilities.effects.common.continuous.GainAbilitySourceEffect) DestroyTargetEffect(mage.abilities.effects.common.DestroyTargetEffect) MageObject(mage.MageObject)

Aggregations

GainAbilitySourceEffect (mage.abilities.effects.common.continuous.GainAbilitySourceEffect)33 Player (mage.players.Player)21 Permanent (mage.game.permanent.Permanent)11 Ability (mage.abilities.Ability)9 MageObject (mage.MageObject)7 SimpleActivatedAbility (mage.abilities.common.SimpleActivatedAbility)6 ChoiceImpl (mage.choices.ChoiceImpl)6 ContinuousEffect (mage.abilities.effects.ContinuousEffect)5 Choice (mage.choices.Choice)5 BoostSourceEffect (mage.abilities.effects.common.continuous.BoostSourceEffect)4 SimpleStaticAbility (mage.abilities.common.SimpleStaticAbility)3 FirstStrikeAbility (mage.abilities.keyword.FirstStrikeAbility)3 FlyingAbility (mage.abilities.keyword.FlyingAbility)3 HasteAbility (mage.abilities.keyword.HasteAbility)3 TrampleAbility (mage.abilities.keyword.TrampleAbility)3 HashSet (java.util.HashSet)2 AddCardSubTypeSourceEffect (mage.abilities.effects.common.continuous.AddCardSubTypeSourceEffect)2 SetPowerToughnessSourceEffect (mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect)2 ProtectionAbility (mage.abilities.keyword.ProtectionAbility)2 FilterCreaturePermanent (mage.filter.common.FilterCreaturePermanent)2