fixed issues with changeling tokens not counting as they enter

This commit is contained in:
Evan Kranzler 2022-03-13 22:25:44 -04:00
parent 1599b2a49f
commit 82832046b3
2 changed files with 36 additions and 1 deletions

View file

@ -3,8 +3,11 @@ package mage.game.permanent;
import mage.MageObject;
import mage.abilities.Ability;
import mage.abilities.costs.mana.ManaCost;
import mage.abilities.keyword.ChangelingAbility;
import mage.cards.Card;
import mage.constants.EmptyNames;
import mage.constants.SubType;
import mage.constants.SubTypeSet;
import mage.game.Game;
import mage.game.events.ZoneChangeEvent;
import mage.game.permanent.token.Token;
@ -116,4 +119,14 @@ public class PermanentToken extends PermanentImpl {
// token don't have game card, so return itself
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);
}
}