Add Subtype to the CardAttribute Framework

This is a massive change. I’ve refrained from unrelated refactoring
when possible but there are still a lot of changes here.
This commit is contained in:
Samuel Sandeen 2016-08-28 17:30:10 -04:00
parent a1a3c0c6a7
commit 282443c231
272 changed files with 514 additions and 493 deletions

View file

@ -247,9 +247,9 @@ public class DeckBuilder {
int type;
if (card.getCardType().contains(CardType.CREATURE)) {
type = 10;
} else if (card.getSubtype().contains("Equipment")) {
} else if (card.getSubtype(null).contains("Equipment")) {
type = 8;
} else if (card.getSubtype().contains("Aura")) {
} else if (card.getSubtype(null).contains("Aura")) {
type = 5;
} else if (card.getCardType().contains(CardType.INSTANT)) {
type = 7;

View file

@ -272,7 +272,7 @@ public class CardView extends SimpleCardView {
this.power = Integer.toString(card.getPower().getValue());
this.toughness = Integer.toString(card.getToughness().getValue());
this.cardTypes = card.getCardType();
this.subTypes = card.getSubtype();
this.subTypes = card.getSubtype(game);
this.superTypes = card.getSupertype();
this.color = card.getColor(game);
this.canTransform = card.canTransform();
@ -346,7 +346,7 @@ public class CardView extends SimpleCardView {
this.loyalty = "";
}
this.cardTypes = object.getCardType();
this.subTypes = object.getSubtype();
this.subTypes = object.getSubtype(null);
this.superTypes = object.getSupertype();
this.color = object.getColor(null);
this.manaCost = object.getManaCost().getSymbols();
@ -452,7 +452,7 @@ public class CardView extends SimpleCardView {
this.toughness = token.getToughness().toString();
this.loyalty = "";
this.cardTypes = token.getCardType();
this.subTypes = token.getSubtype();
this.subTypes = token.getSubtype(null);
this.superTypes = token.getSupertype();
this.color = token.getColor(null);
this.manaCost = token.getManaCost().getSymbols();

View file

@ -64,12 +64,12 @@ public class StackAbilityView extends CardView {
this.loyalty = "";
this.cardTypes = ability.getCardType();
this.subTypes = ability.getSubtype();
this.subTypes = ability.getSubtype(game);
this.superTypes = ability.getSupertype();
this.color = ability.getColor(game);
this.manaCost = ability.getManaCost().getSymbols();
this.cardTypes = ability.getCardType();
this.subTypes = ability.getSubtype();
this.subTypes = ability.getSubtype(game);
this.superTypes = ability.getSupertype();
this.color = ability.getColor(game);
this.manaCost = ability.getManaCost().getSymbols();

View file

@ -55,7 +55,7 @@ public class ArtificialScoringSystem {
//score + =cardDefinition.getActivations().size()*50;
//score += cardDefinition.getManaActivations().size()*80;
} else {
if (permanent.getSubtype().contains("Equipment")) {
if (permanent.getSubtype(game).contains("Equipment")) {
score += 100;
}
}

View file

@ -1340,9 +1340,9 @@ public class ComputerPlayer extends PlayerImpl implements Player {
for (Permanent permanent : game.getBattlefield().getActivePermanents(this.getId(), game)) {
if (game.getOpponents(this.getId()).contains(permanent.getControllerId())
&& permanent.getCardType().contains(CardType.CREATURE)
&& permanent.getSubtype().size() > 0) {
if (choice.getChoices().contains(permanent.getSubtype().get(0))) {
choice.setChoice(permanent.getSubtype().get(0));
&& permanent.getSubtype(game).size() > 0) {
if (choice.getChoices().contains(permanent.getSubtype(game).get(0))) {
choice.setChoice(permanent.getSubtype(game).get(0));
break;
}
}
@ -1352,9 +1352,9 @@ public class ComputerPlayer extends PlayerImpl implements Player {
for (UUID opponentId : game.getOpponents(this.getId())) {
Player opponent = game.getPlayer(opponentId);
for (Card card : opponent.getGraveyard().getCards(game)) {
if (card != null && card.getCardType().contains(CardType.CREATURE) && card.getSubtype().size() > 0) {
if (choice.getChoices().contains(card.getSubtype().get(0))) {
choice.setChoice(card.getSubtype().get(0));
if (card != null && card.getCardType().contains(CardType.CREATURE) && card.getSubtype(game).size() > 0) {
if (choice.getChoices().contains(card.getSubtype(game).get(0))) {
choice.setChoice(card.getSubtype(game).get(0));
break;
}
}
@ -1368,9 +1368,9 @@ public class ComputerPlayer extends PlayerImpl implements Player {
// choose a creature type of hand or library
for (UUID cardId : this.getHand()) {
Card card = game.getCard(cardId);
if (card != null && card.getCardType().contains(CardType.CREATURE) && card.getSubtype().size() > 0) {
if (choice.getChoices().contains(card.getSubtype().get(0))) {
choice.setChoice(card.getSubtype().get(0));
if (card != null && card.getCardType().contains(CardType.CREATURE) && card.getSubtype(game).size() > 0) {
if (choice.getChoices().contains(card.getSubtype(game).get(0))) {
choice.setChoice(card.getSubtype(game).get(0));
break;
}
}
@ -1378,9 +1378,9 @@ public class ComputerPlayer extends PlayerImpl implements Player {
if (!choice.isChosen()) {
for (UUID cardId : this.getLibrary().getCardList()) {
Card card = game.getCard(cardId);
if (card != null && card.getCardType().contains(CardType.CREATURE) && card.getSubtype().size() > 0) {
if (choice.getChoices().contains(card.getSubtype().get(0))) {
choice.setChoice(card.getSubtype().get(0));
if (card != null && card.getCardType().contains(CardType.CREATURE) && card.getSubtype(game).size() > 0) {
if (choice.getChoices().contains(card.getSubtype(game).get(0))) {
choice.setChoice(card.getSubtype(game).get(0));
break;
}
}

View file

@ -16,7 +16,7 @@ import java.io.InputStream;
import java.util.*;
/**
* Class responsible for reading ratings from resources and rating gived cards.
* Class responsible for reading ratings from resources and rating given cards.
* Based on card relative ratings from resources and card parameters.
*
* @author nantuko
@ -61,9 +61,9 @@ public class RateCard {
type = 15;
} else if (card.getCardType().contains(CardType.CREATURE)) {
type = 10;
} else if (card.getSubtype().contains("Equipment")) {
} else if (card.getSubtype(null).contains("Equipment")) {
type = 8;
} else if (card.getSubtype().contains("Aura")) {
} else if (card.getSubtype(null).contains("Aura")) {
type = 5;
} else if (card.getCardType().contains(CardType.INSTANT)) {
type = 7;
@ -78,7 +78,7 @@ public class RateCard {
}
private static int isRemoval(Card card) {
if (card.getSubtype().contains("Aura") || card.getCardType().contains(CardType.INSTANT)
if (card.getSubtype(null).contains("Aura") || card.getCardType().contains(CardType.INSTANT)
|| card.getCardType().contains(CardType.SORCERY)) {
for (Ability ability : card.getAbilities()) {

View file

@ -120,7 +120,7 @@ class CantBeEnchantedAbility extends StaticAbility {
public boolean canTarget(MageObject source, Game game) {
if (source.getCardType().contains(CardType.ENCHANTMENT) &&
source.hasSubtype("Aura")) {
source.hasSubtype("Aura", game)) {
return false;
}
return true;

View file

@ -96,7 +96,7 @@ class PreventDamageToSourceBySubtypeEffect extends PreventAllDamageToSourceEffec
@Override
public boolean applies(GameEvent event, Ability source, Game game) {
if (super.applies(event, source, game)) {
if (game.getObject(event.getSourceId()).hasSubtype(subtype)){
if (game.getObject(event.getSourceId()).hasSubtype(subtype, game)){
if (event.getTargetId().equals(source.getSourceId())) {
return true;
}

View file

@ -145,7 +145,7 @@ class GuardianBeastConditionalEffect extends ContinuousRuleModifyingEffectImpl {
}
StackObject spell = game.getStack().getStackObject(event.getSourceId());
if (event.getType() == EventType.LOSE_CONTROL || event.getType() == EventType.ATTACH || event.getType() == EventType.TARGET && spell != null && spell.getCardType().contains(CardType.ENCHANTMENT) && spell.getSubtype().contains("Aura")) {
if (event.getType() == EventType.LOSE_CONTROL || event.getType() == EventType.ATTACH || event.getType() == EventType.TARGET && spell != null && spell.getCardType().contains(CardType.ENCHANTMENT) && spell.getSubtype(game).contains("Aura")) {
for (Permanent perm : game.getBattlefield().getAllActivePermanents(filter, source.getControllerId(), game)) {
if (perm != null && perm.getId() == targetPermanent.getId() && !perm.getCardType().contains(CardType.CREATURE)) {
return true;

View file

@ -142,7 +142,7 @@ class CavernOfSoulsManaCondition extends CreatureCastManaCondition {
if (super.apply(game, source)) {
// check: ... of the chosen type
MageObject object = game.getObject(source.getSourceId());
if (creatureType != null && object.hasSubtype(creatureType)) {
if (creatureType != null && object.hasSubtype(creatureType, game)) {
return true;
}
}

View file

@ -87,7 +87,7 @@ class DefyDeathEffect extends OneShotEffect {
@Override
public boolean apply(Game game, Ability source) {
Permanent permanent = game.getPermanent(source.getFirstTarget());
if (permanent != null && permanent.hasSubtype("Angel")) {
if (permanent != null && permanent.hasSubtype("Angel", game)) {
permanent.addCounters(CounterType.P1P1.createInstance(2), game);
return true;
}

View file

@ -103,7 +103,7 @@ class DescendantsPathEffect extends OneShotEffect {
FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent();
boolean found = false;
for (Permanent permanent: game.getBattlefield().getAllActivePermanents(filter, controller.getId(), game)) {
if (CardUtil.shareSubtypes(card, permanent)) {
if (CardUtil.shareSubtypes(card, permanent, game)) {
found = true;
break;
}

View file

@ -133,7 +133,7 @@ class DreadSlaverContiniousEffect extends ContinuousEffectImpl {
switch (layer) {
case TypeChangingEffects_4:
if (sublayer == SubLayer.NA) {
creature.getSubtype().add("Zombie");
creature.getSubtype(game).add("Zombie");
}
break;
case ColorChangingEffects_5:

View file

@ -99,7 +99,7 @@ class EatenBySpidersEffect extends OneShotEffect {
for (UUID attachmentId : attachments) {
Permanent attachment = game.getPermanent(attachmentId);
if (attachment.hasSubtype("Equipment")) {
if (attachment.hasSubtype("Equipment", game)) {
attachment.destroy(source.getSourceId(), game, false);
}
}

View file

@ -107,7 +107,7 @@ class HeraldOfWarCostReductionEffect extends CostModificationEffectImpl {
public boolean applies(Ability abilityToModify, Ability source, Game game) {
if (abilityToModify instanceof SpellAbility || abilityToModify instanceof FlashbackAbility) {
Card sourceCard = game.getCard(abilityToModify.getSourceId());
if (sourceCard != null && abilityToModify.getControllerId().equals(source.getControllerId()) && (sourceCard.hasSubtype("Angel") || sourceCard.hasSubtype("Human"))) {
if (sourceCard != null && abilityToModify.getControllerId().equals(source.getControllerId()) && (sourceCard.hasSubtype("Angel", game) || sourceCard.hasSubtype("Human", game))) {
return true;
}
}

View file

@ -91,7 +91,7 @@ class HolyJusticiarEffect extends OneShotEffect {
public boolean apply(Game game, Ability source) {
Permanent creature = game.getPermanent(source.getFirstTarget());
if (creature != null) {
if (creature.hasSubtype("Zombie")) {
if (creature.hasSubtype("Zombie", game)) {
creature.tap(game);
creature.moveToExile(source.getSourceId(), creature.getName(), source.getSourceId(), game);
} else {

View file

@ -146,7 +146,7 @@ class AkoumHellkiteDamageEffect extends OneShotEffect {
Permanent land = game.getPermanentOrLKIBattlefield(getTargetPointer().getFirst(game, source));
Player player = game.getPlayer(source.getFirstTarget());
if (land != null && player != null) {
if (land.hasSubtype("Mountain")) {
if (land.hasSubtype("Mountain", game)) {
player.damage(2, source.getSourceId(), game, false, true);
} else {
player.damage(1, source.getSourceId(), game, false, true);
@ -155,7 +155,7 @@ class AkoumHellkiteDamageEffect extends OneShotEffect {
}
Permanent permanent = game.getPermanent(source.getFirstTarget());
if (land != null && permanent != null) {
if (land.hasSubtype("Mountain")) {
if (land.hasSubtype("Mountain", game)) {
permanent.damage(2, source.getSourceId(), game, false, true);
} else {
permanent.damage(1, source.getSourceId(), game, false, true);

View file

@ -109,7 +109,7 @@ class EmeriaShepherdReturnToHandTargetEffect extends OneShotEffect {
return false;
}
Zone toZone = Zone.HAND;
if (triggeringLand.getSubtype().contains("Plains")
if (triggeringLand.getSubtype(game).contains("Plains")
&& controller.chooseUse(Outcome.PutCardInPlay, "Put the card to battlefield instead?", source, game)) {
toZone = Zone.BATTLEFIELD;
}

View file

@ -152,7 +152,7 @@ class GuardianOfTazeemEffect extends OneShotEffect {
public boolean apply(Game game, Ability source) {
Permanent land = game.getPermanentOrLKIBattlefield(getTargetPointer().getFirst(game, source));
Permanent targetCreature = game.getPermanent(source.getFirstTarget());
if (land != null && targetCreature != null && land.hasSubtype("Island")) {
if (land != null && targetCreature != null && land.hasSubtype("Island", game)) {
ContinuousEffect effect = new DontUntapInControllersNextUntapStepTargetEffect("that creature");
effect.setTargetPointer(new FixedTarget(targetCreature, game));
game.addEffect(effect, source);

View file

@ -96,7 +96,7 @@ class GuulDrazOverseerEffect extends OneShotEffect {
Permanent land = game.getPermanentOrLKIBattlefield(getTargetPointer().getFirst(game, source));
if (controller != null && land != null) {
int boost = 1;
if (land.getSubtype().contains("Swamp")) {
if (land.getSubtype(game).contains("Swamp")) {
boost = 2;
}
game.addEffect(new BoostControlledEffect(boost, 0, Duration.EndOfTurn, true), source);

View file

@ -144,7 +144,7 @@ class OranRiefHydraEffect extends OneShotEffect {
Permanent land = game.getPermanentOrLKIBattlefield(getTargetPointer().getFirst(game, source));
Permanent sourcePermanent = game.getPermanent(source.getSourceId());
if (land != null && sourcePermanent != null) {
if (land.hasSubtype("Forest")) {
if (land.hasSubtype("Forest", game)) {
sourcePermanent.addCounters(CounterType.P1P1.createInstance(2), game);
} else {
sourcePermanent.addCounters(CounterType.P1P1.createInstance(), game);

View file

@ -208,7 +208,7 @@ class ShurikenControlEffect extends OneShotEffect {
if (equipment != null) {
Permanent creature = game.getPermanent(source.getSourceId());
if (creature != null) {
if (!creature.hasSubtype("Ninja")) {
if (!creature.hasSubtype("Ninja", game)) {
Permanent damagedCreature = game.getPermanent(this.getTargetPointer().getFirst(game, source));
if (damagedCreature == null) {
damagedCreature = (Permanent) game.getLastKnownInformation(this.getTargetPointer().getFirst(game, source), Zone.BATTLEFIELD);

View file

@ -99,7 +99,7 @@ public class SlumberingTora extends CardImpl {
case TypeChangingEffects_4:
if (sublayer == SubLayer.NA) {
permanent.getCardType().add(CardType.CREATURE);
permanent.getSubtype().add("Cat");
permanent.getSubtype(game).add("Cat");
}
break;
case PTChangingEffects_7:

View file

@ -93,7 +93,7 @@ public class UncheckedGrowth extends CardImpl {
int affectedTargets = 0;
for (UUID permanentId : targetPointer.getTargets(game, source)) {
Permanent permanent = game.getPermanent(permanentId);
if (permanent != null && permanent.hasSubtype("Spirit")) {
if (permanent != null && permanent.hasSubtype("Spirit", game)) {
permanent.addAbility(TrampleAbility.getInstance(), game);
affectedTargets++;
}

View file

@ -98,7 +98,7 @@ class EverflameEidolonEffect extends OneShotEffect {
public boolean apply(Game game, Ability source) {
Permanent sourceObject = game.getPermanentOrLKIBattlefield(source.getSourceId());
if (sourceObject != null) {
if (sourceObject.getSubtype().contains("Aura")) {
if (sourceObject.getSubtype(game).contains("Aura")) {
new BoostEnchantedEffect(1, 0, Duration.EndOfTurn).apply(game, source);
} else {
game.addEffect(new BoostSourceEffect(1, 0, Duration.EndOfTurn), source);

View file

@ -97,7 +97,7 @@ class ZuberasDiedWatcher extends Watcher {
public void watch(GameEvent event, Game game) {
if (event.getType() == GameEvent.EventType.ZONE_CHANGE && ((ZoneChangeEvent) event).isDiesEvent()) {
MageObject card = game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD);
if (card != null && card.hasSubtype("Zubera")) {
if (card != null && card.hasSubtype("Zubera", game)) {
zuberasDiedThisTurn++;
}
}

View file

@ -116,7 +116,7 @@ class KondasBannerTypeBoostEffect extends BoostAllEffect {
Permanent equipedCreature = game.getPermanent(equipment.getAttachedTo());
if (equipedCreature != null) {
for (Permanent perm : game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source.getSourceId(), game)) {
if (CardUtil.shareSubtypes(perm, equipedCreature)) {
if (CardUtil.shareSubtypes(perm, equipedCreature, game)) {
perm.addPower(power.calculate(game, source, this));
perm.addToughness(toughness.calculate(game, source, this));

View file

@ -106,7 +106,7 @@ class SeshiroTheAnointedAbility extends TriggeredAbilityImpl {
public boolean checkTrigger(GameEvent event, Game game) {
DamagedPlayerEvent damageEvent = (DamagedPlayerEvent)event;
Permanent p = game.getPermanent(event.getSourceId());
if (damageEvent.isCombatDamage() && p != null && p.hasSubtype("Snake") && p.getControllerId().equals(controllerId)) {
if (damageEvent.isCombatDamage() && p != null && p.hasSubtype("Snake", game) && p.getControllerId().equals(controllerId)) {
return true;
}
return false;

View file

@ -117,7 +117,7 @@ class SosukeSonOfSeshiroTriggeredAbility extends TriggeredAbilityImpl {
Permanent sourceCreature = game.getPermanent(event.getSourceId());
Permanent targetCreature = game.getPermanent(event.getTargetId());
if (sourceCreature != null && sourceCreature.getControllerId().equals(this.getControllerId())
&& targetCreature != null && sourceCreature.hasSubtype("Warrior")) {
&& targetCreature != null && sourceCreature.hasSubtype("Warrior", game)) {
this.getEffects().get(0).setTargetPointer(new FixedTarget(targetCreature.getId()));
return true;
}

View file

@ -186,7 +186,7 @@ class HaakonPlayKnightsFromGraveyardEffect extends AsThoughEffectImpl {
if (affectedControllerId.equals(source.getControllerId())) {
Card knightToCast = game.getCard(objectId);
if (knightToCast != null
&& knightToCast.hasSubtype("Knight")
&& knightToCast.hasSubtype("Knight", game)
&& knightToCast.getOwnerId().equals(source.getControllerId())
&& game.getState().getZone(objectId) == Zone.GRAVEYARD) {
return true;

View file

@ -110,7 +110,7 @@ class JokulmorderTriggeredAbility extends TriggeredAbilityImpl {
@Override
public boolean checkTrigger(GameEvent event, Game game) {
Permanent land = game.getPermanent(event.getTargetId());
return land.getSubtype().contains("Island")
return land.getSubtype(game).contains("Island")
&& land.getControllerId().equals(this.controllerId);
}

View file

@ -110,11 +110,11 @@ class TargetCardInLibrarySharingLandType extends TargetCardInLibrary {
if (landCard != null) {
if (landTypes == null) {
landTypes = new HashSet<>();
landTypes.addAll(landCard.getSubtype());
landTypes.addAll(landCard.getSubtype(game));
} else {
for (Iterator<String> iterator = landTypes.iterator(); iterator.hasNext();) {
String next = iterator.next();
if (!landCard.getSubtype().contains(next)) {
if (!landCard.getSubtype(game).contains(next)) {
iterator.remove();
}
}
@ -125,7 +125,7 @@ class TargetCardInLibrarySharingLandType extends TargetCardInLibrary {
if (card != null && landTypes != null) {
for (Iterator<String> iterator = landTypes.iterator(); iterator.hasNext();) {
String next = iterator.next();
if (card.getSubtype().contains(next)) {
if (card.getSubtype(game).contains(next)) {
return true;
}
}

View file

@ -158,8 +158,8 @@ class NecromanticSelectionContinuousEffect extends ContinuousEffectImpl {
switch (layer) {
case TypeChangingEffects_4:
if (sublayer == SubLayer.NA) {
if (!creature.getSubtype().contains("Zombie")) {
creature.getSubtype().add("Zombie");
if (!creature.getSubtype(game).contains("Zombie")) {
creature.getSubtype(game).add("Zombie");
}
}
break;

View file

@ -121,8 +121,8 @@ class BecomesColorlessForestLandEffect extends ContinuousEffectImpl {
case TypeChangingEffects_4:
permanent.getCardType().clear();
permanent.getCardType().add(CardType.LAND);
permanent.getSubtype().clear();
permanent.getSubtype().add("Forest");
permanent.getSubtype(game).clear();
permanent.getSubtype(game).add("Forest");
break;
}
return true;

View file

@ -97,7 +97,7 @@ class KasetoEffect extends OneShotEffect {
Permanent permanent = game.getPermanent(getTargetPointer().getFirst(game, source));
if (permanent != null) {
game.addEffect(new CantBeBlockedTargetEffect(Duration.EndOfTurn), source);
if (permanent.getSubtype().contains("Snake")) {
if (permanent.getSubtype(game).contains("Snake")) {
game.addEffect(new BoostTargetEffect(2,2,Duration.EndOfTurn), source);
}
return true;

View file

@ -117,8 +117,8 @@ public class DragonsoulKnight extends CardImpl {
switch (layer) {
case TypeChangingEffects_4:
if (sublayer == SubLayer.NA) {
permanent.getSubtype().clear();
permanent.getSubtype().add("Dragon");
permanent.getSubtype(game).clear();
permanent.getSubtype(game).add("Dragon");
}
break;
}

View file

@ -117,8 +117,8 @@ public class ParagonOfTheAmesha extends CardImpl {
switch (layer) {
case TypeChangingEffects_4:
if (sublayer == SubLayer.NA) {
permanent.getSubtype().clear();
permanent.getSubtype().add("Angel");
permanent.getSubtype(game).clear();
permanent.getSubtype(game).add("Angel");
}
break;
}

View file

@ -121,7 +121,7 @@ class IgnitionTeamToken extends Token {
public IgnitionTeamToken() {
super("", "4/4 red Elemental creature");
this.cardType.add(CardType.CREATURE);
this.getSubtype().add("Elemental");
this.getSubtype(null).add("Elemental");
this.color.setRed(true);
this.power = new MageInt(4);

View file

@ -103,7 +103,7 @@ class AvacynsCollarTriggeredAbility extends TriggeredAbilityImpl {
public boolean checkTrigger(GameEvent event, Game game) {
if (((ZoneChangeEvent) event).isDiesEvent()) {
Permanent permanent = (Permanent) game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD);
if (permanent.getAttachments().contains(this.getSourceId()) && permanent.hasSubtype("Human")) {
if (permanent.getAttachments().contains(this.getSourceId()) && permanent.hasSubtype("Human", game)) {
return true;
}
}

View file

@ -127,7 +127,7 @@ class CallToTheKindredEffect extends OneShotEffect {
if (!creature.getAbilities().contains(ChangelingAbility.getInstance())) {
StringBuilder sb = new StringBuilder("creature card with at least one subtype from: ");
ArrayList<Predicate<MageObject>> subtypes = new ArrayList<>();
for (String subtype : creature.getSubtype()) {
for (String subtype : creature.getSubtype(game)) {
subtypes.add(new SubtypePredicate(subtype));
sb.append(subtype).append(", ");
}

View file

@ -108,7 +108,7 @@ class CurseOfMisfortunesEffect extends OneShotEffect {
// get the names of attached Curses
for (UUID attachmentId: targetPlayer.getAttachments()) {
Permanent attachment = game.getPermanent(attachmentId);
if (attachment != null && attachment.getSubtype().contains("Curse")) {
if (attachment != null && attachment.getSubtype(game).contains("Curse")) {
filter.add(Predicates.not(new NamePredicate(attachment.getName())));
}
}

View file

@ -136,7 +136,7 @@ class CursesAttachedCount implements DynamicValue {
if (player != null) {
for (UUID attachmentId: player.getAttachments()) {
Permanent attachment = game.getPermanent(attachmentId);
if (attachment != null && attachment.getSubtype().contains("Curse"))
if (attachment != null && attachment.getSubtype(game).contains("Curse"))
count++;
}
}

View file

@ -89,7 +89,7 @@ class DeathsCaressEffect extends OneShotEffect {
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
Permanent creature = (Permanent) game.getLastKnownInformation(source.getFirstTarget(), Zone.BATTLEFIELD);
if (player != null && creature != null && creature.hasSubtype("Human")) {
if (player != null && creature != null && creature.hasSubtype("Human", game)) {
player.gainLife(creature.getToughness().getValue(), game);
return true;
}

View file

@ -106,7 +106,7 @@ class FalkenrathAristocratEffect extends OneShotEffect {
if (cost instanceof SacrificeTargetCost) {
Permanent sacrificedCreature = ((SacrificeTargetCost) cost).getPermanents().get(0);
Permanent sourceCreature = game.getPermanent(source.getSourceId());
if (sacrificedCreature.hasSubtype("Human") && sourceCreature != null) {
if (sacrificedCreature.hasSubtype("Human", game) && sourceCreature != null) {
sourceCreature.addCounters(CounterType.P1P1.createInstance(), game);
return true;
}

View file

@ -102,7 +102,7 @@ class FalkenrathTorturerEffect extends OneShotEffect {
if (cost instanceof SacrificeTargetCost) {
Permanent sacrificedCreature = ((SacrificeTargetCost) cost).getPermanents().get(0);
Permanent sourceCreature = game.getPermanent(source.getSourceId());
if (sacrificedCreature.hasSubtype("Human") && sourceCreature != null) {
if (sacrificedCreature.hasSubtype("Human", game) && sourceCreature != null) {
sourceCreature.addCounters(CounterType.P1P1.createInstance(), game);
return true;
}

View file

@ -96,7 +96,7 @@ class LostInTheWoodsEffect extends OneShotEffect {
controller.revealCards(sourceObject.getName(), cards, game);
if (card != null) {
if (card.getSubtype().contains("Forest")) {
if (card.getSubtype(game).contains("Forest")) {
Permanent permanent = game.getPermanent(targetPointer.getFirst(game, source));
if (permanent != null) {
permanent.removeFromCombat(game);

View file

@ -114,7 +114,7 @@ class MikaeusTheUnhallowedAbility extends TriggeredAbilityImpl {
public boolean checkTrigger(GameEvent event, Game game) {
if (event.getTargetId().equals(this.controllerId)) {
Permanent permanent = game.getPermanent(event.getSourceId());
if (permanent != null && permanent.hasSubtype("Human")) {
if (permanent != null && permanent.hasSubtype("Human", game)) {
this.getEffects().get(0).setTargetPointer(new FixedTarget(permanent.getId()));
return true;
}

View file

@ -100,7 +100,7 @@ class MurderousSpoilsEffect extends OneShotEffect {
List<Permanent> attachments = new ArrayList<Permanent>();
for (UUID uuid : target.getAttachments()) {
Permanent attached = game.getBattlefield().getPermanent(uuid);
if (attached.getSubtype().contains("Equipment")) {
if (attached.getSubtype(game).contains("Equipment")) {
attachments.add(attached);
}
}

View file

@ -115,7 +115,7 @@ class WireflyToken extends Token {
this.setOriginalExpansionSetCode("DST");
this.getPower().modifyBaseValue(2);
this.getToughness().modifyBaseValue(2);
this.getSubtype().add("Insect");
this.getSubtype(null).add("Insect");
this.getCardType().add(CardType.ARTIFACT);
this.getCardType().add(CardType.CREATURE);
}

View file

@ -114,7 +114,7 @@ class MazesEndEffect extends OneShotEffect {
public boolean apply(Game game, Ability source) {
List<String> names = new ArrayList<String>();
for (Permanent permanent : game.getBattlefield().getAllActivePermanents(source.getControllerId())) {
if (permanent.hasSubtype("Gate")) {
if (permanent.hasSubtype("Gate", game)) {
if (!names.contains(permanent.getName())) {
names.add(permanent.getName());
}

View file

@ -124,7 +124,7 @@ class HavenOfTheSpiritManaCondition extends CreatureCastManaCondition {
public boolean apply(Game game, Ability source, UUID manaProducer, Cost costToPay) {
if (super.apply(game, source)) {
MageObject object = game.getObject(source.getSourceId());
if (object.hasSubtype("Dragon")
if (object.hasSubtype("Dragon", game)
&& object.getCardType().contains(CardType.CREATURE)) {
return true;
}
@ -141,7 +141,7 @@ class DragonCreatureCardPredicate implements Predicate<Card> {
@Override
public boolean apply(Card input, Game game) {
return input.getCardType().contains(CardType.CREATURE)
&& input.getSubtype().contains("Dragon");
&& input.getSubtype(game).contains("Dragon");
}
@Override

View file

@ -89,7 +89,7 @@ class CemeteryRecruitmentEffect extends OneShotEffect {
Card card = game.getCard(targetPointer.getFirst(game, source));
if (card != null) {
if (controller.moveCards(card, Zone.HAND, source, game)
&& card.getSubtype().contains("Zombie")) {
&& card.getSubtype(game).contains("Zombie")) {
controller.drawCards(1, game);
}
}

View file

@ -110,7 +110,7 @@ class CoaxFromTheBlindEternitiesEffect extends OneShotEffect {
filteredCards.add(sideboardCard.getId());
}
for (Card exileCard : exile) {
if (exileCard.getOwnerId().equals(source.getControllerId()) && exileCard.hasSubtype("Eldrazi")) {
if (exileCard.getOwnerId().equals(source.getControllerId()) && exileCard.hasSubtype("Eldrazi", game)) {
filteredCards.add(exileCard);
}
}

View file

@ -175,7 +175,7 @@ class GisaAndGeralfWatcher extends Watcher {
public void watch(GameEvent event, Game game) {
if (event.getType() == GameEvent.EventType.SPELL_CAST && event.getZone() == Zone.GRAVEYARD) {
Spell spell = (Spell) game.getObject(event.getTargetId());
if (spell.getCardType().contains(CardType.CREATURE) && spell.getSubtype().contains("Zombie")) {
if (spell.getCardType().contains(CardType.CREATURE) && spell.getSubtype(game).contains("Zombie")) {
abilityUsed = true;
}
}

View file

@ -136,7 +136,7 @@ class BecomesColorlessLandEffect extends ContinuousEffectImpl {
permanent.getCardType().clear();
permanent.getCardType().add(CardType.LAND);
if (!isLand) {
permanent.getSubtype().clear();
permanent.getSubtype(game).clear();
}
break;
}

View file

@ -90,7 +90,7 @@ class SlayersCleaverEffect extends RequirementEffect {
@Override
public boolean applies(Permanent permanent, Ability source, Game game) {
return permanent.canBlock(source.getSourceId(), game) && permanent.hasSubtype("Eldrazi");
return permanent.canBlock(source.getSourceId(), game) && permanent.hasSubtype("Eldrazi", game);
}
@Override

View file

@ -85,7 +85,7 @@ class CamaridToken extends Token {
this.getPower().modifyBaseValue(1);
this.getToughness().modifyBaseValue(1);
this.color.setBlue(true);
this.getSubtype().add("Camarid");
this.getSubtype(null).add("Camarid");
this.getCardType().add(CardType.CREATURE);
}
}

View file

@ -115,7 +115,7 @@ class CrucibleOfTheSpiritDragonManaCondition implements Condition {
@Override
public boolean apply(Game game, Ability source) {
MageObject object = game.getObject(source.getSourceId());
if (object != null && object.hasSubtype("Dragon")) {
if (object != null && object.hasSubtype("Dragon", game)) {
return true;
}
return false;

View file

@ -86,7 +86,7 @@ class FearsomeAwakeningEffect extends OneShotEffect {
@Override
public boolean apply(Game game, Ability source) {
Permanent permanent = game.getPermanent(source.getFirstTarget());
if (permanent != null && permanent.hasSubtype("Dragon")) {
if (permanent != null && permanent.hasSubtype("Dragon", game)) {
permanent.addCounters(CounterType.P1P1.createInstance(2), game);
return true;
}

View file

@ -99,7 +99,7 @@ class MarduWoeReaperTriggeredAbility extends TriggeredAbilityImpl {
public boolean checkTrigger(GameEvent event, Game game) {
if (event.getPlayerId().equals(this.getControllerId())) {
Permanent permanent = game.getPermanent(event.getTargetId());
if (permanent != null && (permanent.getId().equals(this.getSourceId()) || permanent.hasSubtype("Warrior"))) {
if (permanent != null && (permanent.getId().equals(this.getSourceId()) || permanent.hasSubtype("Warrior", game))) {
return true;
}
}

View file

@ -96,7 +96,7 @@ class ChimericCoilsEffect extends ContinuousEffectImpl {
case TypeChangingEffects_4:
if (sublayer == SubLayer.NA) {
permanent.getCardType().add(CardType.CREATURE);
permanent.getSubtype().add("Construct");
permanent.getSubtype(game).add("Construct");
}
break;
case PTChangingEffects_7:

View file

@ -99,7 +99,7 @@ class CantBeEquippedSourceEffect extends ContinuousRuleModifyingEffectImpl {
public boolean applies(GameEvent event, Ability source, Game game) {
if (event.getTargetId().equals(source.getSourceId())) {
Permanent permanent = game.getPermanent(event.getSourceId());
if (permanent != null && permanent.getSubtype().contains("Equipment")) {
if (permanent != null && permanent.getSubtype(game).contains("Equipment")) {
return true;
}
}

View file

@ -118,8 +118,8 @@ class MephidrossVampireEffect extends ContinuousEffectImpl {
creature.addAbility(new DealsDamageToACreatureTriggeredAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance()), false, false, false), source.getSourceId(), game);
break;
case TypeChangingEffects_4:
if (!creature.getSubtype().contains("Vampire")) {
creature.getSubtype().add("Vampire");
if (!creature.getSubtype(game).contains("Vampire")) {
creature.getSubtype(game).add("Vampire");
}
break;
}

View file

@ -135,7 +135,7 @@ class SirensCallDestroyEffect extends OneShotEffect {
if (player != null) {
for (Permanent permanent : game.getBattlefield().getAllActivePermanents(player.getId())) {
// Walls are safe.
if (permanent.getSubtype().contains("Wall")) {
if (permanent.getSubtype(game).contains("Wall")) {
continue;
}
// Creatures that attacked are safe.

View file

@ -115,7 +115,7 @@ class AuraAttachedPredicate implements Predicate<Permanent> {
if (!uuid.equals(ownId)) {
Permanent attachment = game.getPermanent(uuid);
if (attachment != null
&& attachment.getSubtype().contains("Aura")) {
&& attachment.getSubtype(game).contains("Aura")) {
return true;
}
}

View file

@ -113,8 +113,8 @@ public class MagusOfTheMoon extends CardImpl {
// 305.7 Note that this doesn't remove any abilities that were granted to the land by other effects
// So the ability removing has to be done before Layer 6
land.removeAllAbilities(source.getSourceId(), game);
land.getSubtype().removeAll(CardRepository.instance.getLandTypes());
land.getSubtype().add("Mountain");
land.getSubtype(game).removeAll(CardRepository.instance.getLandTypes());
land.getSubtype(game).add("Mountain");
break;
case AbilityAddingRemovingEffects_6:
land.addAbility(new RedManaAbility(), source.getSourceId(), game);

View file

@ -92,7 +92,7 @@ class DeathcultRogueRestrictionEffect extends RestrictionEffect {
@Override
public boolean canBeBlocked(Permanent attacker, Permanent blocker, Ability source, Game game) {
if (blocker.getSubtype().contains("Rogue")) {
if (blocker.getSubtype(game).contains("Rogue")) {
return true;
}
return false;

View file

@ -70,7 +70,7 @@ class HydroformToken extends Token {
public HydroformToken() {
super("", "3/3 Elemental creature with flying");
this.cardType.add(CardType.CREATURE);
this.getSubtype().add("Elemental");
this.getSubtype(null).add("Elemental");
this.power = new MageInt(3);
this.toughness = new MageInt(3);

View file

@ -129,10 +129,10 @@ class LazavDimirEffect extends ContinuousEffectImpl {
permanent.getCardType().add(type);
}
}
permanent.getSubtype().clear();
for (String type : cardToCopy.getSubtype()) {
if (!permanent.getSubtype().contains(type)) {
permanent.getSubtype().add(type);
permanent.getSubtype(game).clear();
for (String type : cardToCopy.getSubtype(game)) {
if (!permanent.getSubtype(game).contains(type)) {
permanent.getSubtype(game).add(type);
}
}
permanent.getSupertype().clear();

View file

@ -119,7 +119,7 @@ class OrzhovCharmReturnToHandEffect extends OneShotEffect {
for (UUID attachmentId : attachments) {
Permanent attachment = game.getPermanent(attachmentId);
if (attachment != null && attachment.getControllerId().equals(source.getControllerId())
&& attachment.getSubtype().contains("Aura")) {
&& attachment.getSubtype(game).contains("Aura")) {
attachment.moveToZone(Zone.HAND, source.getSourceId(), game, false);
}
}

View file

@ -111,8 +111,8 @@ class RealmwrightEffect2 extends ContinuousEffectImpl {
if (land != null) {
switch (layer) {
case TypeChangingEffects_4:
if (sublayer == SubLayer.NA && !land.getSubtype().contains(choice)) {
land.getSubtype().add(choice);
if (sublayer == SubLayer.NA && !land.getSubtype(game).contains(choice)) {
land.getSubtype(game).add(choice);
}
break;
case AbilityAddingRemovingEffects_6:

View file

@ -94,7 +94,7 @@ class SkeletonToken extends Token {
this.getPower().modifyBaseValue(1);
this.getToughness().modifyBaseValue(1);
this.color.setBlack(true);
this.getSubtype().add("Skeleton");
this.getSubtype(null).add("Skeleton");
this.getCardType().add(CardType.CREATURE);
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new RegenerateSourceEffect(), new ManaCostsImpl("{B}")));

View file

@ -103,19 +103,19 @@ class NakedSingularityEffect extends ReplacementEffectImpl {
Permanent permanent = game.getPermanent(event.getSourceId());
Choice choice = new ChoiceImpl(true);
choice.setMessage("Pick a color to produce");
if (permanent.hasSubtype("Plains")) {
if (permanent.hasSubtype("Plains", game)) {
choice.getChoices().add("Red");
}
if (permanent.hasSubtype("Island")) {
if (permanent.hasSubtype("Island", game)) {
choice.getChoices().add("Green");
}
if (permanent.hasSubtype("Swamp")) {
if (permanent.hasSubtype("Swamp", game)) {
choice.getChoices().add("White");
}
if (permanent.hasSubtype("Mountain")) {
if (permanent.hasSubtype("Mountain", game)) {
choice.getChoices().add("Blue");
}
if (permanent.hasSubtype("Forest")) {
if (permanent.hasSubtype("Forest", game)) {
choice.getChoices().add("Black");
}
String chosenColor;
@ -159,10 +159,10 @@ class NakedSingularityEffect extends ReplacementEffectImpl {
public boolean applies(GameEvent event, Ability source, Game game) {
Permanent permanent = game.getPermanent(event.getSourceId());
return permanent != null
&& (permanent.hasSubtype("Plains")
|| permanent.hasSubtype("Island")
|| permanent.hasSubtype("Swamp")
|| permanent.hasSubtype("Mountain")
|| permanent.hasSubtype("Forest"));
&& (permanent.hasSubtype("Plains", game)
|| permanent.hasSubtype("Island", game)
|| permanent.hasSubtype("Swamp", game)
|| permanent.hasSubtype("Mountain", game)
|| permanent.hasSubtype("Forest", game));
}
}

View file

@ -94,7 +94,7 @@ class DearlyDepartedEntersBattlefieldEffect extends ReplacementEffectImpl {
@Override
public boolean applies(GameEvent event, Ability source, Game game) {
Permanent permanent = ((EntersTheBattlefieldEvent) event).getTarget();
if (permanent != null && permanent.getControllerId().equals(source.getControllerId()) && permanent.hasSubtype("Human")) {
if (permanent != null && permanent.getControllerId().equals(source.getControllerId()) && permanent.hasSubtype("Human", game)) {
return true;
}
return false;

View file

@ -96,7 +96,7 @@ class ElderCatharAddCountersTargetEffect extends OneShotEffect {
Permanent permanent = game.getPermanent(targetPointer.getFirst(game, source));
if (permanent != null) {
if (counter != null) {
if (permanent.hasSubtype("Human")) {
if (permanent.hasSubtype("Human", game)) {
permanent.addCounters(counter2.copy(), game);
} else {
permanent.addCounters(counter.copy(), game);

View file

@ -159,7 +159,7 @@ class GrimoireOfTheDeadEffect2 extends ContinuousEffectImpl {
break;
case TypeChangingEffects_4:
if (sublayer == SubLayer.NA) {
permanent.getSubtype().add("Zombie");
permanent.getSubtype(game).add("Zombie");
}
break;
}

View file

@ -96,7 +96,7 @@ class RakishHeirTriggeredAbility extends TriggeredAbilityImpl {
DamagedPlayerEvent damageEvent = (DamagedPlayerEvent) event;
Permanent permanent = game.getPermanent(event.getSourceId());
if (damageEvent.isCombatDamage() && permanent != null
&& permanent.hasSubtype("Vampire") && permanent.getControllerId().equals(controllerId)) {
&& permanent.hasSubtype("Vampire", game) && permanent.getControllerId().equals(controllerId)) {
this.getEffects().clear();
AddCountersTargetEffect effect = new AddCountersTargetEffect(CounterType.P1P1.createInstance());
effect.setTargetPointer(new FixedTarget(permanent.getId()));

View file

@ -95,7 +95,7 @@ class RooftopStormCostReductionEffect extends CostModificationEffectImpl {
Ability spell = abilityToModify;
if (spell.getControllerId().equals(source.getControllerId())) {
Card sourceCard = game.getCard(spell.getSourceId());
if (sourceCard != null && sourceCard.hasSubtype("Zombie")) {
if (sourceCard != null && sourceCard.hasSubtype("Zombie", game)) {
Player player = game.getPlayer(spell.getControllerId());
if (player != null &&
(CardUtil.isCheckPlayableMode(spell) || player.chooseUse(Outcome.Benefit, "Pay {0} rather than pay the mana cost for Zombie creature", source, game))) {

View file

@ -152,7 +152,7 @@ class UndeadAlchemistEffect extends ReplacementEffectImpl {
DamagePlayerEvent damageEvent = (DamagePlayerEvent) event;
if (damageEvent.isCombatDamage()) {
Permanent permanent = game.getPermanent(event.getSourceId());
if (permanent != null && permanent.hasSubtype("Zombie")) {
if (permanent != null && permanent.hasSubtype("Zombie", game)) {
return true;
}
}

View file

@ -95,7 +95,7 @@ class VillageCannibalsTriggeredAbility extends TriggeredAbilityImpl {
ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
if (zEvent.getFromZone() == Zone.BATTLEFIELD && zEvent.getToZone() == Zone.GRAVEYARD) {
Permanent permanent = (Permanent) game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD);
if (permanent != null && permanent.getCardType().contains(CardType.CREATURE) && permanent.hasSubtype("Human")
if (permanent != null && permanent.getCardType().contains(CardType.CREATURE) && permanent.hasSubtype("Human", game)
&& !permanent.getId().equals(this.getSourceId())) {
return true;
}

View file

@ -88,7 +88,7 @@ class WitchbaneOrbEffect extends OneShotEffect {
if (player != null) {
for (UUID attachmentId: player.getAttachments()) {
Permanent attachment = game.getPermanent(attachmentId);
if (attachment != null && attachment.getSubtype().contains("Curse")) {
if (attachment != null && attachment.getSubtype(game).contains("Curse")) {
attachment.destroy(source.getSourceId(), game, false);
}
}

View file

@ -97,7 +97,7 @@ class WoodenStakeBlocksOrBecomesBlockedTriggeredAbility extends TriggeredAbility
if (equipment != null && equipment.getAttachedTo() != null) {
if (event.getSourceId().equals(equipment.getAttachedTo())) {
Permanent blocks = game.getPermanent(event.getTargetId());
if (blocks != null && blocks.hasSubtype("Vampire")) {
if (blocks != null && blocks.hasSubtype("Vampire", game)) {
for (Effect effect : this.getEffects()) {
effect.setTargetPointer(new FixedTarget(event.getTargetId()));
}
@ -107,7 +107,7 @@ class WoodenStakeBlocksOrBecomesBlockedTriggeredAbility extends TriggeredAbility
}
if (event.getTargetId().equals(equipment.getAttachedTo())) {
Permanent blockedBy = game.getPermanent(event.getSourceId());
if (blockedBy != null && blockedBy.hasSubtype("Vampire")) {
if (blockedBy != null && blockedBy.hasSubtype("Vampire", game)) {
for (Effect effect : this.getEffects()) {
effect.setTargetPointer(new FixedTarget(event.getSourceId()));
}

View file

@ -92,7 +92,7 @@ class DeicideExileEffect extends SearchTargetGraveyardHandLibraryForCardNameAndE
// if it is a God. For each of the Gods in the Theros block, it wont matter what your
// devotion to its color(s) was. The card is a God card when not on the battlefield.
Card cardInExile = game.getExile().getCard(targetEnchantment.getId(), game);
if (cardInExile != null && cardInExile.hasSubtype("God")) {
if (cardInExile != null && cardInExile.hasSubtype("God", game)) {
Player enchantmentController = game.getPlayer(targetEnchantment.getControllerId());
return super.applySearchAndExile(game, source, cardInExile.getName(), enchantmentController.getId());
}

View file

@ -99,7 +99,7 @@ class SilenceTheBelieversExileEffect extends OneShotEffect {
ArrayList<UUID> attachments = new ArrayList<>(creature.getAttachments());
for (UUID attachmentId: attachments) {
Permanent attachment = game.getPermanent(attachmentId);
if (attachment != null && attachment.getSubtype().contains("Aura")) {
if (attachment != null && attachment.getSubtype(game).contains("Aura")) {
controller.moveCardToExileWithInfo(attachment, null, null, source.getSourceId(), game, Zone.BATTLEFIELD, true);
}
}

View file

@ -96,7 +96,7 @@ class RaidersSpoilsTriggeredAbility extends TriggeredAbilityImpl {
public boolean checkTrigger(GameEvent event, Game game) {
DamagedPlayerEvent damageEvent = (DamagedPlayerEvent) event;
Permanent permanent = game.getPermanent(event.getSourceId());
if (damageEvent.isCombatDamage() && permanent != null && permanent.hasSubtype("Warrior") && permanent.getControllerId().equals(controllerId)) {
if (damageEvent.isCombatDamage() && permanent != null && permanent.hasSubtype("Warrior", game) && permanent.getControllerId().equals(controllerId)) {
return true;
}
return false;

View file

@ -126,8 +126,8 @@ class SarkhanTheDragonspeakerEffect extends ContinuousEffectImpl {
if (sublayer == SubLayer.NA) {
permanent.getCardType().clear();
permanent.getCardType().add(CardType.CREATURE);
permanent.getSubtype().clear();
permanent.getSubtype().add("Dragon");
permanent.getSubtype(game).clear();
permanent.getSubtype(game).add("Dragon");
permanent.getSupertype().clear();
permanent.getSupertype().add("Legendary");
}

View file

@ -114,7 +114,7 @@ class BartelRuneaxeEffect extends ContinuousRuleModifyingEffectImpl {
public boolean applies(GameEvent event, Ability source, Game game) {
StackObject stackObject = (StackObject) game.getStack().getStackObject(event.getSourceId());
if (stackObject != null && event.getTargetId().equals(source.getSourceId())) {
if (stackObject.getSubtype().contains("Aura")) {
if (stackObject.getSubtype(game).contains("Aura")) {
return true;
}
}

View file

@ -135,7 +135,7 @@ class TetsuoUmezawaEffect extends ContinuousRuleModifyingEffectImpl {
public boolean applies(GameEvent event, Ability source, Game game) {
StackObject stackObject = (StackObject) game.getStack().getStackObject(event.getSourceId());
if (stackObject != null && event.getTargetId().equals(source.getSourceId())) {
if (stackObject.getSubtype().contains("Aura")) {
if (stackObject.getSubtype(game).contains("Aura")) {
return true;
}
}

View file

@ -97,7 +97,7 @@ class GoblinAssassinTriggeredAbiliy extends TriggeredAbilityImpl {
public boolean checkTrigger(GameEvent event, Game game) {
UUID targetId = event.getTargetId();
Permanent permanent = game.getPermanent(targetId);
if ((targetId.equals(this.getSourceId())) || (permanent.hasSubtype("Goblin") && !targetId.equals(this.getSourceId()))) {
if ((targetId.equals(this.getSourceId())) || (permanent.hasSubtype("Goblin", game) && !targetId.equals(this.getSourceId()))) {
return true;
}
return false;

View file

@ -97,7 +97,7 @@ class DealsDamageTriggeredAbility extends TriggeredAbilityImpl {
@Override
public boolean checkTrigger(GameEvent event, Game game) {
if (game.getPermanent(event.getSourceId()).hasSubtype("Sliver")) {
if (game.getPermanent(event.getSourceId()).hasSubtype("Sliver", game)) {
if (setTargetPointer) {
for (Effect effect : this.getEffects()) {
effect.setTargetPointer(new FixedTarget(game.getControllerId(event.getTargetId())));

View file

@ -112,8 +112,8 @@ public class Conversion extends CardImpl {
land.addAbility(new WhiteManaAbility(), source.getSourceId(), game);
break;
case TypeChangingEffects_4:
land.getSubtype().clear();
land.getSubtype().add("Plains");
land.getSubtype(game).clear();
land.getSubtype(game).add("Plains");
break;
}
}

View file

@ -101,7 +101,7 @@ class CantBeBlockedByWallsEffect extends RestrictionEffect {
@Override
public boolean canBeBlocked(Permanent attacker, Permanent blocker, Ability source, Game game) {
if (!blocker.hasSubtype("Wall")) {
if (!blocker.hasSubtype("Wall", game)) {
return false;
}
return true;

View file

@ -113,8 +113,8 @@ class PhantasmalTerrainContinuousEffect extends ContinuousEffectImpl {
switch (layer) {
case TypeChangingEffects_4:
if (sublayer == SubLayer.NA) {
land.getSubtype().clear();
land.getSubtype().add(choice);
land.getSubtype(game).clear();
land.getSubtype(game).add(choice);
}
break;
case AbilityAddingRemovingEffects_6:

View file

@ -110,7 +110,7 @@ class EgoErasureLoseEffect extends ContinuousEffectImpl {
for (Iterator<MageObjectReference> it = affectedObjectList.iterator(); it.hasNext();) {
Permanent permanent = it.next().getPermanent(game);
if (permanent != null) {
permanent.getSubtype().retainAll(CardRepository.instance.getLandTypes());
permanent.getSubtype(game).retainAll(CardRepository.instance.getLandTypes());
} else {
it.remove();
}

View file

@ -108,7 +108,7 @@ class MistbindCliqueAbility extends ZoneChangeTriggeredAbility {
&& event.getSourceId().equals(getSourceId())
&& !event.getSourceId().equals(event.getTargetId())) {
ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
if (zEvent.getTarget() != null && zEvent.getTarget().hasSubtype("Faerie")) {
if (zEvent.getTarget() != null && zEvent.getTarget().hasSubtype("Faerie", game)) {
return true;
}
}

View file

@ -92,16 +92,16 @@ class CoatOfArmsEffect extends ContinuousEffectImpl {
public boolean apply(Game game, Ability source) {
List<Permanent> permanents = game.getBattlefield().getActivePermanents(filter, source.getControllerId(), game);
for (Permanent permanent : permanents) {
int amount = getAmount(permanents, permanent);
int amount = getAmount(permanents, permanent, game);
permanent.addPower(amount);
permanent.addToughness(amount);
}
return true;
}
private int getAmount(List<Permanent> permanents, Permanent target) {
private int getAmount(List<Permanent> permanents, Permanent target, Game game) {
int amount = 0;
List<String> targetSubtype = target.getSubtype();
List<String> targetSubtype = target.getSubtype(game);
if (target.getAbilities().contains(ChangelingAbility.getInstance())) {
return permanents.size() - 1;
}
@ -109,7 +109,7 @@ class CoatOfArmsEffect extends ContinuousEffectImpl {
if (!permanent.getId().equals(target.getId())) {
for (String subtype : targetSubtype) {
if (!CardUtil.isNonCreatureSubtype(subtype)) {
if (permanent.hasSubtype(subtype)) {
if (permanent.hasSubtype(subtype, game)) {
amount++;
break;
}

View file

@ -112,8 +112,8 @@ class ConvincingMirageContinousEffect extends ContinuousEffectImpl {
switch (layer) {
case TypeChangingEffects_4:
if (sublayer == SubLayer.NA) {
land.getSubtype().clear();
land.getSubtype().add(choice);
land.getSubtype(game).clear();
land.getSubtype(game).add(choice);
}
break;
case AbilityAddingRemovingEffects_6:

View file

@ -93,7 +93,7 @@ class RiseFromTheGraveEffect extends ContinuousEffectImpl {
switch (layer) {
case TypeChangingEffects_4:
if (sublayer == SubLayer.NA) {
creature.getSubtype().add("Zombie");
creature.getSubtype(game).add("Zombie");
}
break;
case ColorChangingEffects_5:

View file

@ -124,8 +124,8 @@ class CaptivatingVampireEffect extends ContinuousEffectImpl {
break;
case TypeChangingEffects_4:
if (sublayer == SubLayer.NA) {
if (!permanent.getSubtype().contains("Vampire")) {
permanent.getSubtype().add("Vampire");
if (!permanent.getSubtype(game).contains("Vampire")) {
permanent.getSubtype(game).add("Vampire");
}
}
break;

View file

@ -114,8 +114,8 @@ class StormtideLeviathanEffect extends ContinuousEffectImpl {
for (Permanent land : game.getBattlefield().getActivePermanents(new FilterLandPermanent(), source.getControllerId(), game)) {
switch (layer) {
case TypeChangingEffects_4:
if (!land.getSubtype().contains("Island")) {
land.getSubtype().add("Island");
if (!land.getSubtype(game).contains("Island")) {
land.getSubtype(game).add("Island");
}
break;
case AbilityAddingRemovingEffects_6:

Some files were not shown because too many files have changed in this diff Show more