mirror of
https://github.com/correl/mage.git
synced 2024-11-25 11:09:53 +00:00
fixed issues with changeling tokens not counting as they enter
This commit is contained in:
parent
1599b2a49f
commit
82832046b3
2 changed files with 36 additions and 1 deletions
|
@ -3,6 +3,7 @@ package org.mage.test.cards.continuous;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.constants.PhaseStep;
|
import mage.constants.PhaseStep;
|
||||||
import mage.constants.Zone;
|
import mage.constants.Zone;
|
||||||
|
import mage.counters.CounterType;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.mage.test.serverside.base.CardTestPlayerBase;
|
import org.mage.test.serverside.base.CardTestPlayerBase;
|
||||||
|
|
||||||
|
@ -66,10 +67,11 @@ public class ChangelingTest extends CardTestPlayerBase {
|
||||||
assertPowerToughness(playerA, copter, 3, 3);
|
assertPowerToughness(playerA, copter, 3, 3);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static final String mimic = "Metallic Mimic";
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testMetallicMimicChangelingTrigger() {
|
public void testMetallicMimicChangelingTrigger() {
|
||||||
// all creatures with the chosen subtype come into play with a +1/+1 counter
|
// 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, mimic, 1);
|
||||||
addCard(Zone.HAND, playerA, woodlandChangeling, 1);
|
addCard(Zone.HAND, playerA, woodlandChangeling, 1);
|
||||||
|
@ -86,4 +88,24 @@ public class ChangelingTest extends CardTestPlayerBase {
|
||||||
// 2/2 + +1/+1 counter
|
// 2/2 + +1/+1 counter
|
||||||
assertPowerToughness(playerA, woodlandChangeling, 3, 3);
|
assertPowerToughness(playerA, woodlandChangeling, 3, 3);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static final String paragon = "Bramblewood Paragon";
|
||||||
|
private static final String cohort = "Irregular Cohort";
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testTokensHaveTypesAsTheyEnter() {
|
||||||
|
addCard(Zone.BATTLEFIELD, playerA, "Plains", 4);
|
||||||
|
addCard(Zone.BATTLEFIELD, playerA, paragon);
|
||||||
|
addCard(Zone.HAND, playerA, cohort);
|
||||||
|
|
||||||
|
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, cohort);
|
||||||
|
|
||||||
|
setStrictChooseMode(true);
|
||||||
|
setStopAt(1, PhaseStep.END_TURN);
|
||||||
|
execute();
|
||||||
|
assertAllCommandsUsed();
|
||||||
|
|
||||||
|
assertCounterCount(playerA, cohort, CounterType.P1P1, 1);
|
||||||
|
assertCounterCount(playerA, "Shapeshifter", CounterType.P1P1, 1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,8 +3,11 @@ package mage.game.permanent;
|
||||||
import mage.MageObject;
|
import mage.MageObject;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.costs.mana.ManaCost;
|
import mage.abilities.costs.mana.ManaCost;
|
||||||
|
import mage.abilities.keyword.ChangelingAbility;
|
||||||
import mage.cards.Card;
|
import mage.cards.Card;
|
||||||
import mage.constants.EmptyNames;
|
import mage.constants.EmptyNames;
|
||||||
|
import mage.constants.SubType;
|
||||||
|
import mage.constants.SubTypeSet;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.game.events.ZoneChangeEvent;
|
import mage.game.events.ZoneChangeEvent;
|
||||||
import mage.game.permanent.token.Token;
|
import mage.game.permanent.token.Token;
|
||||||
|
@ -116,4 +119,14 @@ public class PermanentToken extends PermanentImpl {
|
||||||
// token don't have game card, so return itself
|
// token don't have game card, so return itself
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean hasSubtype(SubType value, Game game) {
|
||||||
|
if (super.hasSubtype(value, game)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return this.isCreature(game)
|
||||||
|
&& value.getSubTypeSet() == SubTypeSet.CreatureType
|
||||||
|
&& this.getAbilities(game).containsClass(ChangelingAbility.class);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue