metallic mimic fix

This commit is contained in:
igoudt 2017-07-20 09:26:29 +02:00
parent 105f346ebc
commit 422ce699d1
2 changed files with 26 additions and 8 deletions

View file

@ -27,7 +27,6 @@
*/
package mage.cards.m;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.AsEntersBattlefieldAbility;
@ -37,17 +36,15 @@ import mage.abilities.effects.common.ChooseCreatureTypeEffect;
import mage.abilities.effects.common.enterAttribute.EnterAttributeAddChosenSubtypeEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.EnterEventType;
import mage.constants.Outcome;
import mage.constants.Zone;
import mage.constants.*;
import mage.counters.CounterType;
import mage.game.Game;
import mage.game.events.EntersTheBattlefieldEvent;
import mage.game.events.GameEvent;
import mage.game.permanent.Permanent;
import java.util.UUID;
/**
*
* @author Styxo
@ -109,7 +106,7 @@ class MetallicMimicReplacementEffect extends ReplacementEffectImpl {
&& enteringCreature.isCreature()
&& !event.getTargetId().equals(source.getSourceId())) {
String subtype = (String) game.getState().getValue(sourcePermanent.getId() + "_type");
return subtype != null && enteringCreature.getSubtype(game).contains(subtype);
return subtype != null && enteringCreature.hasSubtype(subtype, game);
}
return false;
}

View file

@ -48,11 +48,32 @@ public class ChangelingTest extends CardTestPlayerBase {
*/
assertPowerToughness(playerA, lordOfAtlantis, 6, 6);
/*
mutavault token; +3
mutavault token; +2
atlantis +1
unreal: +1
coat of arms: +5
*/
assertPowerToughness(playerA, mutavault, 9, 9);
}
@Test
public void testMetallicMimicChangelingTrigger(){
// all creatures with the chosen subtype come into play with a +1/+1 counter
final String mimic = "Metallic Mimic";
addCard(Zone.HAND, playerA, mimic, 1);
addCard(Zone.HAND, playerA, woodlandChangeling, 1);
addCard(Zone.BATTLEFIELD, playerA, "Forest", 10);
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, mimic);
setChoice(playerA, "Sliver");
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, woodlandChangeling);
setStopAt(1, PhaseStep.POSTCOMBAT_MAIN);
execute();
// 2/2 + +1/+1 counter
assertPowerToughness(playerA, woodlandChangeling, 3, 3);
}
}