Search in sources :

Example 1 with PlainswalkAbility

use of mage.abilities.keyword.PlainswalkAbility in project mage by magefree.

the class IllusionaryPresenceEffect method apply.

@Override
public boolean apply(Game game, Ability source) {
    MageObject mageObject = game.getObject(source.getSourceId());
    if (mageObject != null) {
        SubType landTypeChoice = SubType.byDescription((String) game.getState().getValue(mageObject.getId().toString() + "BasicLandType"));
        if (landTypeChoice != null) {
            switch(landTypeChoice) {
                case PLAINS:
                    gainedAbility = new PlainswalkAbility();
                    break;
                case FOREST:
                    gainedAbility = new ForestwalkAbility();
                    break;
                case SWAMP:
                    gainedAbility = new SwampwalkAbility();
                    break;
                case ISLAND:
                    gainedAbility = new IslandwalkAbility();
                    break;
                case MOUNTAIN:
                    gainedAbility = new MountainwalkAbility();
                    break;
            }
            if (gainedAbility != null) {
                GainAbilitySourceEffect effect = new GainAbilitySourceEffect(gainedAbility, Duration.EndOfTurn);
                game.addEffect(effect, source);
                return true;
            }
        }
    }
    return false;
}
Also used : IslandwalkAbility(mage.abilities.keyword.IslandwalkAbility) SubType(mage.constants.SubType) PlainswalkAbility(mage.abilities.keyword.PlainswalkAbility) GainAbilitySourceEffect(mage.abilities.effects.common.continuous.GainAbilitySourceEffect) MountainwalkAbility(mage.abilities.keyword.MountainwalkAbility) MageObject(mage.MageObject) ForestwalkAbility(mage.abilities.keyword.ForestwalkAbility) SwampwalkAbility(mage.abilities.keyword.SwampwalkAbility)

Example 2 with PlainswalkAbility

use of mage.abilities.keyword.PlainswalkAbility in project mage by magefree.

the class CairnWandererTest method TestCairnWandererEffect.

/*
     * Testing: As long as a creature card with flying is in a graveyard, 
     * {this} has flying. The same is true for fear, first strike, 
     * double strike, deathtouch, haste, landwalk, lifelink, protection, 
     * reach, trample, shroud, and vigilance.
     */
@Test
public void TestCairnWandererEffect() {
    addCard(Zone.BATTLEFIELD, playerA, "Cairn Wanderer");
    // Testing FlyingAbility.
    addCard(Zone.GRAVEYARD, playerA, "Lantern Kami");
    // Testing FearAbility.
    addCard(Zone.GRAVEYARD, playerA, "Prickly Boggart");
    // Testing FirstStrikeAbility.
    addCard(Zone.GRAVEYARD, playerA, "Serra Zealot");
    // Testing DoubleStrikeAbility.
    addCard(Zone.GRAVEYARD, playerA, "Fencing Ace");
    // Testing DeathtouchAbility.
    addCard(Zone.GRAVEYARD, playerA, "Typhoid Rats");
    // Testing HasteAbility.
    addCard(Zone.GRAVEYARD, playerB, "Raging Goblin");
    // Testing LandwalkAbility.
    addCard(Zone.GRAVEYARD, playerB, "Zodiac Rooster");
    // Testing LifelinkAbility.
    addCard(Zone.GRAVEYARD, playerB, "Trained Caracal");
    // Testing ProtectionAbility.
    addCard(Zone.GRAVEYARD, playerB, "Progenitus");
    // Testing ReachAbility.
    addCard(Zone.GRAVEYARD, playerB, "Tree Monkey");
    // Testing TrampleAbility.
    addCard(Zone.GRAVEYARD, playerB, "Defiant Elf");
    // Testing ShroudAbility.
    addCard(Zone.GRAVEYARD, playerB, "Elvish Lookout");
    // Testing VigilanceAbility.
    addCard(Zone.GRAVEYARD, playerB, "Veteran Cavalier");
    execute();
    List<Ability> abilities = new ArrayList<>();
    abilities.add(FlyingAbility.getInstance());
    abilities.add(FearAbility.getInstance());
    abilities.add(FirstStrikeAbility.getInstance());
    abilities.add(DoubleStrikeAbility.getInstance());
    abilities.add(DeathtouchAbility.getInstance());
    abilities.add(HasteAbility.getInstance());
    abilities.add(LifelinkAbility.getInstance());
    abilities.add(ReachAbility.getInstance());
    abilities.add(ShroudAbility.getInstance());
    abilities.add(TrampleAbility.getInstance());
    abilities.add(VigilanceAbility.getInstance());
    assertAbilities(playerA, "Cairn Wanderer", abilities);
    assertAbility(playerA, "Cairn Wanderer", new PlainswalkAbility(), true);
    // Progenitus - protection from everything.
    assertAbility(playerA, "Cairn Wanderer", new ProtectionAbility(new FilterCard("everything")), true);
}
Also used : HasteAbility(mage.abilities.keyword.HasteAbility) LifelinkAbility(mage.abilities.keyword.LifelinkAbility) ReachAbility(mage.abilities.keyword.ReachAbility) DeathtouchAbility(mage.abilities.keyword.DeathtouchAbility) VigilanceAbility(mage.abilities.keyword.VigilanceAbility) DoubleStrikeAbility(mage.abilities.keyword.DoubleStrikeAbility) FirstStrikeAbility(mage.abilities.keyword.FirstStrikeAbility) PlainswalkAbility(mage.abilities.keyword.PlainswalkAbility) TrampleAbility(mage.abilities.keyword.TrampleAbility) FlyingAbility(mage.abilities.keyword.FlyingAbility) FearAbility(mage.abilities.keyword.FearAbility) ProtectionAbility(mage.abilities.keyword.ProtectionAbility) ShroudAbility(mage.abilities.keyword.ShroudAbility) Ability(mage.abilities.Ability) FilterCard(mage.filter.FilterCard) PlainswalkAbility(mage.abilities.keyword.PlainswalkAbility) ArrayList(java.util.ArrayList) ProtectionAbility(mage.abilities.keyword.ProtectionAbility) Test(org.junit.Test)

Aggregations

PlainswalkAbility (mage.abilities.keyword.PlainswalkAbility)2 ArrayList (java.util.ArrayList)1 MageObject (mage.MageObject)1 Ability (mage.abilities.Ability)1 GainAbilitySourceEffect (mage.abilities.effects.common.continuous.GainAbilitySourceEffect)1 DeathtouchAbility (mage.abilities.keyword.DeathtouchAbility)1 DoubleStrikeAbility (mage.abilities.keyword.DoubleStrikeAbility)1 FearAbility (mage.abilities.keyword.FearAbility)1 FirstStrikeAbility (mage.abilities.keyword.FirstStrikeAbility)1 FlyingAbility (mage.abilities.keyword.FlyingAbility)1 ForestwalkAbility (mage.abilities.keyword.ForestwalkAbility)1 HasteAbility (mage.abilities.keyword.HasteAbility)1 IslandwalkAbility (mage.abilities.keyword.IslandwalkAbility)1 LifelinkAbility (mage.abilities.keyword.LifelinkAbility)1 MountainwalkAbility (mage.abilities.keyword.MountainwalkAbility)1 ProtectionAbility (mage.abilities.keyword.ProtectionAbility)1 ReachAbility (mage.abilities.keyword.ReachAbility)1 ShroudAbility (mage.abilities.keyword.ShroudAbility)1 SwampwalkAbility (mage.abilities.keyword.SwampwalkAbility)1 TrampleAbility (mage.abilities.keyword.TrampleAbility)1