diff --git a/Mage.Sets/src/mage/sets/betrayersofkamigawa/TendoIceBridge.java b/Mage.Sets/src/mage/sets/betrayersofkamigawa/TendoIceBridge.java index eb6c4bd5e10..95107a25bab 100644 --- a/Mage.Sets/src/mage/sets/betrayersofkamigawa/TendoIceBridge.java +++ b/Mage.Sets/src/mage/sets/betrayersofkamigawa/TendoIceBridge.java @@ -28,8 +28,6 @@ package mage.sets.betrayersofkamigawa; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Rarity; import mage.abilities.Ability; import mage.abilities.common.EntersBattlefieldAbility; import mage.abilities.costs.common.RemoveCountersSourceCost; @@ -37,6 +35,8 @@ import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.abilities.mana.AnyColorManaAbility; import mage.abilities.mana.ColorlessManaAbility; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; import mage.counters.CounterType; /** @@ -49,7 +49,8 @@ public class TendoIceBridge extends CardImpl { super(ownerId, 165, "Tendo Ice Bridge", Rarity.RARE, new CardType[]{CardType.LAND}, ""); this.expansionSetCode = "BOK"; // Tendo Ice Bridge enters the battlefield with a charge counter on it. - this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.CHARGE.createInstance(1)))); + this.addAbility(new EntersBattlefieldAbility( + new AddCountersSourceEffect(CounterType.CHARGE.createInstance(1)), "with a charge counter on it")); // {tap}: Add {C} to your mana pool. this.addAbility(new ColorlessManaAbility()); // {tap}, Remove a charge counter from Tendo Ice Bridge: Add one mana of any color to your mana pool. diff --git a/Mage.Sets/src/mage/sets/commander/GhaveGuruOfSpores.java b/Mage.Sets/src/mage/sets/commander/GhaveGuruOfSpores.java index cf0b1169a94..61a2ad2ab7d 100644 --- a/Mage.Sets/src/mage/sets/commander/GhaveGuruOfSpores.java +++ b/Mage.Sets/src/mage/sets/commander/GhaveGuruOfSpores.java @@ -1,16 +1,16 @@ /* * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: - * + * * 1. Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. - * + * * 2. Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR @@ -20,12 +20,11 @@ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * * The views and conclusions contained in the software and documentation are those of the * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.sets.commander; import java.util.UUID; @@ -59,7 +58,7 @@ import mage.target.common.TargetCreaturePermanent; public class GhaveGuruOfSpores extends CardImpl { final static FilterControlledPermanent filter = new FilterControlledPermanent("creature to sacrifice"); - + static { filter.add(new CardTypePredicate(CardType.CREATURE)); } @@ -71,20 +70,18 @@ public class GhaveGuruOfSpores extends CardImpl { this.subtype.add("Fungus"); this.subtype.add("Shaman"); - - this.power = new MageInt(0); this.toughness = new MageInt(0); - + // Ghave, Guru of Spores enters the battlefield with five +1/+1 counters on it. - this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance(5)))); - - // {1}, Remove a +1/+1 counter from a creature you control: Put a 1/1 green Saproling creature token onto the battlefield. + this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance(5)))); + + // {1}, Remove a +1/+1 counter from a creature you control: Put a 1/1 green Saproling creature token onto the battlefield. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CreateTokenEffect(new SaprolingToken()), new GenericManaCost(1)); - ability.addCost(new RemoveCounterCost(new TargetControlledCreaturePermanent(1,1, new FilterControlledCreaturePermanent(), true), CounterType.P1P1)); + ability.addCost(new RemoveCounterCost(new TargetControlledCreaturePermanent(1, 1, new FilterControlledCreaturePermanent(), true), CounterType.P1P1)); this.addAbility(ability); - - // {1}, Sacrifice a creature: Put a +1/+1 counter on target creature. + + // {1}, Sacrifice a creature: Put a +1/+1 counter on target creature. Ability ability2 = new SimpleActivatedAbility(Zone.BATTLEFIELD, new AddCountersTargetEffect(CounterType.P1P1.createInstance()), new GenericManaCost(1)); ability2.addCost(new SacrificeTargetCost(new TargetControlledPermanent(filter))); ability2.addTarget(new TargetCreaturePermanent()); diff --git a/Mage.Sets/src/mage/sets/lorwyn/Lignify.java b/Mage.Sets/src/mage/sets/lorwyn/Lignify.java index 9bfe1b49dab..f07d2a445cb 100644 --- a/Mage.Sets/src/mage/sets/lorwyn/Lignify.java +++ b/Mage.Sets/src/mage/sets/lorwyn/Lignify.java @@ -67,7 +67,7 @@ public class Lignify extends CardImpl { this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BecomesCreatureAttachedEffect(new LignifyTreefolkToken(), "Enchanted creature is a Treefolk with base power and toughness 0/4 and loses all abilities", - Duration.WhileOnBattlefield, BecomesCreatureAttachedEffect.LoseType.ABILITIES_AND_PT))); + Duration.WhileOnBattlefield, BecomesCreatureAttachedEffect.LoseType.ABILITIES_SUBTYPE_AND_PT))); } diff --git a/Mage.Sets/src/mage/sets/magic2015/SliverHivelord.java b/Mage.Sets/src/mage/sets/magic2015/SliverHivelord.java index 0b7e1b49108..9a7b280367f 100644 --- a/Mage.Sets/src/mage/sets/magic2015/SliverHivelord.java +++ b/Mage.Sets/src/mage/sets/magic2015/SliverHivelord.java @@ -31,7 +31,6 @@ import java.util.UUID; import mage.MageInt; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.common.continuous.GainAbilityControlledEffect; -import mage.abilities.keyword.FirstStrikeAbility; import mage.abilities.keyword.IndestructibleAbility; import mage.cards.CardImpl; import mage.constants.CardType; @@ -58,7 +57,7 @@ public class SliverHivelord extends CardImpl { // Sliver creatures you control have indestructible. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityControlledEffect(IndestructibleAbility.getInstance(), - Duration.WhileOnBattlefield, new FilterCreaturePermanent("Sliver","Sliver creatures")))); + Duration.WhileOnBattlefield, new FilterCreaturePermanent("Sliver", "Sliver creatures")))); } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/enchantments/LignifyTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/enchantments/LignifyTest.java new file mode 100644 index 00000000000..857a0184874 --- /dev/null +++ b/Mage.Tests/src/test/java/org/mage/test/cards/enchantments/LignifyTest.java @@ -0,0 +1,77 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package org.mage.test.cards.enchantments; + +import mage.abilities.keyword.IndestructibleAbility; +import mage.constants.PhaseStep; +import mage.constants.Zone; +import mage.game.permanent.Permanent; +import org.junit.Assert; +import org.junit.Test; +import org.mage.test.serverside.base.CardTestPlayerBase; + +/** + * + * @author LevelX2 + */ +public class LignifyTest extends CardTestPlayerBase { + + /** + * Lignify shouldn't make the creature it enchants a (whatever it + * is)treefolk as it makes the creature just a treefolk i.e. a Sliver + * Hivelord enchanted by lignify should be just a treefolk and not a sliver + * treefolk + */ + @Test + public void LooseType() { + addCard(Zone.BATTLEFIELD, playerA, "Forest", 2); + // Enchant creature + // Enchanted creature is a Treefolk with base power and toughness 0/4 and loses all abilities. + addCard(Zone.HAND, playerA, "Lignify", 1); // {1}{G} + + // Sliver creatures you control have indestructible. + addCard(Zone.BATTLEFIELD, playerB, "Sliver Hivelord", 1); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Lignify", "Sliver Hivelord"); + + setStopAt(1, PhaseStep.BEGIN_COMBAT); + execute(); + + assertPermanentCount(playerA, "Lignify", 1); + assertPermanentCount(playerB, "Sliver Hivelord", 1); + + assertAbility(playerB, "Sliver Hivelord", IndestructibleAbility.getInstance(), false); + assertPowerToughness(playerB, "Sliver Hivelord", 0, 4); + + Permanent hivelord = getPermanent("Sliver Hivelord", playerB); + + Assert.assertFalse("Sliver Hivelord may not be of subtype Sliver", hivelord.getSubtype().contains("Sliver")); + + } + +} diff --git a/Mage/src/main/java/mage/abilities/effects/common/continuous/BecomesCreatureAttachedEffect.java b/Mage/src/main/java/mage/abilities/effects/common/continuous/BecomesCreatureAttachedEffect.java index 5a0f47fce55..b8e69a3278d 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/continuous/BecomesCreatureAttachedEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/continuous/BecomesCreatureAttachedEffect.java @@ -47,7 +47,7 @@ public class BecomesCreatureAttachedEffect extends ContinuousEffectImpl { public enum LoseType { - NONE, ALL, ALL_BUT_COLOR, ABILITIES, ABILITIES_AND_PT + NONE, ALL, ALL_BUT_COLOR, ABILITIES, ABILITIES_SUBTYPE_AND_PT }; protected Token token; @@ -111,6 +111,7 @@ public class BecomesCreatureAttachedEffect extends ContinuousEffectImpl { switch (loseType) { case ALL: case ALL_BUT_COLOR: + case ABILITIES_SUBTYPE_AND_PT: permanent.getSubtype().retainAll(CardRepository.instance.getLandTypes()); break; } @@ -143,7 +144,7 @@ public class BecomesCreatureAttachedEffect extends ContinuousEffectImpl { case ALL: case ALL_BUT_COLOR: case ABILITIES: - case ABILITIES_AND_PT: + case ABILITIES_SUBTYPE_AND_PT: permanent.removeAllAbilities(source.getSourceId(), game); break; }