mirror of
https://github.com/correl/mage.git
synced 2025-04-08 01:01:04 -09:00
[BRC] Implement Rootpath Purifier (ready for review) (#10363)
* refactor check supertype methods * change supertype to list to match card type * refactor various subtype methods * implement mageobjectattribute for supertype * a few fixes * [BRC] Implement Rootpath Purifier * a few extra fixes * more fixes * add test for purifier
This commit is contained in:
parent
a850e3660b
commit
024c3081df
98 changed files with 489 additions and 238 deletions
Mage.Common/src/main/java/mage/view
Mage.Sets/src/mage
cards
a
b
c
d
e
f
g
h
i
j
k
l
m
o
p
r
s
SarkhanTheDragonspeaker.javaScryingSheets.javaSearchForGlory.javaShelteringPrayers.javaSparkDouble.javaSplittingThePowerstone.java
t
TalesEnd.javaTezzeretCruelMachinist.javaTheKenrithsRoyalFuneral.javaThePeregrineDynamo.javaThermalFlux.javaThermokarst.java
u
v
y
sets
Mage.Tests/src/test/java/org/mage/test/cards
copy
cost/modaldoublefaces
single/brc
Mage.Verify/src/test/java/mage/verify
Mage/src/main/java/mage
MageObject.javaMageObjectImpl.java
abilities
cards
constants
designations
filter/predicate/card
game
watchers/common
|
@ -1,12 +1,11 @@
|
||||||
package mage.view;
|
package mage.view;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.EnumSet;
|
|
||||||
import mage.ObjectColor;
|
import mage.ObjectColor;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.constants.SuperType;
|
|
||||||
import mage.util.SubTypes;
|
import mage.util.SubTypes;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author BetaSteward_at_googlemail.com
|
* @author BetaSteward_at_googlemail.com
|
||||||
*/
|
*/
|
||||||
|
@ -30,7 +29,7 @@ public class AbilityView extends CardView {
|
||||||
this.defense = "";
|
this.defense = "";
|
||||||
this.cardTypes = new ArrayList<>();
|
this.cardTypes = new ArrayList<>();
|
||||||
this.subTypes = new SubTypes();
|
this.subTypes = new SubTypes();
|
||||||
this.superTypes = EnumSet.noneOf(SuperType.class);
|
this.superTypes = new ArrayList<>();
|
||||||
this.color = new ObjectColor();
|
this.color = new ObjectColor();
|
||||||
this.manaCostLeftStr = String.join("", ability.getManaCostSymbols());
|
this.manaCostLeftStr = String.join("", ability.getManaCostSymbols());
|
||||||
this.manaCostRightStr = "";
|
this.manaCostRightStr = "";
|
||||||
|
|
|
@ -71,7 +71,7 @@ public class CardView extends SimpleCardView {
|
||||||
protected String startingDefense;
|
protected String startingDefense;
|
||||||
protected List<CardType> cardTypes;
|
protected List<CardType> cardTypes;
|
||||||
protected SubTypes subTypes;
|
protected SubTypes subTypes;
|
||||||
protected Set<SuperType> superTypes;
|
protected List<SuperType> superTypes;
|
||||||
protected ObjectColor color;
|
protected ObjectColor color;
|
||||||
protected ObjectColor frameColor;
|
protected ObjectColor frameColor;
|
||||||
protected FrameStyle frameStyle;
|
protected FrameStyle frameStyle;
|
||||||
|
@ -256,7 +256,7 @@ public class CardView extends SimpleCardView {
|
||||||
|
|
||||||
private static String getCardTypeLine(Game game, Card card) {
|
private static String getCardTypeLine(Game game, Card card) {
|
||||||
StringBuilder sbType = new StringBuilder();
|
StringBuilder sbType = new StringBuilder();
|
||||||
for (SuperType superType : card.getSuperType()) {
|
for (SuperType superType : card.getSuperType(game)) {
|
||||||
sbType.append(superType).append(' ');
|
sbType.append(superType).append(' ');
|
||||||
}
|
}
|
||||||
for (CardType cardType : card.getCardType(game)) {
|
for (CardType cardType : card.getCardType(game)) {
|
||||||
|
@ -479,7 +479,7 @@ public class CardView extends SimpleCardView {
|
||||||
this.toughness = Integer.toString(card.getToughness().getValue());
|
this.toughness = Integer.toString(card.getToughness().getValue());
|
||||||
this.cardTypes = new ArrayList<>(card.getCardType(game));
|
this.cardTypes = new ArrayList<>(card.getCardType(game));
|
||||||
this.subTypes = new SubTypes(card.getSubtype(game));
|
this.subTypes = new SubTypes(card.getSubtype(game));
|
||||||
this.superTypes = card.getSuperType();
|
this.superTypes = card.getSuperType(game);
|
||||||
this.color = card.getColor(game).copy();
|
this.color = card.getColor(game).copy();
|
||||||
this.flipCard = card.isFlipCard();
|
this.flipCard = card.isFlipCard();
|
||||||
this.faceDown = !showFaceUp;
|
this.faceDown = !showFaceUp;
|
||||||
|
@ -626,7 +626,7 @@ public class CardView extends SimpleCardView {
|
||||||
}
|
}
|
||||||
this.cardTypes = new ArrayList<>(object.getCardType(game));
|
this.cardTypes = new ArrayList<>(object.getCardType(game));
|
||||||
this.subTypes = new SubTypes(object.getSubtype(game));
|
this.subTypes = new SubTypes(object.getSubtype(game));
|
||||||
this.superTypes = object.getSuperType();
|
this.superTypes = new ArrayList<>(object.getSuperType(game));
|
||||||
this.color = object.getColor(game).copy();
|
this.color = object.getColor(game).copy();
|
||||||
this.manaCostLeftStr = String.join("", object.getManaCostSymbols());
|
this.manaCostLeftStr = String.join("", object.getManaCostSymbols());
|
||||||
this.manaCostRightStr = "";
|
this.manaCostRightStr = "";
|
||||||
|
@ -778,7 +778,7 @@ public class CardView extends SimpleCardView {
|
||||||
this.startingDefense = "";
|
this.startingDefense = "";
|
||||||
this.cardTypes = new ArrayList<>();
|
this.cardTypes = new ArrayList<>();
|
||||||
this.subTypes = new SubTypes();
|
this.subTypes = new SubTypes();
|
||||||
this.superTypes = EnumSet.noneOf(SuperType.class);
|
this.superTypes = new ArrayList<>();
|
||||||
this.color = new ObjectColor();
|
this.color = new ObjectColor();
|
||||||
this.frameColor = new ObjectColor();
|
this.frameColor = new ObjectColor();
|
||||||
this.frameStyle = FrameStyle.M15_NORMAL;
|
this.frameStyle = FrameStyle.M15_NORMAL;
|
||||||
|
@ -830,7 +830,7 @@ public class CardView extends SimpleCardView {
|
||||||
this.startingDefense = "";
|
this.startingDefense = "";
|
||||||
this.cardTypes = new ArrayList<>(token.getCardType(game));
|
this.cardTypes = new ArrayList<>(token.getCardType(game));
|
||||||
this.subTypes = new SubTypes(token.getSubtype(game));
|
this.subTypes = new SubTypes(token.getSubtype(game));
|
||||||
this.superTypes = token.getSuperType();
|
this.superTypes = new ArrayList<>(token.getSuperType(game));
|
||||||
this.color = token.getColor(game).copy();
|
this.color = token.getColor(game).copy();
|
||||||
this.frameColor = token.getFrameColor(game).copy();
|
this.frameColor = token.getFrameColor(game).copy();
|
||||||
this.frameStyle = token.getFrameStyle();
|
this.frameStyle = token.getFrameStyle();
|
||||||
|
@ -939,7 +939,7 @@ public class CardView extends SimpleCardView {
|
||||||
return subTypes;
|
return subTypes;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Set<SuperType> getSuperTypes() {
|
public List<SuperType> getSuperTypes() {
|
||||||
return superTypes;
|
return superTypes;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -47,13 +47,13 @@ public class StackAbilityView extends CardView {
|
||||||
|
|
||||||
this.cardTypes = ability.getCardType(game);
|
this.cardTypes = ability.getCardType(game);
|
||||||
this.subTypes = ability.getSubtype(game);
|
this.subTypes = ability.getSubtype(game);
|
||||||
this.superTypes = ability.getSuperType();
|
this.superTypes = ability.getSuperType(game);
|
||||||
this.color = ability.getColor(game);
|
this.color = ability.getColor(game);
|
||||||
this.manaCostLeftStr = String.join("", ability.getManaCostSymbols());
|
this.manaCostLeftStr = String.join("", ability.getManaCostSymbols());
|
||||||
this.manaCostRightStr = "";
|
this.manaCostRightStr = "";
|
||||||
this.cardTypes = ability.getCardType(game);
|
this.cardTypes = ability.getCardType(game);
|
||||||
this.subTypes = ability.getSubtype(game);
|
this.subTypes = ability.getSubtype(game);
|
||||||
this.superTypes = ability.getSuperType();
|
this.superTypes = ability.getSuperType(game);
|
||||||
this.color = ability.getColor(game);
|
this.color = ability.getColor(game);
|
||||||
this.power = ability.getPower().toString();
|
this.power = ability.getPower().toString();
|
||||||
this.toughness = ability.getToughness().toString();
|
this.toughness = ability.getToughness().toString();
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
package mage.cards.a;
|
package mage.cards.a;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.MageInt;
|
import mage.MageInt;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.common.EntersBattlefieldAbility;
|
import mage.abilities.common.EntersBattlefieldAbility;
|
||||||
|
@ -8,10 +7,10 @@ import mage.abilities.common.SimpleStaticAbility;
|
||||||
import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount;
|
import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount;
|
||||||
import mage.abilities.effects.ContinuousEffectImpl;
|
import mage.abilities.effects.ContinuousEffectImpl;
|
||||||
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
|
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
|
||||||
import mage.constants.*;
|
|
||||||
import mage.abilities.keyword.StormAbility;
|
import mage.abilities.keyword.StormAbility;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
|
import mage.constants.*;
|
||||||
import mage.counters.CounterType;
|
import mage.counters.CounterType;
|
||||||
import mage.filter.common.FilterControlledPermanent;
|
import mage.filter.common.FilterControlledPermanent;
|
||||||
import mage.filter.predicate.mageobject.AnotherPredicate;
|
import mage.filter.predicate.mageobject.AnotherPredicate;
|
||||||
|
@ -19,8 +18,9 @@ import mage.game.Game;
|
||||||
import mage.game.permanent.Permanent;
|
import mage.game.permanent.Permanent;
|
||||||
import mage.game.permanent.PermanentToken;
|
import mage.game.permanent.PermanentToken;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author weirddan455
|
* @author weirddan455
|
||||||
*/
|
*/
|
||||||
public final class AeveProgenitorOoze extends CardImpl {
|
public final class AeveProgenitorOoze extends CardImpl {
|
||||||
|
@ -82,7 +82,7 @@ class AeveProgenitorOozeNonLegendaryEffect extends ContinuousEffectImpl {
|
||||||
public boolean apply(Game game, Ability source) {
|
public boolean apply(Game game, Ability source) {
|
||||||
Permanent permanent = game.getPermanent(source.getSourceId());
|
Permanent permanent = game.getPermanent(source.getSourceId());
|
||||||
if (permanent instanceof PermanentToken) {
|
if (permanent instanceof PermanentToken) {
|
||||||
permanent.getSuperType().remove(SuperType.LEGENDARY);
|
permanent.removeSuperType(game, SuperType.LEGENDARY);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -99,7 +99,7 @@ class EchoingEquationEffect extends OneShotEffect {
|
||||||
.forEach(copyTo -> game.copyPermanent(Duration.EndOfTurn, copyFrom, copyTo.getId(), source, new CopyApplier() {
|
.forEach(copyTo -> game.copyPermanent(Duration.EndOfTurn, copyFrom, copyTo.getId(), source, new CopyApplier() {
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(Game game, MageObject blueprint, Ability source, UUID targetObjectId) {
|
public boolean apply(Game game, MageObject blueprint, Ability source, UUID targetObjectId) {
|
||||||
blueprint.getSuperType().remove(SuperType.LEGENDARY);
|
blueprint.removeSuperType(SuperType.LEGENDARY);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
|
|
|
@ -100,7 +100,7 @@ class BardClassReplacementEffect extends ReplacementEffectImpl {
|
||||||
return creature != null
|
return creature != null
|
||||||
&& creature.isControlledBy(source.getControllerId())
|
&& creature.isControlledBy(source.getControllerId())
|
||||||
&& creature.isCreature(game)
|
&& creature.isCreature(game)
|
||||||
&& creature.isLegendary();
|
&& creature.isLegendary(game);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -56,7 +56,7 @@ enum BreakTheIcePredicate implements Predicate<Permanent> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(Permanent input, Game game) {
|
public boolean apply(Permanent input, Game game) {
|
||||||
return input.isSnow()
|
return input.isSnow(game)
|
||||||
|| input
|
|| input
|
||||||
.getAbilities()
|
.getAbilities()
|
||||||
.getActivatedManaAbilities(Zone.BATTLEFIELD)
|
.getActivatedManaAbilities(Zone.BATTLEFIELD)
|
||||||
|
|
|
@ -69,7 +69,7 @@ class ChokingSandsEffect extends OneShotEffect {
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(Game game, Ability source) {
|
public boolean apply(Game game, Ability source) {
|
||||||
Permanent permanent = (Permanent) game.getLastKnownInformation(source.getFirstTarget(), Zone.BATTLEFIELD);
|
Permanent permanent = (Permanent) game.getLastKnownInformation(source.getFirstTarget(), Zone.BATTLEFIELD);
|
||||||
if (permanent != null && !permanent.isBasic()) {
|
if (permanent != null && !permanent.isBasic(game)) {
|
||||||
Player player = game.getPlayer(permanent.getControllerId());
|
Player player = game.getPlayer(permanent.getControllerId());
|
||||||
if (player != null) {
|
if (player != null) {
|
||||||
player.damage(2, source.getSourceId(), source, game);
|
player.damage(2, source.getSourceId(), source, game);
|
||||||
|
|
|
@ -80,7 +80,7 @@ class CorneredMarketReplacementEffect extends ContinuousRuleModifyingEffectImpl
|
||||||
}
|
}
|
||||||
// play land check
|
// play land check
|
||||||
if (card.isLand(game)
|
if (card.isLand(game)
|
||||||
&& !card.isBasic()) {
|
&& !card.isBasic(game)) {
|
||||||
for (Permanent permanent : game.getBattlefield().getAllActivePermanents(filter, game)) {
|
for (Permanent permanent : game.getBattlefield().getAllActivePermanents(filter, game)) {
|
||||||
if (permanent != null) {
|
if (permanent != null) {
|
||||||
if (CardUtil.haveSameNames(card, permanent.getName(), game)) {
|
if (CardUtil.haveSameNames(card, permanent.getName(), game)) {
|
||||||
|
|
|
@ -83,7 +83,7 @@ enum DoubleMajorApplier implements StackObjectCopyApplier {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void modifySpell(StackObject stackObject, Game game) {
|
public void modifySpell(StackObject stackObject, Game game) {
|
||||||
stackObject.getSuperType().remove(SuperType.LEGENDARY);
|
stackObject.removeSuperType(SuperType.LEGENDARY);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -193,7 +193,7 @@ class DraugrNecromancerSpendAnyManaEffect extends AsThoughEffectImpl implements
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ManaType getAsThoughManaType(ManaType manaType, ManaPoolItem mana, UUID affectedControllerId, Ability source, Game game) {
|
public ManaType getAsThoughManaType(ManaType manaType, ManaPoolItem mana, UUID affectedControllerId, Ability source, Game game) {
|
||||||
if (mana.getSourceObject() != null && mana.getSourceObject().isSnow()) {
|
if (mana.getSourceObject() != null && mana.getSourceObject().isSnow(game)) {
|
||||||
return mana.getFirstAvailable();
|
return mana.getFirstAvailable();
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
|
|
|
@ -82,7 +82,7 @@ class EllywickTumblestrumEffect extends OneShotEffect {
|
||||||
player.revealCards(source, new CardsImpl(card), game);
|
player.revealCards(source, new CardsImpl(card), game);
|
||||||
player.moveCards(card, Zone.HAND, source, game);
|
player.moveCards(card, Zone.HAND, source, game);
|
||||||
cards.remove(card);
|
cards.remove(card);
|
||||||
if (card.isLegendary()) {
|
if (card.isLegendary(game)) {
|
||||||
player.gainLife(3, game, source);
|
player.gainLife(3, game, source);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -72,7 +72,7 @@ class EmbiggenEffect extends OneShotEffect {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
int count = permanent
|
int count = permanent
|
||||||
.getSuperType()
|
.getSuperType(game)
|
||||||
.size()
|
.size()
|
||||||
+ permanent
|
+ permanent
|
||||||
.getCardType(game)
|
.getCardType(game)
|
||||||
|
|
|
@ -126,7 +126,7 @@ class EyeOfSingularityTriggeredAbility extends TriggeredAbilityImpl {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (permanent != null && !permanent.isBasic()) {
|
if (permanent != null && !permanent.isBasic(game)) {
|
||||||
getEffects().get(0).setTargetPointer(new FixedTarget(event.getTargetId()));
|
getEffects().get(0).setTargetPointer(new FixedTarget(event.getTargetId()));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -72,7 +72,7 @@ class FeastOfWormsEffect extends OneShotEffect {
|
||||||
if (permanent != null) {
|
if (permanent != null) {
|
||||||
targetPlayer = game.getPlayer(permanent.getControllerId());
|
targetPlayer = game.getPlayer(permanent.getControllerId());
|
||||||
}
|
}
|
||||||
if (targetPlayer != null && permanent != null && (permanent.isLegendary())) {
|
if (targetPlayer != null && permanent != null && (permanent.isLegendary(game))) {
|
||||||
FilterControlledPermanent filter = new FilterControlledLandPermanent("land to sacrifice");
|
FilterControlledPermanent filter = new FilterControlledLandPermanent("land to sacrifice");
|
||||||
filter.add(new ControllerIdPredicate(targetPlayer.getId()));
|
filter.add(new ControllerIdPredicate(targetPlayer.getId()));
|
||||||
TargetControlledPermanent target = new TargetControlledPermanent(1, 1, filter, false);
|
TargetControlledPermanent target = new TargetControlledPermanent(1, 1, filter, false);
|
||||||
|
|
|
@ -74,7 +74,7 @@ class FrostAugurEffect extends OneShotEffect {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
player.lookAtCards("", card, game);
|
player.lookAtCards("", card, game);
|
||||||
if (card.isSnow() && player.chooseUse(
|
if (card.isSnow(game) && player.chooseUse(
|
||||||
outcome, "Reveal " + card.getName() + " and put it into your hand?", source, game
|
outcome, "Reveal " + card.getName() + " and put it into your hand?", source, game
|
||||||
)) {
|
)) {
|
||||||
player.revealCards(source, new CardsImpl(card), game);
|
player.revealCards(source, new CardsImpl(card), game);
|
||||||
|
|
|
@ -84,7 +84,7 @@ class GauntletOfPowerTapForManaAllTriggeredAbility extends TriggeredManaAbility
|
||||||
public boolean checkTrigger(GameEvent event, Game game) {
|
public boolean checkTrigger(GameEvent event, Game game) {
|
||||||
TappedForManaEvent mEvent = (TappedForManaEvent) event;
|
TappedForManaEvent mEvent = (TappedForManaEvent) event;
|
||||||
Permanent permanent = mEvent.getPermanent();
|
Permanent permanent = mEvent.getPermanent();
|
||||||
if (permanent == null || !permanent.isLand() || !permanent.isBasic()) {
|
if (permanent == null || !permanent.isLand() || !permanent.isBasic(game)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
ObjectColor color = (ObjectColor) game.getState().getValue(getSourceId() + "_color");
|
ObjectColor color = (ObjectColor) game.getState().getValue(getSourceId() + "_color");
|
||||||
|
|
|
@ -60,7 +60,7 @@ class AttachedToBasicMountainCondition implements Condition {
|
||||||
if (enchantment != null) {
|
if (enchantment != null) {
|
||||||
Permanent enchanted = game.getPermanent(enchantment.getAttachedTo());
|
Permanent enchanted = game.getPermanent(enchantment.getAttachedTo());
|
||||||
if (enchanted != null) {
|
if (enchanted != null) {
|
||||||
if (enchanted.hasSubtype(SubType.MOUNTAIN, game) && enchanted.isBasic()) {
|
if (enchanted.hasSubtype(SubType.MOUNTAIN, game) && enchanted.isBasic(game)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -64,7 +64,7 @@ class GoblinFurrierPreventEffectEffect extends PreventionEffectImpl {
|
||||||
if (super.applies(event, source, game)) {
|
if (super.applies(event, source, game)) {
|
||||||
if (event.getSourceId().equals(source.getSourceId())) {
|
if (event.getSourceId().equals(source.getSourceId())) {
|
||||||
Permanent damageTo = game.getPermanent(event.getTargetId());
|
Permanent damageTo = game.getPermanent(event.getTargetId());
|
||||||
return damageTo != null && damageTo.isSnow();
|
return damageTo != null && damageTo.isSnow(game);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -64,7 +64,7 @@ class HauntingEchoesEffect extends OneShotEffect {
|
||||||
.getCards(game)
|
.getCards(game)
|
||||||
.stream()
|
.stream()
|
||||||
.filter(Objects::nonNull)
|
.filter(Objects::nonNull)
|
||||||
.filter(card -> !card.isBasic() || !card.isLand(game))
|
.filter(card -> !card.isBasic(game) || !card.isLand(game))
|
||||||
.forEach(cards::add);
|
.forEach(cards::add);
|
||||||
controller.moveCards(cards, Zone.EXILED, source, game);
|
controller.moveCards(cards, Zone.EXILED, source, game);
|
||||||
cards.removeIf(uuid -> game.getState().getZone(uuid) != Zone.EXILED);
|
cards.removeIf(uuid -> game.getState().getZone(uuid) != Zone.EXILED);
|
||||||
|
|
|
@ -73,7 +73,7 @@ class HelldozerEffect extends OneShotEffect {
|
||||||
Permanent helldozer = game.getPermanent(source.getSourceId());
|
Permanent helldozer = game.getPermanent(source.getSourceId());
|
||||||
Permanent landTarget = game.getPermanent(source.getFirstTarget());
|
Permanent landTarget = game.getPermanent(source.getFirstTarget());
|
||||||
if (landTarget != null) {
|
if (landTarget != null) {
|
||||||
boolean wasNonBasic = !landTarget.isBasic();
|
boolean wasNonBasic = !landTarget.isBasic(game);
|
||||||
landTarget.destroy(source, game, false);
|
landTarget.destroy(source, game, false);
|
||||||
if (wasNonBasic
|
if (wasNonBasic
|
||||||
&& helldozer != null) {
|
&& helldozer != null) {
|
||||||
|
|
|
@ -70,7 +70,7 @@ class HiddenHerdAbility extends TriggeredAbilityImpl {
|
||||||
@Override
|
@Override
|
||||||
public boolean checkTrigger(GameEvent event, Game game) {
|
public boolean checkTrigger(GameEvent event, Game game) {
|
||||||
Permanent land = game.getPermanentOrLKIBattlefield(event.getTargetId());
|
Permanent land = game.getPermanentOrLKIBattlefield(event.getTargetId());
|
||||||
return game.getOpponents(controllerId).contains(event.getPlayerId()) && !land.getSuperType().contains(SuperType.BASIC);
|
return game.getOpponents(controllerId).contains(event.getPlayerId()) && !land.isBasic(game);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -76,7 +76,7 @@ enum HiveheartShamanPredicate implements ObjectSourcePlayerPredicate<Card> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(ObjectSourcePlayer<Card> input, Game game) {
|
public boolean apply(ObjectSourcePlayer<Card> input, Game game) {
|
||||||
if (!input.getObject().isBasic() || !input.getObject().isLand(game)) {
|
if (!input.getObject().isBasic(game) || !input.getObject().isLand(game)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return game.getBattlefield()
|
return game.getBattlefield()
|
||||||
|
|
|
@ -63,7 +63,7 @@ class IcequakeEffect extends OneShotEffect {
|
||||||
Player controller = game.getPlayer(permanent.getControllerId());
|
Player controller = game.getPlayer(permanent.getControllerId());
|
||||||
if (controller != null) {
|
if (controller != null) {
|
||||||
permanent.destroy(source, game, false);
|
permanent.destroy(source, game, false);
|
||||||
if (permanent.isSnow()) {
|
if (permanent.isSnow(game)) {
|
||||||
controller.damage(1, source.getSourceId(), source, game);
|
controller.damage(1, source.getSourceId(), source, game);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -82,7 +82,7 @@ class IllusionaryTerrainEffect extends ContinuousEffectImpl {
|
||||||
&& firstChoice != null
|
&& firstChoice != null
|
||||||
&& secondChoice != null) {
|
&& secondChoice != null) {
|
||||||
for (Permanent land : lands) {
|
for (Permanent land : lands) {
|
||||||
if (land.isBasic()) {
|
if (land.isBasic(game)) {
|
||||||
switch (layer) {
|
switch (layer) {
|
||||||
case TypeChangingEffects_4:
|
case TypeChangingEffects_4:
|
||||||
// the land mana ability is intrinsic, so add it here, not layer 6
|
// the land mana ability is intrinsic, so add it here, not layer 6
|
||||||
|
|
|
@ -92,7 +92,7 @@ class InstrumentOfTheBardsEffect extends OneShotEffect {
|
||||||
if (card != null) {
|
if (card != null) {
|
||||||
controller.revealCards(permanent.getIdName(), new CardsImpl(card), game);
|
controller.revealCards(permanent.getIdName(), new CardsImpl(card), game);
|
||||||
controller.moveCards(card, Zone.HAND, source, game);
|
controller.moveCards(card, Zone.HAND, source, game);
|
||||||
if (card.isLegendary()) {
|
if (card.isLegendary(game)) {
|
||||||
new TreasureToken().putOntoBattlefield(1, game, source, source.getControllerId());
|
new TreasureToken().putOntoBattlefield(1, game, source, source.getControllerId());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -84,7 +84,7 @@ class IsolatedWatchtowerEffect extends OneShotEffect {
|
||||||
}
|
}
|
||||||
Card card = player.getLibrary().getFromTop(game);
|
Card card = player.getLibrary().getFromTop(game);
|
||||||
player.revealCards(source, new CardsImpl(card), game);
|
player.revealCards(source, new CardsImpl(card), game);
|
||||||
if (card.isBasic() && card.isLand(game)) {
|
if (card.isBasic(game) && card.isLand(game)) {
|
||||||
player.moveCards(
|
player.moveCards(
|
||||||
card, Zone.BATTLEFIELD, source,
|
card, Zone.BATTLEFIELD, source,
|
||||||
game, true, false, true, null
|
game, true, false, true, null
|
||||||
|
|
|
@ -102,7 +102,7 @@ class JodahTheUnifierEffect extends OneShotEffect {
|
||||||
exiledCards.add(card);
|
exiledCards.add(card);
|
||||||
controller.moveCards(card, Zone.EXILED, source, game);
|
controller.moveCards(card, Zone.EXILED, source, game);
|
||||||
game.getState().processAction(game);
|
game.getState().processAction(game);
|
||||||
if (card.isLegendary() && !card.isLand(game) && card.getManaValue() < manaValue) {
|
if (card.isLegendary(game) && !card.isLand(game) && card.getManaValue() < manaValue) {
|
||||||
CardUtil.castSpellWithAttributesForFree(controller, source, game, card);
|
CardUtil.castSpellWithAttributesForFree(controller, source, game, card);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -121,14 +121,14 @@ class JourneyForTheElixirLibraryTarget extends TargetCardInLibrary {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
Cards cards = new CardsImpl(this.getTargets());
|
Cards cards = new CardsImpl(this.getTargets());
|
||||||
if (card.isBasic()
|
if (card.isBasic(game)
|
||||||
&& card.isLand(game)
|
&& card.isLand(game)
|
||||||
&& cards
|
&& cards
|
||||||
.getCards(game)
|
.getCards(game)
|
||||||
.stream()
|
.stream()
|
||||||
.filter(Objects::nonNull)
|
.filter(Objects::nonNull)
|
||||||
.filter(MageObject::isBasic)
|
.filter(c -> c.isBasic(game))
|
||||||
.anyMatch(card1 -> card1.isLand(game))) {
|
.anyMatch(c -> c.isLand(game))) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (name.equals(card.getName())
|
if (name.equals(card.getName())
|
||||||
|
@ -185,14 +185,14 @@ class JourneyForTheElixirGraveyardTarget extends TargetCardInYourGraveyard {
|
||||||
.getCards(game)
|
.getCards(game)
|
||||||
.stream()
|
.stream()
|
||||||
.filter(Objects::nonNull)
|
.filter(Objects::nonNull)
|
||||||
.filter(card1 -> card1.isLand(game))
|
.filter(c -> c.isLand(game))
|
||||||
.anyMatch(MageObject::isBasic);
|
.anyMatch(c -> c.isBasic(game));
|
||||||
possibleTargets.removeIf(uuid -> {
|
possibleTargets.removeIf(uuid -> {
|
||||||
Card card = game.getCard(uuid);
|
Card card = game.getCard(uuid);
|
||||||
return card != null
|
return card != null
|
||||||
&& hasBasic
|
&& hasBasic
|
||||||
&& card.isLand(game)
|
&& card.isLand(game)
|
||||||
&& card.isBasic();
|
&& card.isBasic(game);
|
||||||
});
|
});
|
||||||
boolean hasYanggu = alreadyTargeted
|
boolean hasYanggu = alreadyTargeted
|
||||||
.getCards(game)
|
.getCards(game)
|
||||||
|
|
|
@ -9,7 +9,6 @@ import mage.abilities.costs.common.ExileFromGraveCost;
|
||||||
import mage.abilities.effects.AsThoughEffectImpl;
|
import mage.abilities.effects.AsThoughEffectImpl;
|
||||||
import mage.abilities.effects.ContinuousEffectImpl;
|
import mage.abilities.effects.ContinuousEffectImpl;
|
||||||
import mage.abilities.effects.common.cost.SpellsCostReductionControllerEffect;
|
import mage.abilities.effects.common.cost.SpellsCostReductionControllerEffect;
|
||||||
import mage.cards.Card;
|
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
import mage.constants.*;
|
import mage.constants.*;
|
||||||
|
@ -90,7 +89,7 @@ class KethisTheHiddenHandEffect extends ContinuousEffectImpl {
|
||||||
.stream()
|
.stream()
|
||||||
.map(game::getCard)
|
.map(game::getCard)
|
||||||
.filter(Objects::nonNull)
|
.filter(Objects::nonNull)
|
||||||
.filter(Card::isLegendary)
|
.filter(card1 -> card1.isLegendary(game))
|
||||||
.forEach(card -> affectedObjectList.add(new MageObjectReference(card, game)));
|
.forEach(card -> affectedObjectList.add(new MageObjectReference(card, game)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -160,7 +160,7 @@ class TheRinghartCrestManaCondition extends CreatureCastManaCondition {
|
||||||
if (super.apply(game, source)) {
|
if (super.apply(game, source)) {
|
||||||
MageObject object = game.getObject(source);
|
MageObject object = game.getObject(source);
|
||||||
if (object != null) {
|
if (object != null) {
|
||||||
if (object.isLegendary()) {
|
if (object.isLegendary(game)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return creatureType != null && object.hasSubtype(creatureType, game);
|
return creatureType != null && object.hasSubtype(creatureType, game);
|
||||||
|
|
|
@ -61,7 +61,7 @@ class SetSupertypeAllEffect extends ContinuousEffectImpl {
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(Game game, Ability source) {
|
public boolean apply(Game game, Ability source) {
|
||||||
for (Permanent permanent : game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source, game)) {
|
for (Permanent permanent : game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source, game)) {
|
||||||
permanent.addSuperType(SuperType.LEGENDARY);
|
permanent.addSuperType(game, SuperType.LEGENDARY);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,26 +1,18 @@
|
||||||
|
|
||||||
package mage.cards.m;
|
package mage.cards.m;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.Mode;
|
|
||||||
import mage.abilities.common.SimpleStaticAbility;
|
import mage.abilities.common.SimpleStaticAbility;
|
||||||
import mage.abilities.effects.ContinuousEffectImpl;
|
import mage.abilities.effects.ContinuousEffectImpl;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
import mage.constants.CardType;
|
import mage.constants.*;
|
||||||
import mage.constants.Duration;
|
|
||||||
import mage.constants.Layer;
|
|
||||||
import mage.constants.Outcome;
|
|
||||||
import mage.constants.SubLayer;
|
|
||||||
import mage.constants.SuperType;
|
|
||||||
import mage.constants.Zone;
|
|
||||||
import mage.filter.common.FilterLandPermanent;
|
import mage.filter.common.FilterLandPermanent;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.game.permanent.Permanent;
|
import mage.game.permanent.Permanent;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author TheElk801
|
* @author TheElk801
|
||||||
*/
|
*/
|
||||||
public final class Melting extends CardImpl {
|
public final class Melting extends CardImpl {
|
||||||
|
@ -63,7 +55,7 @@ class MeltingEffect extends ContinuousEffectImpl {
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(Game game, Ability source) {
|
public boolean apply(Game game, Ability source) {
|
||||||
for (Permanent permanent : game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source, game)) {
|
for (Permanent permanent : game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source, game)) {
|
||||||
permanent.getSuperType().remove(SuperType.SNOW);
|
permanent.removeSuperType(game, SuperType.SNOW);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -127,9 +127,9 @@ class MetamorphicAlterationEffect extends ContinuousEffectImpl {
|
||||||
|
|
||||||
CardUtil.copySetAndCardNumber(permanent, copied);
|
CardUtil.copySetAndCardNumber(permanent, copied);
|
||||||
|
|
||||||
permanent.getSuperType().clear();
|
permanent.removeAllCardTypes(game);
|
||||||
for (SuperType t : copied.getSuperType()) {
|
for (SuperType t : copied.getSuperType(game)) {
|
||||||
permanent.addSuperType(t);
|
permanent.addSuperType(game, t);
|
||||||
}
|
}
|
||||||
permanent.removeAllCardTypes(game);
|
permanent.removeAllCardTypes(game);
|
||||||
for (CardType cardType : copied.getCardType(game)) {
|
for (CardType cardType : copied.getCardType(game)) {
|
||||||
|
|
|
@ -161,7 +161,7 @@ class MindlinkMechWatcher extends Watcher {
|
||||||
.stream()
|
.stream()
|
||||||
.filter(mor -> {
|
.filter(mor -> {
|
||||||
Permanent permanent = mor.getPermanent(game);
|
Permanent permanent = mor.getPermanent(game);
|
||||||
return permanent != null && !permanent.isLegendary() && permanent.isCreature(game);
|
return permanent != null && !permanent.isLegendary(game) && permanent.isCreature(game);
|
||||||
}).map(MageObjectReferencePredicate::new)
|
}).map(MageObjectReferencePredicate::new)
|
||||||
.collect(Collectors.toSet());
|
.collect(Collectors.toSet());
|
||||||
if (predicates.isEmpty()) {
|
if (predicates.isEmpty()) {
|
||||||
|
|
|
@ -60,7 +60,7 @@ class MoltenRainEffect extends OneShotEffect {
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(Game game, Ability source) {
|
public boolean apply(Game game, Ability source) {
|
||||||
Permanent permanent = (Permanent) game.getLastKnownInformation(source.getFirstTarget(), Zone.BATTLEFIELD);
|
Permanent permanent = (Permanent) game.getLastKnownInformation(source.getFirstTarget(), Zone.BATTLEFIELD);
|
||||||
if (permanent != null && !permanent.isBasic()) {
|
if (permanent != null && !permanent.isBasic(game)) {
|
||||||
Player player = game.getPlayer(permanent.getControllerId());
|
Player player = game.getPlayer(permanent.getControllerId());
|
||||||
if (player != null) {
|
if (player != null) {
|
||||||
player.damage(2, source.getSourceId(), source, game);
|
player.damage(2, source.getSourceId(), source, game);
|
||||||
|
|
|
@ -57,7 +57,7 @@ enum MoonsilverKeyPredicate implements Predicate<Card> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(Card input, Game game) {
|
public boolean apply(Card input, Game game) {
|
||||||
if (input.isLand(game) && input.isBasic()) {
|
if (input.isLand(game) && input.isBasic(game)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return input.isArtifact(game)
|
return input.isArtifact(game)
|
||||||
|
|
|
@ -1,8 +1,5 @@
|
||||||
package mage.cards.o;
|
package mage.cards.o;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.UUID;
|
|
||||||
|
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.LoyaltyAbility;
|
import mage.abilities.LoyaltyAbility;
|
||||||
import mage.abilities.StaticAbility;
|
import mage.abilities.StaticAbility;
|
||||||
|
@ -15,9 +12,9 @@ import mage.abilities.effects.common.DrawCardTargetEffect;
|
||||||
import mage.abilities.effects.common.InfoEffect;
|
import mage.abilities.effects.common.InfoEffect;
|
||||||
import mage.abilities.effects.common.LoseLifeTargetEffect;
|
import mage.abilities.effects.common.LoseLifeTargetEffect;
|
||||||
import mage.cards.Card;
|
import mage.cards.Card;
|
||||||
import mage.constants.*;
|
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
|
import mage.constants.*;
|
||||||
import mage.filter.StaticFilters;
|
import mage.filter.StaticFilters;
|
||||||
import mage.filter.predicate.mageobject.MageObjectReferencePredicate;
|
import mage.filter.predicate.mageobject.MageObjectReferencePredicate;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
|
@ -30,8 +27,10 @@ import mage.target.TargetPlayer;
|
||||||
import mage.target.common.TargetControlledPermanent;
|
import mage.target.common.TargetControlledPermanent;
|
||||||
import mage.util.functions.StackObjectCopyApplier;
|
import mage.util.functions.StackObjectCopyApplier;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author weirddan455
|
* @author weirddan455
|
||||||
*/
|
*/
|
||||||
public final class ObNixilisTheAdversary extends CardImpl {
|
public final class ObNixilisTheAdversary extends CardImpl {
|
||||||
|
@ -170,7 +169,7 @@ class ObNixilisTheAdversaryApplier implements StackObjectCopyApplier {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void modifySpell(StackObject stackObject, Game game) {
|
public void modifySpell(StackObject stackObject, Game game) {
|
||||||
stackObject.getSuperType().remove(SuperType.LEGENDARY);
|
stackObject.removeSuperType(SuperType.LEGENDARY);
|
||||||
stackObject.setStartingLoyalty(loyalty);
|
stackObject.setStartingLoyalty(loyalty);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -75,6 +75,6 @@ class PaleMoonReplacementEffect extends ReplacementEffectImpl {
|
||||||
@Override
|
@Override
|
||||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||||
Permanent permanent = ((TappedForManaEvent) event).getPermanent();
|
Permanent permanent = ((TappedForManaEvent) event).getPermanent();
|
||||||
return permanent != null && permanent.isLand(game) && !permanent.isBasic();
|
return permanent != null && permanent.isLand(game) && !permanent.isBasic(game);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -121,7 +121,7 @@ class PlarggDeanOfChaosEffect extends OneShotEffect {
|
||||||
Card eligibleCard = null;
|
Card eligibleCard = null;
|
||||||
for (Card card : controller.getLibrary().getCards(game)) {
|
for (Card card : controller.getLibrary().getCards(game)) {
|
||||||
toReveal.add(card);
|
toReveal.add(card);
|
||||||
if (!card.isLand(game) && !card.isLegendary() && card.getManaValue() < 4) {
|
if (!card.isLand(game) && !card.isLegendary(game) && card.getManaValue() < 4) {
|
||||||
eligibleCard = card;
|
eligibleCard = card;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -109,7 +109,7 @@ class PlazaOfHeroesManaCondition extends ManaCondition implements Condition {
|
||||||
public boolean apply(Game game, Ability source) {
|
public boolean apply(Game game, Ability source) {
|
||||||
if (source instanceof SpellAbility) {
|
if (source instanceof SpellAbility) {
|
||||||
MageObject object = game.getObject(source);
|
MageObject object = game.getObject(source);
|
||||||
if (object != null && object.isLegendary()) {
|
if (object != null && object.isLegendary(game)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -78,6 +78,6 @@ class PulseOfLlanowarReplacementEffect extends ReplacementEffectImpl {
|
||||||
@Override
|
@Override
|
||||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||||
Permanent permanent = ((TappedForManaEvent) event).getPermanent();
|
Permanent permanent = ((TappedForManaEvent) event).getPermanent();
|
||||||
return permanent != null && permanent.isLand(game) && permanent.isBasic() && permanent.isControlledBy(source.getControllerId());
|
return permanent != null && permanent.isLand(game) && permanent.isBasic(game) && permanent.isControlledBy(source.getControllerId());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -62,7 +62,7 @@ class RegentsAuthorityEffect extends OneShotEffect {
|
||||||
}
|
}
|
||||||
if (!permanent.isEnchantment(game)
|
if (!permanent.isEnchantment(game)
|
||||||
&& (!permanent.isCreature(game)
|
&& (!permanent.isCreature(game)
|
||||||
|| !permanent.isLegendary())) {
|
|| !permanent.isLegendary(game))) {
|
||||||
game.addEffect(new BoostTargetEffect(2, 2), source);
|
game.addEffect(new BoostTargetEffect(2, 2), source);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -103,7 +103,7 @@ class RimefeatherOwlEffect extends ContinuousEffectImpl {
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(Game game, Ability source) {
|
public boolean apply(Game game, Ability source) {
|
||||||
for (Permanent permanent : game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source, game)) {
|
for (Permanent permanent : game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source, game)) {
|
||||||
permanent.addSuperType(SuperType.SNOW);
|
permanent.addSuperType(game, SuperType.SNOW);
|
||||||
|
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|
80
Mage.Sets/src/mage/cards/r/RootpathPurifier.java
Normal file
80
Mage.Sets/src/mage/cards/r/RootpathPurifier.java
Normal file
|
@ -0,0 +1,80 @@
|
||||||
|
package mage.cards.r;
|
||||||
|
|
||||||
|
import mage.MageInt;
|
||||||
|
import mage.abilities.Ability;
|
||||||
|
import mage.abilities.common.SimpleStaticAbility;
|
||||||
|
import mage.abilities.effects.ContinuousEffectImpl;
|
||||||
|
import mage.cards.Card;
|
||||||
|
import mage.cards.CardImpl;
|
||||||
|
import mage.cards.CardSetInfo;
|
||||||
|
import mage.constants.*;
|
||||||
|
import mage.filter.StaticFilters;
|
||||||
|
import mage.game.Game;
|
||||||
|
import mage.game.permanent.Permanent;
|
||||||
|
import mage.players.Player;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author TheElk801
|
||||||
|
*/
|
||||||
|
public final class RootpathPurifier extends CardImpl {
|
||||||
|
|
||||||
|
public RootpathPurifier(UUID ownerId, CardSetInfo setInfo) {
|
||||||
|
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{G}");
|
||||||
|
|
||||||
|
this.subtype.add(SubType.ELF);
|
||||||
|
this.subtype.add(SubType.DRUID);
|
||||||
|
this.power = new MageInt(3);
|
||||||
|
this.toughness = new MageInt(4);
|
||||||
|
|
||||||
|
// Lands you control and land cards in your library are basic.
|
||||||
|
this.addAbility(new SimpleStaticAbility(new RootpathPurifierEffect()));
|
||||||
|
}
|
||||||
|
|
||||||
|
private RootpathPurifier(final RootpathPurifier card) {
|
||||||
|
super(card);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public RootpathPurifier copy() {
|
||||||
|
return new RootpathPurifier(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class RootpathPurifierEffect extends ContinuousEffectImpl {
|
||||||
|
|
||||||
|
RootpathPurifierEffect() {
|
||||||
|
super(Duration.WhileOnBattlefield, Layer.TypeChangingEffects_4, SubLayer.NA, Outcome.Benefit);
|
||||||
|
staticText = "lands you control and land cards in your library are basic";
|
||||||
|
}
|
||||||
|
|
||||||
|
private RootpathPurifierEffect(final RootpathPurifierEffect effect) {
|
||||||
|
super(effect);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public RootpathPurifierEffect copy() {
|
||||||
|
return new RootpathPurifierEffect(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean apply(Game game, Ability source) {
|
||||||
|
Player player = game.getPlayer(source.getControllerId());
|
||||||
|
if (player == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
for (Permanent permanent : game.getBattlefield().getActivePermanents(
|
||||||
|
StaticFilters.FILTER_CONTROLLED_PERMANENT_LAND,
|
||||||
|
source.getControllerId(), source, game
|
||||||
|
)) {
|
||||||
|
permanent.addSuperType(game, SuperType.BASIC);
|
||||||
|
}
|
||||||
|
for (Card card : player.getLibrary().getCards(game)) {
|
||||||
|
if (card.isLand(game)) {
|
||||||
|
card.addSuperType(game, SuperType.BASIC);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
|
@ -72,7 +72,7 @@ class RowenAbility extends TriggeredAbilityImpl {
|
||||||
lastTriggeredTurn = game.getTurnNum();
|
lastTriggeredTurn = game.getTurnNum();
|
||||||
controller.revealCards(sourcePermanent.getName(), new CardsImpl(card), game);
|
controller.revealCards(sourcePermanent.getName(), new CardsImpl(card), game);
|
||||||
this.getEffects().clear();
|
this.getEffects().clear();
|
||||||
if (card.isLand(game) && card.isBasic()) {
|
if (card.isLand(game) && card.isBasic(game)) {
|
||||||
this.addEffect(new DrawCardSourceControllerEffect(1));
|
this.addEffect(new DrawCardSourceControllerEffect(1));
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
|
|
||||||
package mage.cards.s;
|
package mage.cards.s;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.MageObjectReference;
|
import mage.MageObjectReference;
|
||||||
import mage.ObjectColor;
|
import mage.ObjectColor;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
|
@ -21,6 +20,8 @@ import mage.game.command.emblems.SarkhanTheDragonspeakerEmblem;
|
||||||
import mage.game.permanent.Permanent;
|
import mage.game.permanent.Permanent;
|
||||||
import mage.target.common.TargetCreaturePermanent;
|
import mage.target.common.TargetCreaturePermanent;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* import mage.game.command.emblems.SarkhanTheDragonspeakerEmblem;
|
* import mage.game.command.emblems.SarkhanTheDragonspeakerEmblem;
|
||||||
*
|
*
|
||||||
|
@ -92,8 +93,8 @@ class SarkhanTheDragonspeakerEffect extends ContinuousEffectImpl {
|
||||||
permanent.addCardType(game, CardType.CREATURE);
|
permanent.addCardType(game, CardType.CREATURE);
|
||||||
permanent.removeAllSubTypes(game);
|
permanent.removeAllSubTypes(game);
|
||||||
permanent.addSubType(game, SubType.DRAGON);
|
permanent.addSubType(game, SubType.DRAGON);
|
||||||
permanent.getSuperType().clear();
|
permanent.removeAllSuperTypes(game);
|
||||||
permanent.addSuperType(SuperType.LEGENDARY);
|
permanent.addSuperType(game, SuperType.LEGENDARY);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case ColorChangingEffects_5:
|
case ColorChangingEffects_5:
|
||||||
|
|
|
@ -75,7 +75,7 @@ class ScryingSheetsEffect extends OneShotEffect {
|
||||||
CardsImpl cards = new CardsImpl();
|
CardsImpl cards = new CardsImpl();
|
||||||
cards.add(card);
|
cards.add(card);
|
||||||
controller.lookAtCards(sourceObject.getIdName(), cards, game);
|
controller.lookAtCards(sourceObject.getIdName(), cards, game);
|
||||||
if (card.isSnow()) {
|
if (card.isSnow(game)) {
|
||||||
if (controller.chooseUse(outcome, "Reveal " + card.getLogName() + " and put it into your hand?", source, game)) {
|
if (controller.chooseUse(outcome, "Reveal " + card.getLogName() + " and put it into your hand?", source, game)) {
|
||||||
controller.moveCards(card, Zone.HAND, source, game);
|
controller.moveCards(card, Zone.HAND, source, game);
|
||||||
controller.revealCards(sourceObject.getIdName(), cards, game);
|
controller.revealCards(sourceObject.getIdName(), cards, game);
|
||||||
|
|
|
@ -13,7 +13,6 @@ import mage.filter.FilterCard;
|
||||||
import mage.filter.predicate.Predicate;
|
import mage.filter.predicate.Predicate;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.target.common.TargetCardInLibrary;
|
import mage.target.common.TargetCardInLibrary;
|
||||||
import mage.watchers.common.ManaPaidSourceWatcher;
|
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
|
@ -59,8 +58,8 @@ enum SearchForGloryPredicate implements Predicate<Card> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(Card input, Game game) {
|
public boolean apply(Card input, Game game) {
|
||||||
return (input.isPermanent(game) && input.isSnow())
|
return (input.isPermanent(game) && input.isSnow(game))
|
||||||
|| input.isLegendary()
|
|| input.isLegendary(game)
|
||||||
|| input.hasSubtype(SubType.SAGA, game);
|
|| input.hasSubtype(SubType.SAGA, game);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,7 +11,6 @@ import mage.constants.CardType;
|
||||||
import mage.constants.DependencyType;
|
import mage.constants.DependencyType;
|
||||||
import mage.constants.Duration;
|
import mage.constants.Duration;
|
||||||
import mage.constants.Layer;
|
import mage.constants.Layer;
|
||||||
import static mage.constants.Layer.AbilityAddingRemovingEffects_6;
|
|
||||||
import mage.constants.Outcome;
|
import mage.constants.Outcome;
|
||||||
import mage.constants.SubLayer;
|
import mage.constants.SubLayer;
|
||||||
import mage.constants.Zone;
|
import mage.constants.Zone;
|
||||||
|
@ -70,7 +69,7 @@ class ShelteringPrayersEffect extends ContinuousEffectImpl {
|
||||||
&& game.getBattlefield().getAllActivePermanents(new FilterLandPermanent(), playerId, game).size() < 4) {
|
&& game.getBattlefield().getAllActivePermanents(new FilterLandPermanent(), playerId, game).size() < 4) {
|
||||||
for (Permanent land : game.getBattlefield().getAllActivePermanents(new FilterLandPermanent(), playerId, game)) {
|
for (Permanent land : game.getBattlefield().getAllActivePermanents(new FilterLandPermanent(), playerId, game)) {
|
||||||
if (land != null
|
if (land != null
|
||||||
&& land.isBasic()) {
|
&& land.isBasic(game)) {
|
||||||
switch (layer) {
|
switch (layer) {
|
||||||
case AbilityAddingRemovingEffects_6:
|
case AbilityAddingRemovingEffects_6:
|
||||||
if (sublayer == SubLayer.NA) {
|
if (sublayer == SubLayer.NA) {
|
||||||
|
|
|
@ -77,7 +77,7 @@ class SparkDoubleCopyApplier extends CopyApplier {
|
||||||
// (2019-05-03)
|
// (2019-05-03)
|
||||||
//
|
//
|
||||||
// So, it's must make changes in blueprint (for farther copyable)
|
// So, it's must make changes in blueprint (for farther copyable)
|
||||||
blueprint.getSuperType().remove(SuperType.LEGENDARY);
|
blueprint.removeSuperType(SuperType.LEGENDARY);
|
||||||
|
|
||||||
// TODO: Blood Moon problem, can't apply on type changing effects (same as TeferisTimeTwist)
|
// TODO: Blood Moon problem, can't apply on type changing effects (same as TeferisTimeTwist)
|
||||||
// see https://magic.wizards.com/en/articles/archive/feature/war-spark-release-notes-2019-04-19
|
// see https://magic.wizards.com/en/articles/archive/feature/war-spark-release-notes-2019-04-19
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
package mage.cards.s;
|
package mage.cards.s;
|
||||||
|
|
||||||
import mage.MageObject;
|
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.condition.Condition;
|
import mage.abilities.condition.Condition;
|
||||||
import mage.abilities.costs.common.SacrificeTargetCost;
|
import mage.abilities.costs.common.SacrificeTargetCost;
|
||||||
|
@ -58,6 +57,6 @@ enum SplittingThePowerstoneCondition implements Condition {
|
||||||
.map(SacrificeTargetCost::getPermanents)
|
.map(SacrificeTargetCost::getPermanents)
|
||||||
.flatMap(Collection::stream)
|
.flatMap(Collection::stream)
|
||||||
.filter(Objects::nonNull)
|
.filter(Objects::nonNull)
|
||||||
.anyMatch(MageObject::isLegendary);
|
.anyMatch(permanent -> permanent.isLegendary(game));
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -48,6 +48,6 @@ enum TalesEndPredicate implements Predicate<StackObject> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(StackObject input, Game game) {
|
public boolean apply(StackObject input, Game game) {
|
||||||
return !(input instanceof Spell) || input.isLegendary();
|
return !(input instanceof Spell) || input.isLegendary(game);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -131,11 +131,10 @@ class TezzeretCruelMachinistCardTypeEffect extends ContinuousEffectImpl {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
flag = true;
|
flag = true;
|
||||||
target.getSuperType().clear();
|
target.removeAllSuperTypes(game);
|
||||||
target.removeAllCardTypes(game);
|
target.removeAllCardTypes(game);
|
||||||
target.removeAllSubTypes(game);
|
target.removeAllSubTypes(game);
|
||||||
target.addCardType(game, CardType.ARTIFACT);
|
target.addCardType(game, CardType.ARTIFACT, CardType.CREATURE);
|
||||||
target.addCardType(game, CardType.CREATURE);
|
|
||||||
target.getPower().setModifiedBaseValue(5);
|
target.getPower().setModifiedBaseValue(5);
|
||||||
target.getToughness().setModifiedBaseValue(5);
|
target.getToughness().setModifiedBaseValue(5);
|
||||||
}
|
}
|
||||||
|
|
|
@ -128,11 +128,11 @@ class TheKenrithsRoyalFuneralCostEffect extends CostModificationEffectImpl {
|
||||||
}
|
}
|
||||||
if (!game.inCheckPlayableState()) {
|
if (!game.inCheckPlayableState()) {
|
||||||
Spell spell = (Spell) game.getSpell(abilityToModify.getId());
|
Spell spell = (Spell) game.getSpell(abilityToModify.getId());
|
||||||
return spell != null && spell.isLegendary();
|
return spell != null && spell.isLegendary(game);
|
||||||
}
|
}
|
||||||
// Spell is not on the stack yet, but possible playable spells are determined
|
// Spell is not on the stack yet, but possible playable spells are determined
|
||||||
Card sourceCard = game.getCard(abilityToModify.getSourceId());
|
Card sourceCard = game.getCard(abilityToModify.getSourceId());
|
||||||
return sourceCard != null && sourceCard.isLegendary();
|
return sourceCard != null && sourceCard.isLegendary(game);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -75,7 +75,7 @@ enum ThePeregrineDynamoPredicate implements ObjectSourcePlayerPredicate<StackObj
|
||||||
MageObject sourceObject = ((StackAbility) input.getObject()).getSourceObject(game);
|
MageObject sourceObject = ((StackAbility) input.getObject()).getSourceObject(game);
|
||||||
return sourceObject != null
|
return sourceObject != null
|
||||||
&& !sourceObject.getId().equals(input.getSourceId())
|
&& !sourceObject.getId().equals(input.getSourceId())
|
||||||
&& sourceObject.isLegendary()
|
&& sourceObject.isLegendary(game)
|
||||||
&& !CommanderPredicate.instance.apply(sourceObject, game);
|
&& !CommanderPredicate.instance.apply(sourceObject, game);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,29 +1,24 @@
|
||||||
|
|
||||||
package mage.cards.t;
|
package mage.cards.t;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.Mode;
|
import mage.abilities.Mode;
|
||||||
import mage.abilities.effects.ContinuousEffectImpl;
|
|
||||||
import mage.abilities.common.delayed.AtTheBeginOfNextUpkeepDelayedTriggeredAbility;
|
import mage.abilities.common.delayed.AtTheBeginOfNextUpkeepDelayedTriggeredAbility;
|
||||||
|
import mage.abilities.effects.ContinuousEffectImpl;
|
||||||
import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect;
|
import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect;
|
||||||
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
|
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
|
||||||
import mage.constants.SuperType;
|
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
import mage.constants.CardType;
|
import mage.constants.*;
|
||||||
import mage.constants.Duration;
|
|
||||||
import mage.constants.Layer;
|
|
||||||
import mage.constants.Outcome;
|
|
||||||
import mage.constants.SubLayer;
|
|
||||||
import mage.filter.FilterPermanent;
|
import mage.filter.FilterPermanent;
|
||||||
import mage.filter.predicate.Predicates;
|
import mage.filter.predicate.Predicates;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.game.permanent.Permanent;
|
import mage.game.permanent.Permanent;
|
||||||
import mage.target.TargetPermanent;
|
import mage.target.TargetPermanent;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author TheElk801 & L_J
|
* @author TheElk801 & L_J
|
||||||
*/
|
*/
|
||||||
public final class ThermalFlux extends CardImpl {
|
public final class ThermalFlux extends CardImpl {
|
||||||
|
@ -91,9 +86,9 @@ class ThermalFluxEffect extends ContinuousEffectImpl {
|
||||||
Permanent permanent = game.getPermanent(source.getFirstTarget());
|
Permanent permanent = game.getPermanent(source.getFirstTarget());
|
||||||
if (permanent != null) {
|
if (permanent != null) {
|
||||||
if (addSnow) {
|
if (addSnow) {
|
||||||
permanent.addSuperType(SuperType.SNOW);
|
permanent.addSuperType(game, SuperType.SNOW);
|
||||||
} else {
|
} else {
|
||||||
permanent.getSuperType().remove(SuperType.SNOW);
|
permanent.removeSuperType(game, SuperType.SNOW);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -59,7 +59,7 @@ class ThermokarstEffect extends OneShotEffect {
|
||||||
Permanent permanent = game.getPermanent(getTargetPointer().getFirst(game, source));
|
Permanent permanent = game.getPermanent(getTargetPointer().getFirst(game, source));
|
||||||
if (permanent != null && controller != null) {
|
if (permanent != null && controller != null) {
|
||||||
permanent.destroy(source, game, false);
|
permanent.destroy(source, game, false);
|
||||||
if (permanent.isSnow()) {
|
if (permanent.isSnow(game)) {
|
||||||
controller.gainLife(1, game, source);
|
controller.gainLife(1, game, source);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -78,7 +78,7 @@ class LegendaryCastManaCondition extends ManaCondition implements Condition {
|
||||||
public boolean apply(Game game, Ability source) {
|
public boolean apply(Game game, Ability source) {
|
||||||
if (source instanceof SpellAbility) {
|
if (source instanceof SpellAbility) {
|
||||||
MageObject object = game.getObject(source);
|
MageObject object = game.getObject(source);
|
||||||
if (object != null && object.isLegendary()) {
|
if (object != null && object.isLegendary(game)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -89,9 +89,9 @@ class VolrathsShapeshifterEffect extends ContinuousEffectImpl {
|
||||||
permanent.removeAllSubTypes(game);
|
permanent.removeAllSubTypes(game);
|
||||||
permanent.copySubTypesFrom(game, card);
|
permanent.copySubTypesFrom(game, card);
|
||||||
|
|
||||||
permanent.getSuperType().clear();
|
permanent.removeAllSuperTypes(game);
|
||||||
for (SuperType type : card.getSuperType()) {
|
for (SuperType type : card.getSuperType(game)) {
|
||||||
permanent.addSuperType(type);
|
permanent.addSuperType(game, type);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -116,7 +116,7 @@ class YedoraGraveGardenerContinuousEffect extends ContinuousEffectImpl {
|
||||||
discard();
|
discard();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
target.getSuperType().clear();
|
target.removeAllSuperTypes(game);
|
||||||
target.removeAllCardTypes(game);
|
target.removeAllCardTypes(game);
|
||||||
target.removeAllSubTypes(game);
|
target.removeAllSubTypes(game);
|
||||||
target.addCardType(game, CardType.LAND);
|
target.addCardType(game, CardType.LAND);
|
||||||
|
|
|
@ -73,11 +73,11 @@ class YouCannotPassWatcher extends Watcher {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Permanent permanent = game.getPermanent(event.getTargetId());
|
Permanent permanent = game.getPermanent(event.getTargetId());
|
||||||
if (permanent != null && permanent.isLegendary()) {
|
if (permanent != null && permanent.isLegendary(game)) {
|
||||||
set.add(new MageObjectReference(event.getSourceId(), game));
|
set.add(new MageObjectReference(event.getSourceId(), game));
|
||||||
}
|
}
|
||||||
permanent = game.getPermanent(event.getSourceId());
|
permanent = game.getPermanent(event.getSourceId());
|
||||||
if (permanent != null && permanent.isLegendary()) {
|
if (permanent != null && permanent.isLegendary(game)) {
|
||||||
set.add(new MageObjectReference(event.getTargetId(), game));
|
set.add(new MageObjectReference(event.getTargetId(), game));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -126,6 +126,7 @@ public final class TheBrothersWarCommander extends ExpansionSet {
|
||||||
cards.add(new SetCardInfo("Relic of Progenitus", 157, Rarity.UNCOMMON, mage.cards.r.RelicOfProgenitus.class));
|
cards.add(new SetCardInfo("Relic of Progenitus", 157, Rarity.UNCOMMON, mage.cards.r.RelicOfProgenitus.class));
|
||||||
cards.add(new SetCardInfo("Reliquary Tower", 196, Rarity.UNCOMMON, mage.cards.r.ReliquaryTower.class));
|
cards.add(new SetCardInfo("Reliquary Tower", 196, Rarity.UNCOMMON, mage.cards.r.ReliquaryTower.class));
|
||||||
cards.add(new SetCardInfo("River of Tears", 197, Rarity.RARE, mage.cards.r.RiverOfTears.class));
|
cards.add(new SetCardInfo("River of Tears", 197, Rarity.RARE, mage.cards.r.RiverOfTears.class));
|
||||||
|
cards.add(new SetCardInfo("Rootpath Purifier", 24, Rarity.MYTHIC, mage.cards.r.RootpathPurifier.class));
|
||||||
cards.add(new SetCardInfo("Sai, Master Thopterist", 93, Rarity.RARE, mage.cards.s.SaiMasterThopterist.class));
|
cards.add(new SetCardInfo("Sai, Master Thopterist", 93, Rarity.RARE, mage.cards.s.SaiMasterThopterist.class));
|
||||||
cards.add(new SetCardInfo("Sanwell, Avenger Ace", 5, Rarity.RARE, mage.cards.s.SanwellAvengerAce.class));
|
cards.add(new SetCardInfo("Sanwell, Avenger Ace", 5, Rarity.RARE, mage.cards.s.SanwellAvengerAce.class));
|
||||||
cards.add(new SetCardInfo("Sardian Avenger", 23, Rarity.RARE, mage.cards.s.SardianAvenger.class));
|
cards.add(new SetCardInfo("Sardian Avenger", 23, Rarity.RARE, mage.cards.s.SardianAvenger.class));
|
||||||
|
|
|
@ -112,7 +112,7 @@ public class LazavDimirMastermindTest extends CardTestPlayerBase {
|
||||||
Permanent lazav = getPermanent("Lazav, Dimir Mastermind", playerA.getId());
|
Permanent lazav = getPermanent("Lazav, Dimir Mastermind", playerA.getId());
|
||||||
Assert.assertTrue(lazav.getAbilities().contains(FlyingAbility.getInstance()));
|
Assert.assertTrue(lazav.getAbilities().contains(FlyingAbility.getInstance()));
|
||||||
Assert.assertTrue(lazav.hasSubtype(SubType.SPECTER, currentGame));
|
Assert.assertTrue(lazav.hasSubtype(SubType.SPECTER, currentGame));
|
||||||
Assert.assertTrue(lazav.isLegendary());
|
Assert.assertTrue(lazav.isLegendary(currentGame));
|
||||||
|
|
||||||
assertPermanentCount(playerA, "Silvercoat Lion", 1);
|
assertPermanentCount(playerA, "Silvercoat Lion", 1);
|
||||||
assertPowerToughness(playerA, "Silvercoat Lion", 2, 2);
|
assertPowerToughness(playerA, "Silvercoat Lion", 2, 2);
|
||||||
|
@ -142,7 +142,7 @@ public class LazavDimirMastermindTest extends CardTestPlayerBase {
|
||||||
|
|
||||||
Permanent lazav = getPermanent("Lazav, Dimir Mastermind", playerA.getId());
|
Permanent lazav = getPermanent("Lazav, Dimir Mastermind", playerA.getId());
|
||||||
Assert.assertTrue(lazav.hasSubtype(SubType.CAT, currentGame));
|
Assert.assertTrue(lazav.hasSubtype(SubType.CAT, currentGame));
|
||||||
Assert.assertTrue(lazav.isLegendary());
|
Assert.assertTrue(lazav.isLegendary(currentGame));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -258,7 +258,7 @@ public class ModalDoubleFacesCardsTest extends CardTestPlayerBase {
|
||||||
|
|
||||||
// stats in hand - mdf
|
// stats in hand - mdf
|
||||||
card = getHandCards(playerA).stream().filter(c -> CardUtil.haveSameNames(c, "Halvar, God of Battle", currentGame)).findFirst().get();
|
card = getHandCards(playerA).stream().filter(c -> CardUtil.haveSameNames(c, "Halvar, God of Battle", currentGame)).findFirst().get();
|
||||||
Assert.assertTrue("must be legendary", card.isLegendary());
|
Assert.assertTrue("must be legendary", card.isLegendary(currentGame));
|
||||||
Assert.assertTrue("must be creature", card.isCreature(currentGame));
|
Assert.assertTrue("must be creature", card.isCreature(currentGame));
|
||||||
Assert.assertTrue("must be god", card.hasSubtype(SubType.GOD, currentGame));
|
Assert.assertTrue("must be god", card.hasSubtype(SubType.GOD, currentGame));
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,123 @@
|
||||||
|
package org.mage.test.cards.single.brc;
|
||||||
|
|
||||||
|
import mage.constants.PhaseStep;
|
||||||
|
import mage.constants.Zone;
|
||||||
|
import mage.filter.StaticFilters;
|
||||||
|
import mage.game.permanent.Permanent;
|
||||||
|
import org.junit.Assert;
|
||||||
|
import org.junit.Test;
|
||||||
|
import org.mage.test.serverside.base.CardTestPlayerBase;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author TheElk801
|
||||||
|
*/
|
||||||
|
public class RootpathPurifierTest extends CardTestPlayerBase {
|
||||||
|
|
||||||
|
private static final String purifier = "Rootpath Purifier";
|
||||||
|
private static final String growth = "Rampant Growth";
|
||||||
|
private static final String lay = "Lay of the Land";
|
||||||
|
private static final String tree = "Tree of Tales";
|
||||||
|
private static final String murder = "Murder";
|
||||||
|
|
||||||
|
private void checkSupertypes() {
|
||||||
|
Assert.assertTrue(
|
||||||
|
"All lands in library should be basic",
|
||||||
|
playerA.getLibrary()
|
||||||
|
.getCards(currentGame)
|
||||||
|
.stream()
|
||||||
|
.filter(card -> card.isLand(currentGame))
|
||||||
|
.allMatch(card -> card.isBasic(currentGame))
|
||||||
|
);
|
||||||
|
for (Permanent permanent : currentGame.getBattlefield().getActivePermanents(
|
||||||
|
StaticFilters.FILTER_CONTROLLED_PERMANENT_LAND, playerA.getId(), currentGame
|
||||||
|
)) {
|
||||||
|
Assert.assertTrue(permanent.getName() + " should be basic", permanent.isBasic(currentGame));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testChangeSupertypeInLibrary() {
|
||||||
|
addCard(Zone.BATTLEFIELD, playerA, purifier);
|
||||||
|
addCard(Zone.LIBRARY, playerA, tree);
|
||||||
|
|
||||||
|
|
||||||
|
setStrictChooseMode(true);
|
||||||
|
setStopAt(1, PhaseStep.END_TURN);
|
||||||
|
execute();
|
||||||
|
|
||||||
|
assertPermanentCount(playerA, purifier, 1);
|
||||||
|
checkSupertypes();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testSearchToBattlefield() {
|
||||||
|
addCard(Zone.BATTLEFIELD, playerA, "Forest", 2);
|
||||||
|
addCard(Zone.BATTLEFIELD, playerA, purifier);
|
||||||
|
addCard(Zone.HAND, playerA, growth);
|
||||||
|
addCard(Zone.LIBRARY, playerA, tree);
|
||||||
|
|
||||||
|
addTarget(playerA, tree);
|
||||||
|
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, growth);
|
||||||
|
|
||||||
|
setStrictChooseMode(true);
|
||||||
|
setStopAt(1, PhaseStep.END_TURN);
|
||||||
|
execute();
|
||||||
|
|
||||||
|
assertPermanentCount(playerA, tree, 1);
|
||||||
|
assertPermanentCount(playerA, purifier, 1);
|
||||||
|
checkSupertypes();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testSearchToHand() {
|
||||||
|
addCard(Zone.BATTLEFIELD, playerA, "Forest", 1);
|
||||||
|
addCard(Zone.BATTLEFIELD, playerA, purifier);
|
||||||
|
addCard(Zone.HAND, playerA, lay);
|
||||||
|
addCard(Zone.LIBRARY, playerA, tree);
|
||||||
|
|
||||||
|
addTarget(playerA, tree);
|
||||||
|
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, lay);
|
||||||
|
|
||||||
|
setStrictChooseMode(true);
|
||||||
|
setStopAt(1, PhaseStep.END_TURN);
|
||||||
|
execute();
|
||||||
|
|
||||||
|
assertHandCount(playerA, tree, 1);
|
||||||
|
assertPermanentCount(playerA, purifier, 1);
|
||||||
|
checkSupertypes();
|
||||||
|
Assert.assertTrue(
|
||||||
|
tree + " should not be basic in hand",
|
||||||
|
playerA.getHand()
|
||||||
|
.getCards(currentGame)
|
||||||
|
.stream()
|
||||||
|
.filter(card -> tree.equals(card.getName()))
|
||||||
|
.noneMatch(card -> card.isBasic(currentGame))
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testRemove() {
|
||||||
|
addCard(Zone.BATTLEFIELD, playerA, "Swamp", 3);
|
||||||
|
addCard(Zone.BATTLEFIELD, playerA, purifier);
|
||||||
|
addCard(Zone.HAND, playerA, murder);
|
||||||
|
addCard(Zone.LIBRARY, playerA, tree);
|
||||||
|
|
||||||
|
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, murder, purifier);
|
||||||
|
|
||||||
|
setStrictChooseMode(true);
|
||||||
|
setStopAt(1, PhaseStep.END_TURN);
|
||||||
|
execute();
|
||||||
|
|
||||||
|
assertPermanentCount(playerA, purifier, 0);
|
||||||
|
assertGraveyardCount(playerA, purifier, 1);
|
||||||
|
assertGraveyardCount(playerA, murder, 1);
|
||||||
|
Assert.assertTrue(
|
||||||
|
tree + " should not be basic",
|
||||||
|
playerA.getLibrary()
|
||||||
|
.getCards(currentGame)
|
||||||
|
.stream()
|
||||||
|
.filter(card -> tree.equals(card.getName()))
|
||||||
|
.noneMatch(card -> card.isBasic(currentGame))
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
|
@ -20,7 +20,6 @@ import mage.cards.repository.*;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.constants.Rarity;
|
import mage.constants.Rarity;
|
||||||
import mage.constants.SubType;
|
import mage.constants.SubType;
|
||||||
import mage.constants.SuperType;
|
|
||||||
import mage.game.command.Dungeon;
|
import mage.game.command.Dungeon;
|
||||||
import mage.game.command.Plane;
|
import mage.game.command.Plane;
|
||||||
import mage.game.draft.DraftCube;
|
import mage.game.draft.DraftCube;
|
||||||
|
@ -1064,7 +1063,7 @@ public class VerifyCardDataTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
// CHECK: all planeswalkers must be legendary
|
// CHECK: all planeswalkers must be legendary
|
||||||
if (card.isPlaneswalker() && !card.getSuperType().contains(SuperType.LEGENDARY)) {
|
if (card.isPlaneswalker() && !card.isLegendary()) {
|
||||||
errorsList.add("Error: planeswalker must have legendary type: " + set.getCode() + " - " + set.getName() + " - " + card.getName() + " - " + card.getCardNumber());
|
errorsList.add("Error: planeswalker must have legendary type: " + set.getCode() + " - " + set.getName() + " - " + card.getName() + " - " + card.getCardNumber());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2248,12 +2247,12 @@ public class VerifyCardDataTest {
|
||||||
fail(card, "rarity", "basic land must be Rarity.LAND");
|
fail(card, "rarity", "basic land must be Rarity.LAND");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!card.getSuperType().contains(SuperType.BASIC)) {
|
if (!card.isBasic()) {
|
||||||
fail(card, "supertype", "basic land must be SuperType.BASIC");
|
fail(card, "supertype", "basic land must be SuperType.BASIC");
|
||||||
}
|
}
|
||||||
} else if (name.equals("Wastes")) {
|
} else if (name.equals("Wastes")) {
|
||||||
// Wastes are SuperType.BASIC but not necessarily Rarity.LAND
|
// Wastes are SuperType.BASIC but not necessarily Rarity.LAND
|
||||||
if (!card.getSuperType().contains(SuperType.BASIC)) {
|
if (!card.isBasic()) {
|
||||||
fail(card, "supertype", "Wastes must be SuperType.BASIC");
|
fail(card, "supertype", "Wastes must be SuperType.BASIC");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -2262,7 +2261,7 @@ public class VerifyCardDataTest {
|
||||||
fail(card, "rarity", "only basic land can be Rarity.LAND");
|
fail(card, "rarity", "only basic land can be Rarity.LAND");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (card.getSuperType().contains(SuperType.BASIC)) {
|
if (card.isBasic()) {
|
||||||
fail(card, "supertype", "only basic land can be SuperType.BASIC");
|
fail(card, "supertype", "only basic land can be SuperType.BASIC");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,22 +19,27 @@ import java.io.Serializable;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Set;
|
|
||||||
|
|
||||||
public interface MageObject extends MageItem, Serializable, Copyable<MageObject> {
|
public interface MageObject extends MageItem, Serializable, Copyable<MageObject> {
|
||||||
|
|
||||||
String getExpansionSetCode();
|
String getExpansionSetCode();
|
||||||
|
|
||||||
void setExpansionSetCode(String expansionSetCode);
|
void setExpansionSetCode(String expansionSetCode);
|
||||||
|
|
||||||
String getCardNumber();
|
String getCardNumber();
|
||||||
|
|
||||||
void setCardNumber(String cardNumber);
|
void setCardNumber(String cardNumber);
|
||||||
|
|
||||||
Integer getImageNumber();
|
Integer getImageNumber();
|
||||||
|
|
||||||
void setImageNumber(Integer imageNumber);
|
void setImageNumber(Integer imageNumber);
|
||||||
|
|
||||||
String getName();
|
String getName();
|
||||||
|
|
||||||
String getIdName();
|
String getIdName();
|
||||||
|
|
||||||
String getLogName();
|
String getLogName();
|
||||||
|
|
||||||
void setName(String name);
|
void setName(String name);
|
||||||
|
|
||||||
default List<CardType> getCardType() {
|
default List<CardType> getCardType() {
|
||||||
|
@ -66,7 +71,11 @@ public interface MageObject extends MageItem, Serializable, Copyable<MageObject>
|
||||||
|
|
||||||
boolean hasSubtype(SubType subtype, Game game);
|
boolean hasSubtype(SubType subtype, Game game);
|
||||||
|
|
||||||
Set<SuperType> getSuperType();
|
default List<SuperType> getSuperType() {
|
||||||
|
return getSuperType(null);
|
||||||
|
}
|
||||||
|
|
||||||
|
List<SuperType> getSuperType(Game game);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* For cards: return basic abilities (without dynamic added)
|
* For cards: return basic abilities (without dynamic added)
|
||||||
|
@ -143,7 +152,7 @@ public interface MageObject extends MageItem, Serializable, Copyable<MageObject>
|
||||||
|
|
||||||
default boolean isHistoric(Game game) {
|
default boolean isHistoric(Game game) {
|
||||||
return getCardType(game).contains(CardType.ARTIFACT)
|
return getCardType(game).contains(CardType.ARTIFACT)
|
||||||
|| getSuperType().contains(SuperType.LEGENDARY)
|
|| getSuperType(game).contains(SuperType.LEGENDARY)
|
||||||
|| hasSubtype(SubType.SAGA, game);
|
|| hasSubtype(SubType.SAGA, game);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -236,30 +245,85 @@ public interface MageObject extends MageItem, Serializable, Copyable<MageObject>
|
||||||
}
|
}
|
||||||
|
|
||||||
default boolean isLegendary() {
|
default boolean isLegendary() {
|
||||||
return getSuperType().contains(SuperType.LEGENDARY);
|
return isLegendary(null);
|
||||||
|
}
|
||||||
|
|
||||||
|
default boolean isLegendary(Game game) {
|
||||||
|
return getSuperType(game).contains(SuperType.LEGENDARY);
|
||||||
}
|
}
|
||||||
|
|
||||||
default boolean isSnow() {
|
default boolean isSnow() {
|
||||||
return getSuperType().contains(SuperType.SNOW);
|
return isSnow(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
default void addSuperType(SuperType superType) {
|
default boolean isSnow(Game game) {
|
||||||
if (getSuperType().contains(superType)) {
|
return getSuperType(game).contains(SuperType.SNOW);
|
||||||
return;
|
|
||||||
}
|
|
||||||
getSuperType().add(superType);
|
|
||||||
}
|
|
||||||
|
|
||||||
default void removeSuperType(SuperType superType) {
|
|
||||||
getSuperType().remove(superType);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
default boolean isBasic() {
|
default boolean isBasic() {
|
||||||
return getSuperType().contains(SuperType.BASIC);
|
return isBasic(null);
|
||||||
|
}
|
||||||
|
|
||||||
|
default boolean isBasic(Game game) {
|
||||||
|
return getSuperType(game).contains(SuperType.BASIC);
|
||||||
}
|
}
|
||||||
|
|
||||||
default boolean isWorld() {
|
default boolean isWorld() {
|
||||||
return getSuperType().contains(SuperType.WORLD);
|
return isWorld(null);
|
||||||
|
}
|
||||||
|
|
||||||
|
default boolean isWorld(Game game) {
|
||||||
|
return getSuperType(game).contains(SuperType.WORLD);
|
||||||
|
}
|
||||||
|
|
||||||
|
default void addSuperType(SuperType superType) {
|
||||||
|
addSuperType(null, superType);
|
||||||
|
}
|
||||||
|
|
||||||
|
default void addSuperType(Game game, SuperType superType) {
|
||||||
|
List<SuperType> currentSuperTypes;
|
||||||
|
if (game != null) {
|
||||||
|
// dynamic
|
||||||
|
currentSuperTypes = game.getState().getCreateMageObjectAttribute(this, game).getSuperType();
|
||||||
|
} else {
|
||||||
|
// static
|
||||||
|
currentSuperTypes = getSuperType();
|
||||||
|
}
|
||||||
|
if (!currentSuperTypes.contains(superType)) {
|
||||||
|
currentSuperTypes.add(superType);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
default void removeAllSuperTypes() {
|
||||||
|
removeAllSuperTypes(null);
|
||||||
|
}
|
||||||
|
|
||||||
|
default void removeAllSuperTypes(Game game) {
|
||||||
|
List<SuperType> currentSuperTypes;
|
||||||
|
if (game != null) {
|
||||||
|
// dynamic
|
||||||
|
currentSuperTypes = game.getState().getCreateMageObjectAttribute(this, game).getSuperType();
|
||||||
|
} else {
|
||||||
|
// static
|
||||||
|
currentSuperTypes = getSuperType();
|
||||||
|
}
|
||||||
|
currentSuperTypes.clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
default void removeSuperType(SuperType superType) {
|
||||||
|
removeSuperType(null, superType);
|
||||||
|
}
|
||||||
|
|
||||||
|
default void removeSuperType(Game game, SuperType superType) {
|
||||||
|
List<SuperType> currentSuperTypes;
|
||||||
|
if (game != null) {
|
||||||
|
// dynamic
|
||||||
|
currentSuperTypes = game.getState().getCreateMageObjectAttribute(this, game).getSuperType();
|
||||||
|
} else {
|
||||||
|
// static
|
||||||
|
currentSuperTypes = getSuperType();
|
||||||
|
}
|
||||||
|
currentSuperTypes.remove(superType);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -38,9 +38,9 @@ public abstract class MageObjectImpl implements MageObject {
|
||||||
private String cardNumber = "";
|
private String cardNumber = "";
|
||||||
private int imageNumber = 0;
|
private int imageNumber = 0;
|
||||||
|
|
||||||
|
protected List<SuperType> supertype = new ArrayList<>();
|
||||||
protected List<CardType> cardType = new ArrayList<>();
|
protected List<CardType> cardType = new ArrayList<>();
|
||||||
protected SubTypes subtype = new SubTypes();
|
protected SubTypes subtype = new SubTypes();
|
||||||
protected Set<SuperType> supertype = EnumSet.noneOf(SuperType.class);
|
|
||||||
protected Abilities<Ability> abilities;
|
protected Abilities<Ability> abilities;
|
||||||
|
|
||||||
protected String text;
|
protected String text;
|
||||||
|
@ -146,7 +146,14 @@ public abstract class MageObjectImpl implements MageObject {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Set<SuperType> getSuperType() {
|
public List<SuperType> getSuperType(Game game) {
|
||||||
|
if (game != null) {
|
||||||
|
// dynamic
|
||||||
|
MageObjectAttribute mageObjectAttribute = game.getState().getMageObjectAttribute(getId());
|
||||||
|
if (mageObjectAttribute != null) {
|
||||||
|
return mageObjectAttribute.getSuperType();
|
||||||
|
}
|
||||||
|
}
|
||||||
return supertype;
|
return supertype;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -38,12 +38,12 @@ public class EquippedHasSupertypeCondition implements Condition {
|
||||||
}
|
}
|
||||||
if (attachedTo != null) {
|
if (attachedTo != null) {
|
||||||
if (superType != null) {
|
if (superType != null) {
|
||||||
if (attachedTo.getSuperType().contains(this.superType)) {
|
if (attachedTo.getSuperType(game).contains(this.superType)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
for (SuperType s : superTypes) {
|
for (SuperType s : superTypes) {
|
||||||
if (attachedTo.getSuperType().contains(s)) {
|
if (attachedTo.getSuperType(game).contains(s)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,7 +23,7 @@ public class TargetHasSuperTypeCondition implements Condition {
|
||||||
if (!source.getTargets().isEmpty()) {
|
if (!source.getTargets().isEmpty()) {
|
||||||
MageObject mageObject = game.getObject(source.getFirstTarget());
|
MageObject mageObject = game.getObject(source.getFirstTarget());
|
||||||
if (mageObject != null) {
|
if (mageObject != null) {
|
||||||
return mageObject.getSuperType().contains(superType);
|
return mageObject.getSuperType(game).contains(superType);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -7,7 +7,6 @@ import mage.abilities.effects.ContinuousEffectImpl;
|
||||||
import mage.cards.Card;
|
import mage.cards.Card;
|
||||||
import mage.constants.*;
|
import mage.constants.*;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.game.command.CommandObject;
|
|
||||||
import mage.game.permanent.Permanent;
|
import mage.game.permanent.Permanent;
|
||||||
import mage.game.permanent.PermanentCard;
|
import mage.game.permanent.PermanentCard;
|
||||||
import mage.game.permanent.PermanentToken;
|
import mage.game.permanent.PermanentToken;
|
||||||
|
@ -112,9 +111,9 @@ public class CopyEffect extends ContinuousEffectImpl {
|
||||||
permanent.removeAllSubTypes(game);
|
permanent.removeAllSubTypes(game);
|
||||||
permanent.copySubTypesFrom(game, copyFromObject);
|
permanent.copySubTypesFrom(game, copyFromObject);
|
||||||
|
|
||||||
permanent.getSuperType().clear();
|
permanent.removeAllSuperTypes(game);
|
||||||
for (SuperType type : copyFromObject.getSuperType()) {
|
for (SuperType type : copyFromObject.getSuperType(game)) {
|
||||||
permanent.addSuperType(type);
|
permanent.addSuperType(game, type);
|
||||||
}
|
}
|
||||||
|
|
||||||
permanent.removeAllAbilities(source.getSourceId(), game);
|
permanent.removeAllAbilities(source.getSourceId(), game);
|
||||||
|
|
|
@ -33,9 +33,9 @@ public class CopyTokenEffect extends ContinuousEffectImpl {
|
||||||
}
|
}
|
||||||
permanent.removeAllSubTypes(game);
|
permanent.removeAllSubTypes(game);
|
||||||
permanent.copySubTypesFrom(game, token);
|
permanent.copySubTypesFrom(game, token);
|
||||||
permanent.getSuperType().clear();
|
permanent.removeAllSuperTypes(game);
|
||||||
for (SuperType type : token.getSuperType()) {
|
for (SuperType type : token.getSuperType(game)) {
|
||||||
permanent.addSuperType(type);
|
permanent.addSuperType(game, type);
|
||||||
}
|
}
|
||||||
permanent.getAbilities().clear();
|
permanent.getAbilities().clear();
|
||||||
for (Ability ability : token.getAbilities()) {
|
for (Ability ability : token.getAbilities()) {
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
|
|
||||||
package mage.abilities.effects.common.continuous;
|
package mage.abilities.effects.common.continuous;
|
||||||
|
|
||||||
import java.util.Locale;
|
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.effects.ContinuousEffectImpl;
|
import mage.abilities.effects.ContinuousEffectImpl;
|
||||||
import mage.constants.*;
|
import mage.constants.*;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.game.permanent.Permanent;
|
import mage.game.permanent.Permanent;
|
||||||
|
|
||||||
|
import java.util.Locale;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author nantuko
|
* @author nantuko
|
||||||
*/
|
*/
|
||||||
|
@ -34,8 +34,8 @@ public class AddCardSuperTypeAttachedEffect extends ContinuousEffectImpl {
|
||||||
Permanent equipment = game.getPermanent(source.getSourceId());
|
Permanent equipment = game.getPermanent(source.getSourceId());
|
||||||
if (equipment != null && equipment.getAttachedTo() != null) {
|
if (equipment != null && equipment.getAttachedTo() != null) {
|
||||||
Permanent target = game.getPermanent(equipment.getAttachedTo());
|
Permanent target = game.getPermanent(equipment.getAttachedTo());
|
||||||
if (target != null && !target.getSuperType().contains(addedSuperType)) {
|
if (target != null) {
|
||||||
target.addSuperType(addedSuperType);
|
target.addSuperType(game, addedSuperType);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -106,10 +106,8 @@ public class BecomesCreatureAllEffect extends ContinuousEffectImpl {
|
||||||
}
|
}
|
||||||
permanent.copySubTypesFrom(game, token);
|
permanent.copySubTypesFrom(game, token);
|
||||||
|
|
||||||
for (SuperType t : token.getSuperType()) {
|
for (SuperType t : token.getSuperType(game)) {
|
||||||
if (!permanent.getSuperType().contains(t)) {
|
permanent.addSuperType(game, t);
|
||||||
permanent.addSuperType(t);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -62,9 +62,8 @@ public class BecomesCreatureAttachedEffect extends ContinuousEffectImpl {
|
||||||
}
|
}
|
||||||
switch (layer) {
|
switch (layer) {
|
||||||
case TypeChangingEffects_4:
|
case TypeChangingEffects_4:
|
||||||
for (SuperType t : token.getSuperType()) {
|
for (SuperType t : token.getSuperType(game)) {
|
||||||
permanent.addSuperType(t);
|
permanent.addSuperType(game, t);
|
||||||
|
|
||||||
}
|
}
|
||||||
// card type
|
// card type
|
||||||
switch (loseType) {
|
switch (loseType) {
|
||||||
|
|
|
@ -108,10 +108,8 @@ public class BecomesCreatureTargetEffect extends ContinuousEffectImpl {
|
||||||
}
|
}
|
||||||
permanent.copySubTypesFrom(game, token);
|
permanent.copySubTypesFrom(game, token);
|
||||||
|
|
||||||
for (SuperType t : token.getSuperType()) {
|
for (SuperType t : token.getSuperType(game)) {
|
||||||
if (!permanent.getSuperType().contains(t)) {
|
permanent.addSuperType(game, t);
|
||||||
permanent.addSuperType(t);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -72,7 +72,7 @@ public class BecomesFaceDownCreatureAllEffect extends ContinuousEffectImpl imple
|
||||||
switch (layer) {
|
switch (layer) {
|
||||||
case TypeChangingEffects_4:
|
case TypeChangingEffects_4:
|
||||||
permanent.setName("");
|
permanent.setName("");
|
||||||
permanent.getSuperType().clear();
|
permanent.removeAllSuperTypes(game);
|
||||||
permanent.removeAllCardTypes(game);
|
permanent.removeAllCardTypes(game);
|
||||||
permanent.addCardType(game, CardType.CREATURE);
|
permanent.addCardType(game, CardType.CREATURE);
|
||||||
permanent.removeAllSubTypes(game);
|
permanent.removeAllSubTypes(game);
|
||||||
|
|
|
@ -133,7 +133,7 @@ public class BecomesFaceDownCreatureEffect extends ContinuousEffectImpl implemen
|
||||||
switch (layer) {
|
switch (layer) {
|
||||||
case TypeChangingEffects_4:
|
case TypeChangingEffects_4:
|
||||||
permanent.setName("");
|
permanent.setName("");
|
||||||
permanent.getSuperType().clear();
|
permanent.removeAllSuperTypes(game);
|
||||||
permanent.removeAllCardTypes(game);
|
permanent.removeAllCardTypes(game);
|
||||||
permanent.addCardType(game, CardType.CREATURE);
|
permanent.addCardType(game, CardType.CREATURE);
|
||||||
permanent.removeAllSubTypes(game);
|
permanent.removeAllSubTypes(game);
|
||||||
|
|
|
@ -152,7 +152,7 @@ public class MorphAbility extends AlternativeSourceCostsImpl {
|
||||||
targetObject.removeAllCardTypes(game);
|
targetObject.removeAllCardTypes(game);
|
||||||
targetObject.addCardType(game, CardType.CREATURE);
|
targetObject.addCardType(game, CardType.CREATURE);
|
||||||
targetObject.removeAllSubTypes(game);
|
targetObject.removeAllSubTypes(game);
|
||||||
targetObject.getSuperType().clear();
|
targetObject.removeAllSuperTypes(game);
|
||||||
targetObject.getManaCost().clear();
|
targetObject.getManaCost().clear();
|
||||||
|
|
||||||
Token emptyImage = new EmptyToken();
|
Token emptyImage = new EmptyToken();
|
||||||
|
|
|
@ -56,9 +56,9 @@ public class TransformAbility extends SimpleStaticAbility {
|
||||||
}
|
}
|
||||||
permanent.removeAllSubTypes(game);
|
permanent.removeAllSubTypes(game);
|
||||||
permanent.copySubTypesFrom(game, sourceCard);
|
permanent.copySubTypesFrom(game, sourceCard);
|
||||||
permanent.getSuperType().clear();
|
permanent.removeAllSuperTypes(game);
|
||||||
for (SuperType type : sourceCard.getSuperType()) {
|
for (SuperType type : sourceCard.getSuperType(game)) {
|
||||||
permanent.addSuperType(type);
|
permanent.addSuperType(game, type);
|
||||||
}
|
}
|
||||||
|
|
||||||
CardUtil.copySetAndCardNumber(permanent, sourceCard);
|
CardUtil.copySetAndCardNumber(permanent, sourceCard);
|
||||||
|
@ -81,15 +81,11 @@ public class TransformAbility extends SimpleStaticAbility {
|
||||||
// TODO: must be removed after transform cards (one side) migrated to MDF engine (multiple sides)
|
// TODO: must be removed after transform cards (one side) migrated to MDF engine (multiple sides)
|
||||||
Card newCard = mainSide.copy();
|
Card newCard = mainSide.copy();
|
||||||
newCard.setName(otherSide.getName());
|
newCard.setName(otherSide.getName());
|
||||||
newCard.getSuperType().clear();
|
|
||||||
|
|
||||||
// mana value must be from main side only
|
// mana value must be from main side only
|
||||||
newCard.getManaCost().clear();
|
newCard.getManaCost().clear();
|
||||||
newCard.getManaCost().add(mainSide.getManaCost().copy());
|
newCard.getManaCost().add(mainSide.getManaCost().copy());
|
||||||
|
|
||||||
for (SuperType type : otherSide.getSuperType()) {
|
|
||||||
newCard.addSuperType(type);
|
|
||||||
}
|
|
||||||
game.getState().getCardState(newCard.getId()).clearAbilities();
|
game.getState().getCardState(newCard.getId()).clearAbilities();
|
||||||
for (Ability ability : otherSide.getAbilities()) {
|
for (Ability ability : otherSide.getAbilities()) {
|
||||||
game.getState().addOtherAbility(newCard, ability);
|
game.getState().addOtherAbility(newCard, ability);
|
||||||
|
@ -108,6 +104,8 @@ public class TransformAbility extends SimpleStaticAbility {
|
||||||
moa.getColor().setColor(otherSide.getColor(game));
|
moa.getColor().setColor(otherSide.getColor(game));
|
||||||
moa.getCardType().clear();
|
moa.getCardType().clear();
|
||||||
moa.getCardType().addAll(otherSide.getCardType(game));
|
moa.getCardType().addAll(otherSide.getCardType(game));
|
||||||
|
moa.getSuperType().clear();
|
||||||
|
moa.getSuperType().addAll(otherSide.getSuperType(game));
|
||||||
moa.getSubtype().clear();
|
moa.getSubtype().clear();
|
||||||
moa.getSubtype().addAll(otherSide.getSubtype(game));
|
moa.getSubtype().addAll(otherSide.getSubtype(game));
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,6 @@ import mage.util.CardUtil;
|
||||||
import mage.util.SubTypes;
|
import mage.util.SubTypes;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Set;
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -181,10 +180,10 @@ public abstract class ModalDoubleFacesCard extends CardImpl implements CardWithH
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Set<SuperType> getSuperType() {
|
public List<SuperType> getSuperType(Game game) {
|
||||||
// CardImpl's constructor can call some code on init, so you must check left/right before
|
// CardImpl's constructor can call some code on init, so you must check left/right before
|
||||||
// it's a bad workaround
|
// it's a bad workaround
|
||||||
return leftHalfCard != null ? leftHalfCard.getSuperType() : supertype;
|
return leftHalfCard != null ? leftHalfCard.getSuperType(game) : supertype;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -13,7 +13,9 @@ import mage.util.CardUtil;
|
||||||
import mage.util.SubTypes;
|
import mage.util.SubTypes;
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.List;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -363,8 +365,8 @@ public class CardInfo {
|
||||||
this.subtypes = joinList(subtypes);
|
this.subtypes = joinList(subtypes);
|
||||||
}
|
}
|
||||||
|
|
||||||
public final Set<SuperType> getSupertypes() {
|
public final List<SuperType> getSupertypes() {
|
||||||
Set<SuperType> list = EnumSet.noneOf(SuperType.class);
|
List<SuperType> list = new ArrayList<>();
|
||||||
for (String type : this.supertypes.split(SEPARATOR)) {
|
for (String type : this.supertypes.split(SEPARATOR)) {
|
||||||
try {
|
try {
|
||||||
list.add(SuperType.valueOf(type));
|
list.add(SuperType.valueOf(type));
|
||||||
|
@ -374,7 +376,7 @@ public class CardInfo {
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
public final void setSuperTypes(Set<SuperType> superTypes) {
|
public final void setSuperTypes(List<SuperType> superTypes) {
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
for (SuperType item : superTypes) {
|
for (SuperType item : superTypes) {
|
||||||
sb.append(item.name()).append(SEPARATOR);
|
sb.append(item.name()).append(SEPARATOR);
|
||||||
|
|
|
@ -26,7 +26,7 @@ public enum SuperType {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(MageObject input, Game game) {
|
public boolean apply(MageObject input, Game game) {
|
||||||
return input.getSuperType().contains(supertype);
|
return input.getSuperType(game).contains(supertype);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -4,8 +4,6 @@ import mage.MageInt;
|
||||||
import mage.MageObject;
|
import mage.MageObject;
|
||||||
import mage.MageObjectImpl;
|
import mage.MageObjectImpl;
|
||||||
import mage.ObjectColor;
|
import mage.ObjectColor;
|
||||||
import mage.abilities.Abilities;
|
|
||||||
import mage.abilities.AbilitiesImpl;
|
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.costs.mana.ManaCost;
|
import mage.abilities.costs.mana.ManaCost;
|
||||||
import mage.abilities.costs.mana.ManaCosts;
|
import mage.abilities.costs.mana.ManaCosts;
|
||||||
|
@ -16,17 +14,17 @@ import mage.constants.SubType;
|
||||||
import mage.constants.SuperType;
|
import mage.constants.SuperType;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.game.events.ZoneChangeEvent;
|
import mage.game.events.ZoneChangeEvent;
|
||||||
import mage.util.GameLog;
|
|
||||||
import mage.util.SubTypes;
|
import mage.util.SubTypes;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.Collections;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author LevelX2
|
* @author LevelX2
|
||||||
*/
|
*/
|
||||||
public abstract class Designation extends MageObjectImpl {
|
public abstract class Designation extends MageObjectImpl {
|
||||||
|
|
||||||
private static final List<CardType> emptyList = Collections.unmodifiableList(new ArrayList<>());
|
|
||||||
private static final ObjectColor emptyColor = new ObjectColor();
|
private static final ObjectColor emptyColor = new ObjectColor();
|
||||||
private static final ManaCostsImpl emptyCost = new ManaCostsImpl<>();
|
private static final ManaCostsImpl emptyCost = new ManaCostsImpl<>();
|
||||||
|
|
||||||
|
@ -93,7 +91,7 @@ public abstract class Designation extends MageObjectImpl {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<CardType> getCardType(Game game) {
|
public List<CardType> getCardType(Game game) {
|
||||||
return emptyList;
|
return Collections.emptyList();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -112,8 +110,8 @@ public abstract class Designation extends MageObjectImpl {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public EnumSet<SuperType> getSuperType() {
|
public List<SuperType> getSuperType(Game game) {
|
||||||
return EnumSet.noneOf(SuperType.class);
|
return Collections.emptyList();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -130,7 +130,7 @@ public class CardTextPredicate implements Predicate<Card> {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (SuperType superType : input.getSuperType()) {
|
for (SuperType superType : input.getSuperType(game)) {
|
||||||
if (superType.toString().equalsIgnoreCase(token)) {
|
if (superType.toString().equalsIgnoreCase(token)) {
|
||||||
found = true;
|
found = true;
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -2397,7 +2397,7 @@ public abstract class GameImpl implements Game {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (perm.isWorld()) {
|
if (perm.isWorld(this)) {
|
||||||
worldEnchantment.add(perm);
|
worldEnchantment.add(perm);
|
||||||
}
|
}
|
||||||
if (perm.hasSubtype(SubType.AURA, this)) {
|
if (perm.hasSubtype(SubType.AURA, this)) {
|
||||||
|
@ -2569,7 +2569,7 @@ public abstract class GameImpl implements Game {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (perm.isLegendary() && perm.legendRuleApplies()) {
|
if (perm.isLegendary(this) && perm.legendRuleApplies()) {
|
||||||
legendary.add(perm);
|
legendary.add(perm);
|
||||||
}
|
}
|
||||||
if (StaticFilters.FILTER_PERMANENT_EQUIPMENT.match(perm, this)) {
|
if (StaticFilters.FILTER_PERMANENT_EQUIPMENT.match(perm, this)) {
|
||||||
|
|
|
@ -3,6 +3,7 @@ package mage.game;
|
||||||
import mage.MageObject;
|
import mage.MageObject;
|
||||||
import mage.ObjectColor;
|
import mage.ObjectColor;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
|
import mage.constants.SuperType;
|
||||||
import mage.util.SubTypes;
|
import mage.util.SubTypes;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
@ -17,20 +18,23 @@ import java.util.List;
|
||||||
*/
|
*/
|
||||||
public class MageObjectAttribute implements Serializable {
|
public class MageObjectAttribute implements Serializable {
|
||||||
|
|
||||||
protected ObjectColor color;
|
protected final ObjectColor color;
|
||||||
protected SubTypes subtype;
|
protected final SubTypes subtype;
|
||||||
protected List<CardType> cardType;
|
protected final List<CardType> cardType;
|
||||||
|
protected final List<SuperType> superType;
|
||||||
|
|
||||||
public MageObjectAttribute(MageObject mageObject, Game game) {
|
public MageObjectAttribute(MageObject mageObject, Game game) {
|
||||||
color = mageObject.getColor().copy();
|
color = mageObject.getColor().copy();
|
||||||
subtype = new SubTypes(mageObject.getSubtype(game));
|
subtype = new SubTypes(mageObject.getSubtype(game));
|
||||||
cardType = new ArrayList<>(mageObject.getCardType(game));
|
cardType = new ArrayList<>(mageObject.getCardType(game));
|
||||||
|
superType = new ArrayList<>(mageObject.getSuperType(game));
|
||||||
}
|
}
|
||||||
|
|
||||||
public MageObjectAttribute(MageObjectAttribute mageObjectAttribute) {
|
public MageObjectAttribute(MageObjectAttribute mageObjectAttribute) {
|
||||||
this.color = mageObjectAttribute.color;
|
this.color = mageObjectAttribute.color;
|
||||||
this.subtype = mageObjectAttribute.subtype;
|
this.subtype = mageObjectAttribute.subtype;
|
||||||
this.cardType = mageObjectAttribute.cardType;
|
this.cardType = mageObjectAttribute.cardType;
|
||||||
|
this.superType = mageObjectAttribute.superType;
|
||||||
}
|
}
|
||||||
|
|
||||||
public MageObjectAttribute copy() {
|
public MageObjectAttribute copy() {
|
||||||
|
@ -48,4 +52,8 @@ public class MageObjectAttribute implements Serializable {
|
||||||
public List<CardType> getCardType() {
|
public List<CardType> getCardType() {
|
||||||
return cardType;
|
return cardType;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<SuperType> getSuperType() {
|
||||||
|
return superType;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -134,11 +134,11 @@ public class CombatGroup implements Serializable, Copyable<CombatGroup> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (ability.getSupertype() != null) {
|
if (ability.getSupertype() != null) {
|
||||||
if (perm.getSuperType().contains(ability.getSupertype())) {
|
if (perm.getSuperType(game).contains(ability.getSupertype())) {
|
||||||
for (UUID bandedId : creatureIds) {
|
for (UUID bandedId : creatureIds) {
|
||||||
if (!bandedId.equals(creatureId)) {
|
if (!bandedId.equals(creatureId)) {
|
||||||
Permanent banded = game.getPermanent(bandedId);
|
Permanent banded = game.getPermanent(bandedId);
|
||||||
if (banded != null && banded.getSuperType().contains(ability.getSupertype())) {
|
if (banded != null && banded.getSuperType(game).contains(ability.getSupertype())) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,7 +15,6 @@ import mage.constants.SubType;
|
||||||
import mage.constants.SuperType;
|
import mage.constants.SuperType;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.game.events.ZoneChangeEvent;
|
import mage.game.events.ZoneChangeEvent;
|
||||||
import mage.util.GameLog;
|
|
||||||
import mage.util.SubTypes;
|
import mage.util.SubTypes;
|
||||||
|
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
|
@ -181,8 +180,8 @@ public class Commander extends CommandObjectImpl {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Set<SuperType> getSuperType() {
|
public List<SuperType> getSuperType(Game game) {
|
||||||
return sourceObject.getSuperType();
|
return sourceObject.getSuperType(game);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -27,7 +27,6 @@ import mage.game.command.dungeons.TombOfAnnihilationDungeon;
|
||||||
import mage.game.events.GameEvent;
|
import mage.game.events.GameEvent;
|
||||||
import mage.game.events.ZoneChangeEvent;
|
import mage.game.events.ZoneChangeEvent;
|
||||||
import mage.players.Player;
|
import mage.players.Player;
|
||||||
import mage.util.GameLog;
|
|
||||||
import mage.util.SubTypes;
|
import mage.util.SubTypes;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
@ -45,7 +44,7 @@ public class Dungeon extends CommandObjectImpl {
|
||||||
dungeonNames.add("Dungeon of the Mad Mage");
|
dungeonNames.add("Dungeon of the Mad Mage");
|
||||||
}
|
}
|
||||||
|
|
||||||
private static final List<CardType> emptyList = Collections.unmodifiableList(Arrays.asList(CardType.DUNGEON));
|
private static final List<CardType> cardTypes = Collections.unmodifiableList(Arrays.asList(CardType.DUNGEON));
|
||||||
private static final ObjectColor emptyColor = new ObjectColor();
|
private static final ObjectColor emptyColor = new ObjectColor();
|
||||||
private static final ManaCosts<ManaCost> emptyCost = new ManaCostsImpl<>();
|
private static final ManaCosts<ManaCost> emptyCost = new ManaCostsImpl<>();
|
||||||
|
|
||||||
|
@ -204,7 +203,7 @@ public class Dungeon extends CommandObjectImpl {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<CardType> getCardType(Game game) {
|
public List<CardType> getCardType(Game game) {
|
||||||
return emptyList;
|
return cardTypes;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -223,8 +222,8 @@ public class Dungeon extends CommandObjectImpl {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public EnumSet<SuperType> getSuperType() {
|
public List<SuperType> getSuperType(Game game) {
|
||||||
return EnumSet.noneOf(SuperType.class);
|
return Collections.emptyList();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -11,7 +11,6 @@ import mage.abilities.costs.mana.ManaCosts;
|
||||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||||
import mage.abilities.effects.ContinuousEffect;
|
import mage.abilities.effects.ContinuousEffect;
|
||||||
import mage.abilities.effects.Effect;
|
import mage.abilities.effects.Effect;
|
||||||
import mage.cards.Card;
|
|
||||||
import mage.cards.FrameStyle;
|
import mage.cards.FrameStyle;
|
||||||
import mage.cards.repository.TokenInfo;
|
import mage.cards.repository.TokenInfo;
|
||||||
import mage.cards.repository.TokenRepository;
|
import mage.cards.repository.TokenRepository;
|
||||||
|
@ -20,19 +19,17 @@ import mage.constants.SubType;
|
||||||
import mage.constants.SuperType;
|
import mage.constants.SuperType;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.game.events.ZoneChangeEvent;
|
import mage.game.events.ZoneChangeEvent;
|
||||||
import mage.game.permanent.token.TokenImpl;
|
|
||||||
import mage.util.GameLog;
|
|
||||||
import mage.util.RandomUtil;
|
|
||||||
import mage.util.SubTypes;
|
import mage.util.SubTypes;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.Collections;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author nantuko
|
* @author nantuko
|
||||||
*/
|
*/
|
||||||
public abstract class Emblem extends CommandObjectImpl {
|
public abstract class Emblem extends CommandObjectImpl {
|
||||||
|
|
||||||
private static final List<CardType> emptyList = Collections.unmodifiableList(new ArrayList<>());
|
|
||||||
private static final ObjectColor emptyColor = new ObjectColor();
|
private static final ObjectColor emptyColor = new ObjectColor();
|
||||||
private static final ManaCosts emptyCost = new ManaCostsImpl<>();
|
private static final ManaCosts emptyCost = new ManaCostsImpl<>();
|
||||||
|
|
||||||
|
@ -121,7 +118,7 @@ public abstract class Emblem extends CommandObjectImpl {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<CardType> getCardType(Game game) {
|
public List<CardType> getCardType(Game game) {
|
||||||
return emptyList;
|
return Collections.emptyList();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -140,8 +137,8 @@ public abstract class Emblem extends CommandObjectImpl {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public EnumSet<SuperType> getSuperType() {
|
public List<SuperType> getSuperType(Game game) {
|
||||||
return EnumSet.noneOf(SuperType.class);
|
return Collections.emptyList();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -11,7 +11,6 @@ import mage.abilities.costs.mana.ManaCosts;
|
||||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||||
import mage.abilities.effects.ContinuousEffect;
|
import mage.abilities.effects.ContinuousEffect;
|
||||||
import mage.abilities.effects.Effect;
|
import mage.abilities.effects.Effect;
|
||||||
import mage.cards.Card;
|
|
||||||
import mage.cards.FrameStyle;
|
import mage.cards.FrameStyle;
|
||||||
import mage.cards.repository.TokenInfo;
|
import mage.cards.repository.TokenInfo;
|
||||||
import mage.cards.repository.TokenRepository;
|
import mage.cards.repository.TokenRepository;
|
||||||
|
@ -21,19 +20,19 @@ import mage.constants.SubType;
|
||||||
import mage.constants.SuperType;
|
import mage.constants.SuperType;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.game.events.ZoneChangeEvent;
|
import mage.game.events.ZoneChangeEvent;
|
||||||
import mage.util.GameLog;
|
|
||||||
import mage.util.RandomUtil;
|
import mage.util.RandomUtil;
|
||||||
import mage.util.SubTypes;
|
import mage.util.SubTypes;
|
||||||
|
|
||||||
import java.lang.reflect.Constructor;
|
import java.lang.reflect.Constructor;
|
||||||
import java.util.*;
|
import java.util.Collections;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author spjspj
|
* @author spjspj
|
||||||
*/
|
*/
|
||||||
public abstract class Plane extends CommandObjectImpl {
|
public abstract class Plane extends CommandObjectImpl {
|
||||||
|
|
||||||
private static final List<CardType> emptyList = Collections.unmodifiableList(new ArrayList<>());
|
|
||||||
private static final ObjectColor emptyColor = new ObjectColor();
|
private static final ObjectColor emptyColor = new ObjectColor();
|
||||||
private static final ManaCosts emptyCost = new ManaCostsImpl<>();
|
private static final ManaCosts emptyCost = new ManaCostsImpl<>();
|
||||||
|
|
||||||
|
@ -144,7 +143,7 @@ public abstract class Plane extends CommandObjectImpl {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<CardType> getCardType(Game game) {
|
public List<CardType> getCardType(Game game) {
|
||||||
return emptyList;
|
return Collections.emptyList();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -163,8 +162,8 @@ public abstract class Plane extends CommandObjectImpl {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public EnumSet<SuperType> getSuperType() {
|
public List<SuperType> getSuperType(Game game) {
|
||||||
return EnumSet.noneOf(SuperType.class);
|
return Collections.emptyList();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -124,7 +124,7 @@ class TheRingEmblemLegendaryEffect extends ContinuousEffectImpl {
|
||||||
if (permanent == null) {
|
if (permanent == null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
permanent.addSuperType(SuperType.LEGENDARY);
|
permanent.addSuperType(game, SuperType.LEGENDARY);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -103,7 +103,7 @@ public class PermanentToken extends PermanentImpl {
|
||||||
this.frameColor = token.getFrameColor(game);
|
this.frameColor = token.getFrameColor(game);
|
||||||
this.frameStyle = token.getFrameStyle();
|
this.frameStyle = token.getFrameStyle();
|
||||||
this.supertype.clear();
|
this.supertype.clear();
|
||||||
this.supertype.addAll(token.getSuperType());
|
this.supertype.addAll(token.getSuperType(game));
|
||||||
this.subtype.copyFrom(token.getSubtype(game));
|
this.subtype.copyFrom(token.getSubtype(game));
|
||||||
this.startingLoyalty = token.getStartingLoyalty();
|
this.startingLoyalty = token.getStartingLoyalty();
|
||||||
this.startingDefense = token.getStartingDefense();
|
this.startingDefense = token.getStartingDefense();
|
||||||
|
|
|
@ -568,8 +568,8 @@ public class Spell extends StackObjectImpl implements Card {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Set<SuperType> getSuperType() {
|
public List<SuperType> getSuperType(Game game) {
|
||||||
return card.getSuperType();
|
return card.getSuperType(game);
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<SpellAbility> getSpellAbilities() {
|
public List<SpellAbility> getSpellAbilities() {
|
||||||
|
|
|
@ -33,7 +33,10 @@ import mage.util.SubTypes;
|
||||||
import mage.util.functions.StackObjectCopyApplier;
|
import mage.util.functions.StackObjectCopyApplier;
|
||||||
import mage.watchers.Watcher;
|
import mage.watchers.Watcher;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author BetaSteward_at_googlemail.com
|
* @author BetaSteward_at_googlemail.com
|
||||||
|
@ -199,8 +202,8 @@ public class StackAbility extends StackObjectImpl implements Ability {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public EnumSet<SuperType> getSuperType() {
|
public List<SuperType> getSuperType(Game game) {
|
||||||
return EnumSet.noneOf(SuperType.class);
|
return Collections.emptyList();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -67,7 +67,7 @@ public class ManaPaidSourceWatcher extends Watcher {
|
||||||
if (sourceObject != null && sourceObject.isCreature(game)) {
|
if (sourceObject != null && sourceObject.isCreature(game)) {
|
||||||
creature++;
|
creature++;
|
||||||
}
|
}
|
||||||
if (sourceObject != null && !sourceObject.isSnow()) {
|
if (sourceObject != null && !sourceObject.isSnow(game)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
switch (manaType) {
|
switch (manaType) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue