use of mage.abilities.keyword.SwampwalkAbility 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.SwampwalkAbility in project mage by magefree.
the class ChooseOneTest method testThirdMode.
@Test
public void testThirdMode() {
addCard(Zone.BATTLEFIELD, playerA, "Swamp", 1);
// Choose one
// - Target player discards a card
// - Target creature gets +2/-1 until end of turn.
// - Target creature gains swampwalk until end of turn.
// Instant {B}
addCard(Zone.HAND, playerA, "Funeral Charm");
addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion");
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Funeral Charm", "Silvercoat Lion");
setModeChoice(playerA, "3");
setStopAt(1, PhaseStep.BEGIN_COMBAT);
execute();
assertGraveyardCount(playerA, "Funeral Charm", 1);
assertPowerToughness(playerB, "Silvercoat Lion", 2, 2);
assertAbility(playerB, "Silvercoat Lion", new SwampwalkAbility(), true);
}
use of mage.abilities.keyword.SwampwalkAbility in project mage by magefree.
the class LoosingAbilitiesTest method testYixlidJailerRemovesAbilities.
/**
* The Card in the graveyard should have no Swampwalk if Yixlid Jailer
* effect was added later
*/
@Test
public void testYixlidJailerRemovesAbilities() {
// Cards in graveyards lose all abilities.
// Creature 2/1 - {1}{B}
addCard(Zone.HAND, playerA, "Yixlid Jailer");
addCard(Zone.BATTLEFIELD, playerA, "Swamp", 2);
// Swampwalk
// As long as Filth is in your graveyard and you control a Swamp, creatures you control have swampwalk.
addCard(Zone.GRAVEYARD, playerB, "Filth");
addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion");
addCard(Zone.BATTLEFIELD, playerB, "Swamp", 2);
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Yixlid Jailer");
setStopAt(1, PhaseStep.BEGIN_COMBAT);
execute();
assertPermanentCount(playerB, "Silvercoat Lion", 1);
assertAbility(playerB, "Silvercoat Lion", new SwampwalkAbility(), false);
}
use of mage.abilities.keyword.SwampwalkAbility in project mage by magefree.
the class LoosingAbilitiesTest method GivingSwampwalkFromGraveyard.
@Test
public void GivingSwampwalkFromGraveyard() {
// Swampwalk
// As long as Filth is in your graveyard and you control a Swamp, creatures you control have swampwalk.
// Creature
addCard(Zone.GRAVEYARD, playerB, "Filth");
addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion");
addCard(Zone.BATTLEFIELD, playerB, "Swamp", 2);
setStopAt(1, PhaseStep.BEGIN_COMBAT);
execute();
assertPermanentCount(playerB, "Silvercoat Lion", 1);
assertAbility(playerB, "Silvercoat Lion", new SwampwalkAbility(), true);
}
use of mage.abilities.keyword.SwampwalkAbility in project mage by magefree.
the class UrborgEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
Permanent permanent = game.getPermanent(source.getSourceId());
if (player == null || permanent == null) {
return false;
}
Ability ability;
if (player.chooseUse(Outcome.UnboostCreature, "Which ability should be lost?", null, "First Strike", "Swampwalk", source, game)) {
ability = FirstStrikeAbility.getInstance();
} else {
ability = new SwampwalkAbility();
}
ContinuousEffect effect = new LoseAbilityTargetEffect(ability, Duration.EndOfTurn);
// effect.setTargetPointer(new FixedTarget(permanent, game));
game.addEffect(effect, source);
return true;
}
Aggregations