use of mage.abilities.keyword.IslandwalkAbility 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;
}
use of mage.abilities.keyword.IslandwalkAbility in project mage by magefree.
the class MasterOfThePearlTridentTest method testLordAbility.
@Test
public void testLordAbility() {
addCard(Zone.BATTLEFIELD, playerA, "Island", 2);
addCard(Zone.HAND, playerA, "Master of the Pearl Trident");
addCard(Zone.BATTLEFIELD, playerA, "Merfolk of the Pearl Trident");
addCard(Zone.BATTLEFIELD, playerB, "Llanowar Elves");
addCard(Zone.BATTLEFIELD, playerB, "Island");
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Master of the Pearl Trident");
attack(3, playerA, "Merfolk of the Pearl Trident");
block(3, playerB, "Llanowar Elves", "Merfolk of the Pearl Trident");
setStopAt(3, PhaseStep.END_TURN);
execute();
assertPermanentCount(playerA, "Master of the Pearl Trident", 1);
assertLife(playerB, 18);
assertPowerToughness(playerA, "Merfolk of the Pearl Trident", 2, 2);
assertAbility(playerA, "Merfolk of the Pearl Trident", new IslandwalkAbility(), true);
}
Aggregations