[IKO] fixed Kaheera, the Orphanguard not correctly counting changelings

This commit is contained in:
Evan Kranzler 2021-03-22 08:53:40 -04:00
parent e615b31221
commit 9f9cb3327f
5 changed files with 18 additions and 11 deletions

View file

@ -2,15 +2,13 @@ package mage.cards.d;
import mage.MageInt;
import mage.abilities.common.EntersBattlefieldControlledTriggeredAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.common.InfoEffect;
import mage.abilities.effects.common.continuous.IsAllCreatureTypesSourceEffect;
import mage.abilities.keyword.ChangelingAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.ComparisonType;
import mage.constants.SuperType;
import mage.constants.Zone;
import mage.filter.FilterPermanent;
import mage.filter.predicate.mageobject.ConvertedManaCostPredicate;
@ -34,7 +32,7 @@ public final class DrJuliusJumblemorph extends CardImpl {
this.toughness = new MageInt(4);
// Dr. Julius Jumblemorph is every creature type (even if this card isn't on the battlefield).
this.addAbility(new SimpleStaticAbility(Zone.ALL, new IsAllCreatureTypesSourceEffect()));
this.addAbility(new ChangelingAbility(false));
// Whenever a host enters the battlefield under your control, you may search your library and/or graveyard for a card with augment and combine it with that host. If you search your library this way, shuffle it.
// TODO: Host currently isn't implemented, so this ability currently would never trigger

View file

@ -93,7 +93,7 @@ enum KaheeraTheOrphanguardCompanionCondition implements CompanionCondition {
);
private static boolean checkTypes(Card card) {
return subtypes.stream().anyMatch(subtype -> card.getSubtype().contains(subtype));
return subtypes.stream().anyMatch(subtype -> card.hasSubtype(subtype, null));
}
@Override

View file

@ -1,14 +1,12 @@
package mage.cards.m;
import mage.MageInt;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.common.continuous.IsAllCreatureTypesSourceEffect;
import mage.abilities.keyword.ChangelingAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.SuperType;
import mage.constants.Zone;
import java.util.UUID;
@ -26,7 +24,7 @@ public final class MistformUltimus extends CardImpl {
this.toughness = new MageInt(3);
// Mistform Ultimus is every creature type.
this.addAbility(new SimpleStaticAbility(Zone.ALL, new IsAllCreatureTypesSourceEffect()));
this.addAbility(new ChangelingAbility(false));
}
private MistformUltimus(final MistformUltimus card) {

View file

@ -9,6 +9,7 @@ import mage.abilities.costs.mana.ManaCosts;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.ContinuousEffect;
import mage.abilities.effects.Effect;
import mage.abilities.keyword.ChangelingAbility;
import mage.abilities.mana.ActivatedManaAbilityImpl;
import mage.abilities.text.TextPart;
import mage.abilities.text.TextPartSubType;
@ -291,6 +292,9 @@ public abstract class MageObjectImpl implements MageObject {
@Override
public boolean isAllCreatureTypes(Game game) {
if (game == null) {
return this.getAbilities().containsClass(ChangelingAbility.class);
}
return this.getSubtype(game).isAllCreatureTypes();
}

View file

@ -4,7 +4,6 @@ import mage.abilities.StaticAbility;
import mage.abilities.effects.common.continuous.IsAllCreatureTypesSourceEffect;
import mage.constants.Zone;
/**
* October 1, 2012
* 702.71. Changeling
@ -16,17 +15,25 @@ import mage.constants.Zone;
*/
public class ChangelingAbility extends StaticAbility {
private final boolean changelingText;
public ChangelingAbility() {
this(true);
}
public ChangelingAbility(boolean changelingText) {
super(Zone.ALL, new IsAllCreatureTypesSourceEffect());
this.changelingText = changelingText;
}
private ChangelingAbility(final ChangelingAbility ability) {
super(ability);
this.changelingText = ability.changelingText;
}
@Override
public String getRule() {
return "Changeling <i>(This card is every creature type.)</i>";
return changelingText ? "Changeling <i>(This card is every creature type.)</i>" : super.getRule();
}
@Override