mirror of
https://github.com/magefree/mage.git
synced 2025-12-22 19:41:59 -08:00
* Lignify - Fixed that existing subtypes of the enchanted creature were not removed.
This commit is contained in:
parent
9aeaeae1c3
commit
8c9c4421cd
6 changed files with 99 additions and 24 deletions
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -25,7 +25,6 @@
|
|||
* 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;
|
||||
|
|
@ -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))));
|
||||
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.
|
||||
// {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());
|
||||
|
|
|
|||
|
|
@ -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)));
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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"))));
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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"));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue