* Started to fix color setting for cards (e.g. Painter's Serverant) #408 (not completely finished yet).

This commit is contained in:
LevelX2 2015-06-10 01:24:38 +02:00
parent 119422750c
commit c27ef5ee97
169 changed files with 515 additions and 395 deletions

View file

@ -237,7 +237,7 @@ public class CardView extends SimpleCardView {
this.cardTypes = card.getCardType();
this.subTypes = card.getSubtype();
this.superTypes = card.getSupertype();
this.color = card.getColor();
this.color = card.getColor(game);
this.canTransform = card.canTransform();
this.flipCard = card.isFlipCard();
this.faceDown = game != null ? card.isFaceDown(game) : false;
@ -313,7 +313,7 @@ public class CardView extends SimpleCardView {
this.cardTypes = object.getCardType();
this.subTypes = object.getSubtype();
this.superTypes = object.getSupertype();
this.color = object.getColor();
this.color = object.getColor(null);
this.manaCost = object.getManaCost().getSymbols();
this.convertedManaCost = object.getManaCost().convertedManaCost();
if (object instanceof PermanentToken) {
@ -421,7 +421,7 @@ public class CardView extends SimpleCardView {
this.cardTypes = token.getCardType();
this.subTypes = token.getSubtype();
this.superTypes = token.getSupertype();
this.color = token.getColor();
this.color = token.getColor(null);
this.manaCost = token.getManaCost().getSymbols();
this.rarity = Rarity.NA;
this.type = token.getTokenType();

View file

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

View file

@ -89,7 +89,7 @@ class GloryscaleViashinoAbility extends TriggeredAbilityImpl {
public boolean checkTrigger(GameEvent event, Game game) {
if (event.getType() == GameEvent.EventType.SPELL_CAST) {
Spell spell = game.getStack().getSpell(event.getTargetId());
if (spell != null && spell.getColor().isMulticolored() && event.getPlayerId().equals(getControllerId())) {
if (spell != null && spell.getColor(game).isMulticolored() && event.getPlayerId().equals(getControllerId())) {
return true;
}
}

View file

@ -102,7 +102,7 @@ class KnightOfNewAlaraEffect extends ContinuousEffectImpl {
public boolean apply(Game game, Ability source) {
for (Permanent creature : game.getBattlefield().getAllActivePermanents(filter, source.getControllerId(), game)) {
if (creature != null && !creature.getId().equals(source.getSourceId())) {
int colors = creature.getColor().getColorCount();
int colors = creature.getColor(game).getColorCount();
creature.addPower(colors);
creature.addToughness(colors);
}

View file

@ -51,12 +51,8 @@ public class FireIce extends SplitCard {
super(ownerId, 128, "Fire", "Ice", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{1}{R}", "{1}{U}", false);
this.expansionSetCode = "APC";
this.color.setBlue(true);
this.color.setRed(true);
// Fire
// Fire deals 2 damage divided as you choose among one or two target creatures and/or players.
getLeftHalfCard().getColor().setRed(true);
Effect effect = new DamageMultiEffect(2);
effect.setText("Fire deals 2 damage divided as you choose among one or two target creatures and/or players");
getLeftHalfCard().getSpellAbility().addEffect(effect);
@ -65,7 +61,6 @@ public class FireIce extends SplitCard {
// Ice
// Tap target permanent.
// Draw a card.
getRightHalfCard().getColor().setBlue(true);
getRightHalfCard().getSpellAbility().addEffect(new TapTargetEffect());
getRightHalfCard().getSpellAbility().addTarget(new TargetPermanent());
getRightHalfCard().getSpellAbility().addEffect(new DrawCardSourceControllerEffect(1));

View file

@ -49,19 +49,14 @@ public class IllusionReality extends SplitCard {
super(ownerId, 129, "Illusion", "Reality", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{U}", "{2}{G}", false);
this.expansionSetCode = "APC";
this.color.setBlue(true);
this.color.setGreen(true);
// Illusion
// Target spell or permanent becomes the color of your choice until end of turn.
getLeftHalfCard().getColor().setBlue(true);
getLeftHalfCard().getSpellAbility().addEffect(new BecomesColorTargetEffect(Duration.EndOfTurn));
Target target = new TargetSpellOrPermanent();
getLeftHalfCard().getSpellAbility().addTarget(target);
// Reality
// Destroy target artifact.
getRightHalfCard().getColor().setGreen(true);
getRightHalfCard().getSpellAbility().addTarget(new TargetArtifactPermanent());
getRightHalfCard().getSpellAbility().addEffect(new DestroyTargetEffect());
}

View file

@ -59,18 +59,13 @@ public class LifeDeath extends SplitCard {
super(ownerId, 130, "Life", "Death", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{G}", "{1}{B}", false);
this.expansionSetCode = "APC";
this.color.setGreen(true);
this.color.setBlack(true);
// Life
// All lands you control become 1/1 creatures until end of turn. They're still lands.
getLeftHalfCard().getColor().setGreen(true);
getLeftHalfCard().getSpellAbility().addEffect(new BecomesCreatureAllEffect(new LifeLandToken(), "lands",
new FilterControlledLandPermanent("lands you control"), Duration.EndOfTurn));
// Death
// Return target creature card from your graveyard to the battlefield. You lose life equal to its converted mana cost.
getRightHalfCard().getColor().setBlack(true);
Target target = new TargetCardInYourGraveyard(1, new FilterCreatureCard("creature card from your graveyard"));
getRightHalfCard().getSpellAbility().addTarget(target);
getRightHalfCard().getSpellAbility().addEffect(new DeathEffect());

View file

@ -59,18 +59,13 @@ public class NightDay extends SplitCard {
super(ownerId, 131, "Night", "Day", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{B}", "{2}{W}", false);
this.expansionSetCode = "APC";
this.color.setBlack(true);
this.color.setWhite(true);
// Night
// Target creature gets -1/-1 until end of turn.
getLeftHalfCard().getColor().setBlack(true);
getLeftHalfCard().getSpellAbility().addEffect(new BoostTargetEffect(-1,-1,Duration.EndOfTurn));
getLeftHalfCard().getSpellAbility().addTarget(new TargetCreaturePermanent());
// Day
// Creatures target player controls get +1/+1 until end of turn.
getRightHalfCard().getColor().setWhite(true);
getRightHalfCard().getSpellAbility().addTarget(new TargetPlayer());
getRightHalfCard().getSpellAbility().addEffect(new DayEffect());

View file

@ -51,19 +51,14 @@ public class OrderChaos extends SplitCard {
super(ownerId, 132, "Order", "Chaos", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{3}{W}", "{2}{R}", false);
this.expansionSetCode = "APC";
this.color.setWhite(true);
this.color.setRed(true);
// Order
// Exile target attacking creature.
getLeftHalfCard().getColor().setWhite(true);
getLeftHalfCard().getSpellAbility().addEffect(new ExileTargetEffect());
Target target = new TargetAttackingCreature();
getLeftHalfCard().getSpellAbility().addTarget(target);
// Chaos
// Creatures can't block this turn.
getRightHalfCard().getColor().setRed(true);
getRightHalfCard().getSpellAbility().addEffect(new CantBlockAllEffect(new FilterCreaturePermanent("Creatures"), Duration.EndOfTurn));
}

View file

@ -138,7 +138,7 @@ class DreadSlaverContiniousEffect extends ContinuousEffectImpl {
break;
case ColorChangingEffects_5:
if (sublayer == SubLayer.NA) {
creature.getColor().setBlack(true);
creature.getColor(game).setBlack(true);
}
break;
}

View file

@ -93,7 +93,7 @@ class EmptyShrineKannushiProtectionAbility extends ProtectionAbility {
public boolean canTarget(MageObject source, Game game) {
ObjectColor color = new ObjectColor();
for (Permanent permanent: game.getBattlefield().getAllActivePermanents(controllerId)) {
ObjectColor permanentColor = permanent.getColor();
ObjectColor permanentColor = permanent.getColor(game);
if (permanentColor.isColorless()) {
continue;
}

View file

@ -126,7 +126,7 @@ class TokTokVolcanoBornEffect extends ReplacementEffectImpl {
@Override
public boolean applies(GameEvent event, Ability source, Game game) {
Card card = game.getCard(event.getSourceId());
if (card != null && card.getColor().isRed()) {
if (card != null && card.getColor(game).isRed()) {
return true;
}
return false;

View file

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

View file

@ -55,20 +55,16 @@ public class RoughTumble extends SplitCard {
super(ownerId, 118, "Rough", "Tumble", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{1}{R}", "{5}{R}", false);
this.expansionSetCode = "C13";
this.color.setRed(true);
// Rough
// Rough deals 2 damage to each creature without flying.
Effect effect = new DamageAllEffect(2, filterWithoutFlying);
effect.setText("Rough deals 2 damage to each creature without flying");
getLeftHalfCard().getColor().setRed(true);
getLeftHalfCard().getSpellAbility().addEffect(effect);
// Tumble
// Tumble deals 6 damage to each creature with flying.
effect = new DamageAllEffect(6, filterFlying);
effect.setText("Tumble deals 6 damage to each creature with flying");
getRightHalfCard().getColor().setRed(true);
getRightHalfCard().getSpellAbility().addEffect(effect);
}

View file

@ -168,7 +168,7 @@ class NecromanticSelectionContinuousEffect extends ContinuousEffectImpl {
break;
case ColorChangingEffects_5:
if (sublayer == SubLayer.NA) {
creature.getColor().setBlack(true);
creature.getColor(game).setBlack(true);
}
break;
}

View file

@ -89,7 +89,7 @@ class FiligreeFractureEffect extends OneShotEffect {
Player player = game.getPlayer(source.getControllerId());
Permanent permanent = (Permanent) game.getLastKnownInformation(source.getFirstTarget(), Zone.BATTLEFIELD);
if (player != null && permanent != null
&& (permanent.getColor().isBlack() || permanent.getColor().isBlue())) {
&& (permanent.getColor(game).isBlack() || permanent.getColor(game).isBlue())) {
player.drawCards(1, game);
return true;
}

View file

@ -89,7 +89,7 @@ class KederektParasiteTriggeredAbility extends TriggeredAbilityImpl {
if (event.getType() == GameEvent.EventType.DREW_CARD && game.getOpponents(this.getControllerId()).contains(event.getPlayerId())) {
boolean youControlRedPermanent = false;
for (Permanent permanent : game.getBattlefield().getAllActivePermanents(this.getControllerId())) {
if (permanent.getColor().isRed()) {
if (permanent.getColor(game).isRed()) {
youControlRedPermanent = true;
break;
}

View file

@ -121,36 +121,36 @@ class EverythingIsColorlessEffect extends ContinuousEffectImpl {
ObjectColor colorless = new ObjectColor();
// permaments
for (Permanent perm : game.getBattlefield().getActivePermanents(source.getControllerId(), game)) {
perm.getColor().setColor(colorless);
perm.getColor(game).setColor(colorless);
}
// spells
for (MageObject object : game.getStack()) {
if (object instanceof Spell) {
object.getColor().setColor(colorless);
object.getColor(game).setColor(colorless);
}
}
// exile
for (Card card : game.getExile().getAllCards(game)) {
card.getColor().setColor(colorless);
game.getState().getCreateCardAttribute(card).getColor().setColor(colorless);
}
// command
for (CommandObject commandObject : game.getState().getCommand()) {
commandObject.getColor().setColor(colorless);
commandObject.getColor(game).setColor(colorless);
}
for (UUID playerId : controller.getInRange()) {
Player player = game.getPlayer(playerId);
if (player != null) {
// hand
for (Card card: player.getHand().getCards(game)) {
card.getColor().setColor(colorless);
game.getState().getCreateCardAttribute(card).getColor().setColor(colorless);
}
// library
for (Card card : player.getLibrary().getCards(game)) {
card.getColor().setColor(colorless);
game.getState().getCreateCardAttribute(card).getColor().setColor(colorless);
}
// graveyard
for (Card card : player.getGraveyard().getCards(game)) {
card.getColor().setColor(colorless);
game.getState().getCreateCardAttribute(card).getColor().setColor(colorless);
}
}
}

View file

@ -65,21 +65,13 @@ public class HideSeek extends SplitCard {
super(ownerId, 151, "Hide", "Seek", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{R}{W}", "{W}{B}", false);
this.expansionSetCode = "DIS";
this.color.setRed(true);
this.color.setWhite(true);
this.color.setBlack(true);
// Hide
// Put target artifact or enchantment on the bottom of its owner's library.
getLeftHalfCard().getColor().setRed(true);
getLeftHalfCard().getColor().setWhite(true);
getLeftHalfCard().getSpellAbility().addEffect(new PutOnLibraryTargetEffect(false));
getLeftHalfCard().getSpellAbility().addTarget(new TargetPermanent(filter));
// Seek
// Search target opponent's library for a card and exile it. You gain life equal to its converted mana cost. Then that player shuffles his or her library..
getRightHalfCard().getColor().setWhite(true);
getRightHalfCard().getColor().setBlack(true);
getRightHalfCard().getSpellAbility().addEffect(new SeekEffect());
getRightHalfCard().getSpellAbility().addTarget(new TargetOpponent());

View file

@ -65,21 +65,13 @@ public class OddsEnds extends SplitCard {
super(ownerId, 153, "Odds", "Ends", Rarity.RARE, new CardType[]{CardType.INSTANT}, "{U}{R}", "{3}{R}{W}", false);
this.expansionSetCode = "DIS";
this.color.setBlue(true);
this.color.setRed(true);
this.color.setWhite(true);
// Odds
// Flip a coin. If it comes up heads, counter target instant or sorcery spell. If it comes up tails, copy that spell and you may choose new targets for the copy.
getLeftHalfCard().getColor().setBlue(true);
getLeftHalfCard().getColor().setRed(true);
getLeftHalfCard().getSpellAbility().addEffect(new OddsEffect());
getLeftHalfCard().getSpellAbility().addTarget(new TargetSpell(filter));
// Ends
// Target player sacrifices two attacking creatures.
getRightHalfCard().getColor().setRed(true);
getRightHalfCard().getColor().setWhite(true);
getRightHalfCard().getSpellAbility().addEffect(new SacrificeEffect(new FilterAttackingCreature(), 2, "Target player"));
getRightHalfCard().getSpellAbility().addTarget(new TargetPlayer());

View file

@ -96,7 +96,7 @@ class MultiColoredSpellCastManaCondition extends ManaCondition implements Condit
public boolean apply(Game game, Ability source) {
if (source instanceof SpellAbility) {
MageObject object = game.getObject(source.getSourceId());
if (object != null && object.getColor().getColorCount() > 1) {
if (object != null && object.getColor(game).getColorCount() > 1) {
return true;
}
}

View file

@ -57,18 +57,10 @@ public class ResearchDevelopment extends SplitCard {
super(ownerId, 155, "Research", "Development", Rarity.RARE, new CardType[]{CardType.INSTANT}, "{G}{U}", "{3}{U}{R}", false);
this.expansionSetCode = "DIS";
this.color.setGreen(true);
this.color.setBlue(true);
this.color.setRed(true);
// Choose up to four cards you own from outside the game and shuffle them into your library.
getLeftHalfCard().getColor().setGreen(true);
getLeftHalfCard().getColor().setBlue(true);
getLeftHalfCard().getSpellAbility().addEffect(new ResearchEffect());
// Put a 3/1 red Elemental creature token onto the battlefield unless any opponent has you draw a card. Repeat this process two more times.
getRightHalfCard().getColor().setBlue(true);
getRightHalfCard().getColor().setRed(true);
getRightHalfCard().getSpellAbility().addEffect(new DevelopmentEffect());
}

View file

@ -56,20 +56,12 @@ public class SupplyDemand extends SplitCard {
super(ownerId, 157, "Supply", "Demand", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{1}{W}{U}", "{X}{G}{W}", false);
this.expansionSetCode = "DIS";
this.color.setGreen(true);
this.color.setWhite(true);
this.color.setBlue(true);
// Demand
// Search your library for a multicolored card, reveal it, and put it into your hand. Then shuffle your library.
getLeftHalfCard().getColor().setBlue(true);
getLeftHalfCard().getColor().setWhite(true);
getLeftHalfCard().getSpellAbility().addEffect(new SearchLibraryPutInHandEffect(new TargetCardInLibrary(1, filter), true));
// Supply
// Put X 1/1 green Saproling creature tokens onto the battlefield.
getRightHalfCard().getColor().setWhite(true);
getRightHalfCard().getColor().setGreen(true);
getRightHalfCard().getSpellAbility().addEffect(new CreateTokenEffect(new SaprolingToken(), new ManacostVariableValue()));
}

View file

@ -50,18 +50,13 @@ public class AliveWell extends SplitCard {
super(ownerId, 121, "Alive", "Well", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{3}{G}","{W}", true);
this.expansionSetCode = "DGM";
this.color.setGreen(true);
this.color.setWhite(true);
// Alive
// Put a 3/3 green Centaur creature token onto the battlefield.
getLeftHalfCard().getColor().setGreen(true);
getLeftHalfCard().getSpellAbility().addEffect(new CreateTokenEffect(new CentaurToken()));
// Well
// You gain 2 life for each creature you control.
getRightHalfCard().getColor().setWhite(true);
getRightHalfCard().getSpellAbility().addEffect(new WellEffect());
}

View file

@ -51,19 +51,14 @@ public class ArmedDangerous extends SplitCard {
super(ownerId, 122, "Armed", "Dangerous", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{1}{R}", "{3}{G}", true);
this.expansionSetCode = "DGM";
this.color.setRed(true);
this.color.setGreen(true);
// Armed
// Target creature gets +1/+1 and gains double strike until end of turn.
getLeftHalfCard().getColor().setRed(true);
getLeftHalfCard().getSpellAbility().addEffect(new BoostTargetEffect(1,1, Duration.EndOfTurn));
getLeftHalfCard().getSpellAbility().addEffect(new GainAbilityTargetEffect(DoubleStrikeAbility.getInstance(), Duration.EndOfTurn));
getLeftHalfCard().getSpellAbility().addTarget(new TargetCreaturePermanent());
// Dangerous
// All creatures able to block target creature this turn do so.
getRightHalfCard().getColor().setGreen(true);
getRightHalfCard().getSpellAbility().addEffect(new MustBeBlockedByAllTargetEffect(Duration.EndOfTurn));
getRightHalfCard().getSpellAbility().addTarget(new TargetCreaturePermanent());

View file

@ -55,20 +55,12 @@ public class BeckCall extends SplitCard {
super(ownerId, 123, "Beck", "Call", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{G}{U}", "{4}{W}{U}", true);
this.expansionSetCode = "DGM";
this.color.setWhite(true);
this.color.setBlue(true);
this.color.setGreen(true);
// Beck
// Whenever a creature enters the battlefield this turn, you may draw a card.
getLeftHalfCard().getColor().setGreen(true);
getLeftHalfCard().getColor().setBlue(true);
getLeftHalfCard().getSpellAbility().addEffect(new CreateDelayedTriggeredAbilityEffect(new BeckTriggeredAbility()));
// Call
// Put four 1/1 white Bird creature tokens with flying onto the battlefield.
getRightHalfCard().getColor().setWhite(true);
getRightHalfCard().getColor().setBlue(true);
getRightHalfCard().getSpellAbility().addEffect(new CreateTokenEffect(new BirdToken(),4));
}

View file

@ -49,18 +49,13 @@ public class DownDirty extends SplitCard {
super(ownerId, 126, "Down", "Dirty", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{3}{B}", "{2}{G}", true);
this.expansionSetCode = "DGM";
this.color.setBlack(true);
this.color.setGreen(true);
// Down
// Target player discards two cards.
getLeftHalfCard().getColor().setBlack(true);
getLeftHalfCard().getSpellAbility().addEffect(new DiscardTargetEffect(2));
getLeftHalfCard().getSpellAbility().addTarget(new TargetPlayer());
// Dirty
// Return target card from your graveyard to your hand.
getRightHalfCard().getColor().setGreen(true);
getRightHalfCard().getSpellAbility().addEffect(new ReturnFromGraveyardToHandTargetEffect());
getRightHalfCard().getSpellAbility().addTarget(new TargetCardInYourGraveyard());

View file

@ -50,18 +50,13 @@ public class FarAway extends SplitCard {
super(ownerId, 127, "Far", "Away", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{1}{U}", "{2}{B}", true);
this.expansionSetCode = "DGM";
this.color.setBlue(true);
this.color.setBlack(true);
// Far
// Return target creature to its owner's hand.
getLeftHalfCard().getColor().setBlue(true);
getLeftHalfCard().getSpellAbility().addEffect(new ReturnToHandTargetEffect());
getLeftHalfCard().getSpellAbility().addTarget(new TargetCreaturePermanent());
// Away
// Target player sacrifices a creature.
getRightHalfCard().getColor().setBlack(true);
getRightHalfCard().getSpellAbility().addEffect(new SacrificeEffect(new FilterCreaturePermanent(), 1, "Target player"));
getRightHalfCard().getSpellAbility().addTarget(new TargetPlayer());

View file

@ -60,14 +60,8 @@ public class FleshBlood extends SplitCard {
super(ownerId, 128, "Flesh", "Blood", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{3}{B}{G}", "{R}{G}",true);
this.expansionSetCode = "DGM";
this.color.setBlack(true);
this.color.setGreen(true);
this.color.setRed(true);
// Flesh
// Exile target creature card from a graveyard. Put X +1/+1 counters on target creature, where X is the power of the card you exiled.
getLeftHalfCard().getColor().setBlack(true);
getLeftHalfCard().getColor().setGreen(true);
Target target = new TargetCardInGraveyard(new FilterCreatureCard());
getLeftHalfCard().getSpellAbility().addTarget(target);
getLeftHalfCard().getSpellAbility().addTarget(new TargetCreaturePermanent());
@ -75,8 +69,6 @@ public class FleshBlood extends SplitCard {
// Blood
// Target creature you control deals damage equal to its power to target creature or player.
getRightHalfCard().getColor().setRed(true);
getRightHalfCard().getColor().setGreen(true);
getRightHalfCard().getSpellAbility().addTarget(new TargetControlledCreaturePermanent());
getRightHalfCard().getSpellAbility().addTarget(new TargetCreatureOrPlayer());
getRightHalfCard().getSpellAbility().addEffect(new BloodEffect());

View file

@ -52,20 +52,15 @@ public class GiveTake extends SplitCard {
super(ownerId, 129, "Give", "Take", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{2}{G}","{2}{U}", true);
this.expansionSetCode = "DGM";
this.color.setGreen(true);
this.color.setBlue(true);
// Give
// Put three +1/+1 counters on target creature.
getLeftHalfCard().getSpellAbility().addEffect(new AddCountersTargetEffect(CounterType.P1P1.createInstance(3)));
getLeftHalfCard().getSpellAbility().addTarget(new TargetCreaturePermanent());
getLeftHalfCard().getColor().setGreen(true);
// Take
// Remove all +1/+1 counters from target creature you control. Draw that many cards.
getRightHalfCard().getSpellAbility().addEffect(new TakeEffect());
getRightHalfCard().getSpellAbility().addTarget(new TargetControlledCreaturePermanent());
getLeftHalfCard().getColor().setBlue(true);
}
public GiveTake(final GiveTake card) {

View file

@ -57,17 +57,12 @@ public class ProfitLoss extends SplitCard {
super(ownerId, 130, "Profit", "Loss", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{1}{W}", "{2}{B}", true);
this.expansionSetCode = "DGM";
this.color.setWhite(true);
this.color.setBlack(true);
// Profit
// Creatures you control get +1/+1 until end of turn.
getLeftHalfCard().getColor().setBlue(true);
getLeftHalfCard().getSpellAbility().addEffect(new BoostControlledEffect(1,1, Duration.EndOfTurn, new FilterCreaturePermanent()));
// Loss
// Creatures your opponents control get -1/-1 until end of turn.
getRightHalfCard().getColor().setBlack(true);
getRightHalfCard().getSpellAbility().addEffect(new BoostAllEffect(-1, -1, Duration.EndOfTurn, filter, false));
}

View file

@ -48,18 +48,13 @@ public class ProtectServe extends SplitCard {
super(ownerId, 131, "Protect", "Serve", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{2}{W}", "{1}{U}", true);
this.expansionSetCode = "DGM";
this.color.setWhite(true);
this.color.setBlue(true);
// Protect
// Target creature gets +2/+4 until end of turn.
getLeftHalfCard().getColor().setWhite(true);
getLeftHalfCard().getSpellAbility().addEffect(new BoostTargetEffect(2,4, Duration.EndOfTurn));
getLeftHalfCard().getSpellAbility().addTarget(new TargetCreaturePermanent());
// Serve
// Target creature gets -6/-0 until end of turn.
getRightHalfCard().getColor().setBlue(true);
getRightHalfCard().getSpellAbility().addEffect(new BoostTargetEffect(-6,0, Duration.EndOfTurn));
getRightHalfCard().getSpellAbility().addTarget(new TargetCreaturePermanent());

View file

@ -53,14 +53,8 @@ public class ReadyWilling extends SplitCard {
super(ownerId, 132, "Ready", "Willing", Rarity.RARE, new CardType[]{CardType.INSTANT}, "{1}{G}{W}", "{1}{W}{B}", true);
this.expansionSetCode = "DGM";
this.color.setGreen(true);
this.color.setWhite(true);
this.color.setBlack(true);
// Ready
// Creatures you control are indestructible this turn. Untap each creature you control.
getLeftHalfCard().getColor().setGreen(true);
getLeftHalfCard().getColor().setWhite(true);
Effect effect = new GainAbilityAllEffect(IndestructibleAbility.getInstance(), Duration.EndOfTurn, new FilterControlledCreaturePermanent("Creatures you controll"), false);
effect.setText("Creatures you control are indestructible this turn");
getLeftHalfCard().getSpellAbility().addEffect(effect);
@ -68,8 +62,6 @@ public class ReadyWilling extends SplitCard {
// Willing
// Creatures you control gain deathtouch and lifelink until end of turn.
getRightHalfCard().getColor().setWhite(true);
getRightHalfCard().getColor().setBlack(true);
getRightHalfCard().getSpellAbility().addEffect(new GainAbilityControlledEffect(DeathtouchAbility.getInstance(), Duration.EndOfTurn, new FilterCreaturePermanent("Creatures")) );
effect = new GainAbilityControlledEffect(LifelinkAbility.getInstance(), Duration.EndOfTurn, new FilterCreaturePermanent("Creatures"));
effect.setText("Creatures you control gain lifelink until end of turn");

View file

@ -54,19 +54,14 @@ public class ToilTrouble extends SplitCard {
super(ownerId, 133, "Toil", "Trouble", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{2}{B}", "{2}{R}",true);
this.expansionSetCode = "DGM";
this.color.setBlack(true);
this.color.setRed(true);
// Toil
// Target player draws two cards and loses 2 life.
getLeftHalfCard().getColor().setBlack(true);
getLeftHalfCard().getSpellAbility().addTarget(new TargetPlayer());
getLeftHalfCard().getSpellAbility().addEffect(new DrawCardTargetEffect(2));
getLeftHalfCard().getSpellAbility().addEffect(new LoseLifeTargetEffect(2));
// Trouble
// Trouble deals damage to target player equal to the number of cards in that player's hand.
getRightHalfCard().getColor().setRed(true);
Effect effect = new DamageTargetEffect(new TargetPlayerCardsInHandCount());
effect.setText("Trouble deals damage to target player equal to the number of cards in that player's hand");
getRightHalfCard().getSpellAbility().addEffect(effect);

View file

@ -29,11 +29,9 @@ package mage.sets.dragonsmaze;
import java.util.UUID;
import mage.MageInt;
import mage.ObjectColor;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.DamageTargetEffect;
import mage.abilities.effects.common.continuous.BecomesCreatureTargetEffect;
import mage.abilities.effects.common.continuous.LoseAllAbilitiesTargetEffect;
import mage.cards.SplitCard;
import mage.constants.CardType;
import mage.constants.Duration;
@ -52,12 +50,8 @@ public class TurnBurn extends SplitCard {
super(ownerId, 134, "Turn", "Burn", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{2}{U}", "{1}{R}", true);
this.expansionSetCode = "DGM";
this.color.setBlue(true);
this.color.setRed(true);
// Turn
// Until end of turn, target creature loses all abilities and becomes a red Weird with base power and toughness 0/1.
getLeftHalfCard().getColor().setBlue(true);
Effect effect = new BecomesCreatureTargetEffect(new WeirdToken(), true, false, Duration.EndOfTurn);
effect.setText("Until end of turn, target creature loses all abilities and becomes a red Weird with base power and toughness 0/1");
getLeftHalfCard().getSpellAbility().addEffect(effect);
@ -65,7 +59,6 @@ public class TurnBurn extends SplitCard {
// Burn
// Burn deals 2 damage to target creature or player.
getRightHalfCard().getColor().setRed(true);
effect = new DamageTargetEffect(2);
effect.setText("Burn deals 2 damage to target creature or player");
getRightHalfCard().getSpellAbility().addEffect(effect);

View file

@ -47,19 +47,14 @@ public class WearTear extends SplitCard {
super(ownerId, 135, "Wear", "Tear", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{1}{R}", "{W}", true);
this.expansionSetCode = "DGM";
this.color.setRed(true);
this.color.setWhite(true);
// Wear
// Destroy target artifact.
getLeftHalfCard().getColor().setRed(true);
getLeftHalfCard().getSpellAbility().addEffect(new DestroyTargetEffect());
Target target = new TargetArtifactPermanent();
getLeftHalfCard().getSpellAbility().addTarget(target);
// Tear
// Destroy target enchantment.
getRightHalfCard().getColor().setWhite(true);
getRightHalfCard().getSpellAbility().addEffect(new DestroyTargetEffect());
target = new TargetPermanent(new FilterEnchantment());
getRightHalfCard().getSpellAbility().addTarget(target);

View file

@ -124,7 +124,7 @@ class DisplayOfDominanceEffect extends ContinuousRuleModifyingEffectImpl {
MageObject mageObject = game.getObject(event.getSourceId());
if (game.getPlayer(ability.getControllerId()).hasOpponent(event.getPlayerId(), game) &&
mageObject instanceof Spell &&
(mageObject.getColor().isBlack() || mageObject.getColor().isBlue())) {
(mageObject.getColor(game).isBlack() || mageObject.getColor(game).isBlue())) {
Permanent permanent = game.getPermanent(event.getTargetId());
return permanent != null && permanent.getControllerId().equals(ability.getControllerId());
}

View file

@ -106,19 +106,19 @@ class BloomTenderEffect extends ManaEffect {
if (controller != null) {
Mana mana = new Mana();
for (Permanent permanent : game.getBattlefield().getAllActivePermanents(controller.getId())) {
if (mana.getBlack() == 0 && permanent.getColor().isBlack()) {
if (mana.getBlack() == 0 && permanent.getColor(game).isBlack()) {
mana.addBlack();
}
if (mana.getBlue() == 0 && permanent.getColor().isBlue()) {
if (mana.getBlue() == 0 && permanent.getColor(game).isBlue()) {
mana.addBlue();
}
if (mana.getRed() == 0 && permanent.getColor().isRed()) {
if (mana.getRed() == 0 && permanent.getColor(game).isRed()) {
mana.addRed();
}
if (mana.getGreen() == 0 && permanent.getColor().isGreen()) {
if (mana.getGreen() == 0 && permanent.getColor(game).isGreen()) {
mana.addGreen();
}
if (mana.getWhite() == 0 && permanent.getColor().isWhite()) {
if (mana.getWhite() == 0 && permanent.getColor(game).isWhite()) {
mana.addWhite();
}
}

View file

@ -101,7 +101,7 @@ class BecomesBlueTargetEffect extends ContinuousEffectImpl {
public boolean apply(Game game, Ability source) {
Permanent permanent = game.getPermanent(source.getFirstTarget());
if (permanent != null) {
permanent.getColor().setBlue(true);
permanent.getColor(game).setBlue(true);
return true;
}
return false;

View file

@ -89,7 +89,7 @@ class HydroblastCounterEffect extends OneShotEffect {
@Override
public boolean apply(Game game, Ability source) {
if (game.getStack().getSpell(source.getFirstTarget()).getColor().isRed()) {
if (game.getStack().getSpell(source.getFirstTarget()).getColor(game).isRed()) {
game.getStack().counter(source.getFirstTarget(), source.getSourceId(), game);
}
return true;
@ -119,7 +119,7 @@ class HydroblastDestroyEffect extends OneShotEffect {
@Override
public boolean apply(Game game, Ability source) {
Permanent permanent = game.getPermanent(source.getTargets().getFirstTarget());
if (permanent != null && permanent.getColor().isRed()) {
if (permanent != null && permanent.getColor(game).isRed()) {
permanent.destroy(source.getSourceId(), game, false);
}
return true;

View file

@ -95,7 +95,7 @@ class JusticeTriggeredAbility extends TriggeredAbilityImpl {
|| event.getType() == GameEvent.EventType.DAMAGED_PLAYER
|| event.getType() == GameEvent.EventType.DAMAGED_PLANESWALKER) {
MageObject sourceObject = game.getObject(event.getSourceId());
if (sourceObject.getColor().isRed()) {
if (sourceObject.getColor(game).isRed()) {
if (sourceObject instanceof Permanent && sourceObject.getCardType().contains(CardType.CREATURE)
|| sourceObject instanceof Spell) {
this.getEffects().get(0).setValue("damageAmount", event.getAmount());

View file

@ -49,7 +49,7 @@ public class DryadArbor extends CardImpl {
this.power = new MageInt(1);
this.toughness = new MageInt(1);
this.getColor().setGreen(true);
this.color.setGreen(true);
// <i>(Dryad Arbor isn't a spell, it's affected by summoning sickness, and it has "{tap}: Add {G} to your mana pool.")</i>
this.addAbility(new GreenManaAbility());

View file

@ -82,7 +82,7 @@ class GlitteringWishEffect extends OneShotEffect {
@Override
public boolean apply(MageObject input, Game game) {
return input.getColor().isMulticolored();
return input.getColor(game).isMulticolored();
}
@Override

View file

@ -120,7 +120,7 @@ class LazavDimirEffect extends ContinuousEffectImpl {
}
permanent.getPower().setValue(cardToCopy.getPower().getValue());
permanent.getToughness().setValue(cardToCopy.getToughness().getValue());
permanent.getColor().setColor(cardToCopy.getColor());
permanent.getColor(game).setColor(cardToCopy.getColor(game));
permanent.getManaCost().clear();
permanent.getManaCost().add(cardToCopy.getManaCost());
permanent.getCardType().clear();

View file

@ -89,7 +89,7 @@ class PyroblastCounterTargetEffect extends OneShotEffect {
@Override
public boolean apply(Game game, Ability source) {
if(game.getStack().getSpell(source.getFirstTarget()).getColor().isBlue()){
if(game.getStack().getSpell(source.getFirstTarget()).getColor(game).isBlue()){
game.getStack().counter(source.getFirstTarget(), source.getSourceId(), game);
}
return true;
@ -122,7 +122,7 @@ class DestroyTargetEffect extends OneShotEffect {
@Override
public boolean apply(Game game, Ability source) {
Permanent permanent = game.getPermanent(source.getTargets().getFirstTarget());
if (permanent != null && permanent.getColor().isBlue()) {
if (permanent != null && permanent.getColor(game).isBlue()) {
permanent.destroy(source.getSourceId(), game, false);
}
return true;

View file

@ -137,7 +137,7 @@ class EssenceOfTheWildCopyEffect extends ContinuousEffectImpl {
Permanent permanent = game.getPermanent(targetId);
if (permanent != null) {
permanent.setName(essence.getName());
permanent.getColor().setColor(essence.getColor());
permanent.getColor(game).setColor(essence.getColor(game));
permanent.getManaCost().clear();
permanent.getManaCost().add(essence.getManaCost());
permanent.getCardType().clear();

View file

@ -146,7 +146,7 @@ class GrimoireOfTheDeadEffect2 extends ContinuousEffectImpl {
switch (layer) {
case ColorChangingEffects_5:
if (sublayer == SubLayer.NA) {
permanent.getColor().setBlack(true);
permanent.getColor(game).setBlack(true);
}
break;
case TypeChangingEffects_4:

View file

@ -50,12 +50,8 @@ public class AssaultBattery extends SplitCard {
super(ownerId, 295, "Assault", "Battery", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{R}", "{3}{G}", false);
this.expansionSetCode = "INV";
this.color.setRed(true);
this.color.setGreen(true);
// Assault
// Assault deals 2 damage to target creature or player.
getLeftHalfCard().getColor().setRed(true);
Effect effect = new DamageTargetEffect(2);
effect.setText("Assault deals 2 damage to target creature or player");
getLeftHalfCard().getSpellAbility().addEffect(effect);
@ -63,7 +59,6 @@ public class AssaultBattery extends SplitCard {
// Battery
// Put a 3/3 green Elephant creature token onto the battlefield.
getRightHalfCard().getColor().setGreen(true);
getRightHalfCard().getSpellAbility().addEffect(new CreateTokenEffect(new ElephantToken()));
}

View file

@ -138,7 +138,7 @@ class HallOfTriumphBoostControlledEffect extends ContinuousEffectImpl {
ObjectColor color = (ObjectColor) game.getState().getValue(source.getSourceId() + "_color");
if (color != null) {
for (Permanent perm: game.getBattlefield().getAllActivePermanents(filter, source.getControllerId(), game)) {
if (perm.getColor().shares(color)) {
if (perm.getColor(game).shares(color)) {
perm.addPower(1);
perm.addToughness(1);
}

View file

@ -67,7 +67,7 @@ public class GhostfireBlade extends CardImpl {
public void adjustCosts(Ability ability, Game game) {
if (ability instanceof EquipAbility) {
Permanent targetCreature = game.getPermanent(ability.getTargets().getFirstTarget());
if (targetCreature != null && targetCreature.getColor().isColorless()) {
if (targetCreature != null && targetCreature.getColor(game).isColorless()) {
CardUtil.reduceCost(ability, 2);
}
}

View file

@ -135,7 +135,7 @@ class SarkhanTheDragonspeakerEffect extends ContinuousEffectImpl {
}
break;
case ColorChangingEffects_5:
permanent.getColor().setColor(ObjectColor.RED);
permanent.getColor(game).setColor(ObjectColor.RED);
break;
case AbilityAddingRemovingEffects_6:
if (sublayer == SubLayer.NA) {

View file

@ -95,7 +95,7 @@ class AbominationTriggeredAbility extends TriggeredAbilityImpl {
Permanent blocked = game.getPermanent(event.getTargetId());
Permanent abomination = game.getPermanent(sourceId);
if (blocker != null && blocker != abomination
&& blocker.getColor().isWhite()
&& blocker.getColor(game).isWhite()
&& blocked == abomination) {
for (Effect effect : this.getEffects()) {
effect.setTargetPointer(new FixedTarget(event.getSourceId()));
@ -103,14 +103,14 @@ class AbominationTriggeredAbility extends TriggeredAbilityImpl {
}
}
if (blocker != null && blocker == abomination
&& game.getPermanent(event.getTargetId()).getColor().isWhite()) {
&& game.getPermanent(event.getTargetId()).getColor(game).isWhite()) {
for (Effect effect : this.getEffects()) {
effect.setTargetPointer(new FixedTarget(event.getTargetId()));
return true;
}
}
if (blocker != null && blocker != abomination
&& blocker.getColor().isGreen()
&& blocker.getColor(game).isGreen()
&& blocked == abomination) {
for (Effect effect : this.getEffects()) {
effect.setTargetPointer(new FixedTarget(event.getSourceId()));
@ -118,7 +118,7 @@ class AbominationTriggeredAbility extends TriggeredAbilityImpl {
}
}
if (blocker != null && blocker == abomination
&& game.getPermanent(event.getTargetId()).getColor().isGreen()) {
&& game.getPermanent(event.getTargetId()).getColor(game).isGreen()) {
for (Effect effect : this.getEffects()) {
effect.setTargetPointer(new FixedTarget(event.getTargetId()));
return true;

View file

@ -86,7 +86,7 @@ class CrystalRodAbility extends TriggeredAbilityImpl {
public boolean checkTrigger(GameEvent event, Game game) {
if (event.getType() == GameEvent.EventType.SPELL_CAST) {
Spell spell = game.getStack().getSpell(event.getTargetId());
if (spell != null && spell.getColor().contains(ObjectColor.BLUE)) {
if (spell != null && spell.getColor(game).contains(ObjectColor.BLUE)) {
return true;
}
}

View file

@ -86,7 +86,7 @@ class IronStarAbility extends TriggeredAbilityImpl {
public boolean checkTrigger(GameEvent event, Game game) {
if (event.getType() == GameEvent.EventType.SPELL_CAST) {
Spell spell = game.getStack().getSpell(event.getTargetId());
if (spell != null && spell.getColor().contains(ObjectColor.RED)) {
if (spell != null && spell.getColor(game).contains(ObjectColor.RED)) {
return true;
}
}

View file

@ -85,7 +85,7 @@ class IvoryCupAbility extends TriggeredAbilityImpl {
public boolean checkTrigger(GameEvent event, Game game) {
if (event.getType() == GameEvent.EventType.SPELL_CAST) {
Spell spell = game.getStack().getSpell(event.getTargetId());
if (spell != null && spell.getColor().contains(ObjectColor.WHITE)) {
if (spell != null && spell.getColor(game).contains(ObjectColor.WHITE)) {
return true;
}
}

View file

@ -86,7 +86,7 @@ class ThroneOfBoneAbility extends TriggeredAbilityImpl {
public boolean checkTrigger(GameEvent event, Game game) {
if (event.getType() == GameEvent.EventType.SPELL_CAST) {
Spell spell = game.getStack().getSpell(event.getTargetId());
if (spell != null && spell.getColor().contains(ObjectColor.BLACK)) {
if (spell != null && spell.getColor(game).contains(ObjectColor.BLACK)) {
return true;
}
}

View file

@ -86,7 +86,7 @@ class WoodenSphereAbility extends TriggeredAbilityImpl {
public boolean checkTrigger(GameEvent event, Game game) {
if (event.getType() == GameEvent.EventType.SPELL_CAST) {
Spell spell = game.getStack().getSpell(event.getTargetId());
if (spell != null && spell.getColor().contains(ObjectColor.GREEN)) {
if (spell != null && spell.getColor(game).contains(ObjectColor.GREEN)) {
return true;
}
}

View file

@ -93,7 +93,7 @@ class ForkEffect extends OneShotEffect {
Spell spell = game.getStack().getSpell(targetPointer.getFirst(game, source));
if (spell != null) {
Spell copy = spell.copySpell();
copy.getColor().setRed(true);
copy.getColor(game).setRed(true);
copy.setControllerId(controller.getId());
copy.setCopiedSpell(true);
game.getStack().push(copy);

View file

@ -114,7 +114,7 @@ class DreadWarlockEffect extends RestrictionEffect {
@Override
public boolean canBeBlocked(Permanent attacker, Permanent blocker, Ability source, Game game) {
if (blocker.getColor().isBlack()) {
if (blocker.getColor(game).isBlack()) {
return true;
}
return false;

View file

@ -98,7 +98,7 @@ class RiseFromTheGraveEffect extends ContinuousEffectImpl {
break;
case ColorChangingEffects_5:
if (sublayer == SubLayer.NA) {
creature.getColor().setBlack(true);
creature.getColor(game).setBlack(true);
}
break;
}

View file

@ -126,7 +126,7 @@ class VampireNocturnusCondition implements Condition {
if (player != null) {
Card card = player.getLibrary().getFromTop(game);
if (card != null) {
return card.getColor().isBlack();
return card.getColor(game).isBlack();
}
}
return false;

View file

@ -100,7 +100,7 @@ class FireServantEffect extends ReplacementEffectImpl {
StackObject spell = game.getStack().getStackObject(event.getSourceId());
return spell != null &&
spell.getControllerId().equals(source.getControllerId()) &&
spell.getColor().isRed() &&
spell.getColor(game).isRed() &&
(spell.getCardType().contains(CardType.INSTANT) || spell.getCardType().contains(CardType.SORCERY));
}

View file

@ -91,7 +91,7 @@ class ChandrasPhoenixTriggeredAbility extends TriggeredAbilityImpl {
if (game.getOpponents(this.controllerId).contains(event.getPlayerId())) {
Card c = game.getCard(event.getSourceId());
if (c != null) {
if (c.getColor().isRed() && (c.getCardType().contains(CardType.PLANESWALKER) || c.getCardType().contains(CardType.INSTANT) || c.getCardType().contains(CardType.SORCERY))) {
if (c.getColor(game).isRed() && (c.getCardType().contains(CardType.PLANESWALKER) || c.getCardType().contains(CardType.INSTANT) || c.getCardType().contains(CardType.SORCERY))) {
return true;
}
}

View file

@ -123,8 +123,8 @@ class FiendslayerPaladinEffect extends ContinuousRuleModifyingEffectImpl {
Card targetCard = game.getCard(event.getTargetId());
StackObject stackObject = (StackObject) game.getStack().getStackObject(event.getSourceId());
if (targetCard != null && stackObject != null && targetCard.getId().equals(source.getSourceId())) {
if (stackObject.getColor().contains(ObjectColor.BLACK)
|| stackObject.getColor().contains(ObjectColor.RED)) {
if (stackObject.getColor(game).contains(ObjectColor.BLACK)
|| stackObject.getColor(game).contains(ObjectColor.RED)) {
if (!stackObject.getControllerId().equals(source.getControllerId())
&& stackObject.getCardType().contains(CardType.INSTANT)
|| stackObject.getCardType().contains(CardType.SORCERY)) {

View file

@ -127,7 +127,7 @@ class AvacynGuardianAngelPreventToCreatureEffect extends PreventionEffectImpl {
&& event.getTargetId().equals(getTargetPointer().getFirst(game, source))) {
ChoiceColor choice = (ChoiceColor) source.getChoices().get(0);
MageObject sourceObject = game.getObject(event.getSourceId());
if (sourceObject != null && choice != null && sourceObject.getColor().shares(choice.getColor())) {
if (sourceObject != null && choice != null && sourceObject.getColor(game).shares(choice.getColor())) {
return true;
}
}
@ -166,7 +166,7 @@ class AvacynGuardianAngelPreventToPlayerEffect extends PreventionEffectImpl {
&& event.getTargetId().equals(getTargetPointer().getFirst(game, source))) {
ChoiceColor choice = (ChoiceColor) source.getChoices().get(0);
MageObject sourceObject = game.getObject(event.getSourceId());
if (sourceObject != null && choice != null && sourceObject.getColor().shares(choice.getColor())) {
if (sourceObject != null && choice != null && sourceObject.getColor(game).shares(choice.getColor())) {
return true;
}
}

View file

@ -115,12 +115,12 @@ class PolymorphistsJestEffect extends ContinuousEffectImpl {
break;
case ColorChangingEffects_5:
if (sublayer == SubLayer.NA) {
permanent.getColor().setBlack(false);
permanent.getColor().setGreen(false);
permanent.getColor().setBlue(false);
permanent.getColor().setWhite(false);
permanent.getColor().setBlack(false);
permanent.getColor().setColor(ObjectColor.BLUE);
permanent.getColor(game).setBlack(false);
permanent.getColor(game).setGreen(false);
permanent.getColor(game).setBlue(false);
permanent.getColor(game).setWhite(false);
permanent.getColor(game).setBlack(false);
permanent.getColor(game).setColor(ObjectColor.BLUE);
}
break;
case AbilityAddingRemovingEffects_6:

View file

@ -103,19 +103,19 @@ class SoulOfRavnicaEffect extends OneShotEffect {
if (controller != null) {
HashSet<ObjectColor> colors = new HashSet<>();
for (Permanent permanent : game.getBattlefield().getAllActivePermanents(controller.getId())) {
if (permanent.getColor().isBlack()) {
if (permanent.getColor(game).isBlack()) {
colors.add(ObjectColor.BLACK);
}
if (permanent.getColor().isBlue()) {
if (permanent.getColor(game).isBlue()) {
colors.add(ObjectColor.BLUE);
}
if (permanent.getColor().isRed()) {
if (permanent.getColor(game).isRed()) {
colors.add(ObjectColor.RED);
}
if (permanent.getColor().isGreen()) {
if (permanent.getColor(game).isGreen()) {
colors.add(ObjectColor.GREEN);
}
if (permanent.getColor().isWhite()) {
if (permanent.getColor(game).isWhite()) {
colors.add(ObjectColor.WHITE);
}
}

View file

@ -151,7 +151,7 @@ class ChromeMoxManaEffect extends ManaEffect {
if (imprintedCard != null) {
Choice choice = new ChoiceImpl(true);
choice.setMessage("Pick a mana color");
ObjectColor color = imprintedCard.getColor();
ObjectColor color = imprintedCard.getColor(game);
if (color.isBlack()) {
choice.getChoices().add("Black");
}

View file

@ -111,7 +111,7 @@ class KarplusanStriderEffect extends ContinuousRuleModifyingEffectImpl {
Permanent targettedPermanent = game.getPermanent(event.getTargetId());
Spell sourceSpell = game.getStack().getSpell(event.getSourceId());
if (targettedPermanent != null && sourceSpell != null) {
return sourceSpell.getColor().isBlue() || sourceSpell.getColor().isBlack();
return sourceSpell.getColor(game).isBlue() || sourceSpell.getColor(game).isBlack();
}
}
return false;

View file

@ -111,7 +111,7 @@ class CagedSunEffect2 extends ContinuousEffectImpl {
ObjectColor color = (ObjectColor) game.getState().getValue(permanent.getId() + "_color");
if (color != null) {
for (Permanent perm: game.getBattlefield().getAllActivePermanents(filter, source.getControllerId(), game)) {
if (perm.getColor().contains(color)) {
if (perm.getColor(game).contains(color)) {
perm.addPower(1);
perm.addToughness(1);
}

View file

@ -87,7 +87,7 @@ class DeathgazerTriggeredAbility extends TriggeredAbilityImpl {
if (event.getType() == GameEvent.EventType.BLOCKER_DECLARED) {
if (event.getSourceId().equals(this.getSourceId())) {
Permanent permanent = game.getPermanent(event.getTargetId());
if(permanent != null && !permanent.getColor().isBlack())
if(permanent != null && !permanent.getColor(game).isBlack())
{
for (Effect effect : this.getEffects()) {
effect.setTargetPointer(new FixedTarget(event.getTargetId()));
@ -97,7 +97,7 @@ class DeathgazerTriggeredAbility extends TriggeredAbilityImpl {
}
if (event.getTargetId().equals(this.getSourceId())) {
Permanent permanent = game.getPermanent(event.getSourceId());
if(permanent != null && !permanent.getColor().isBlack())
if(permanent != null && !permanent.getColor(game).isBlack())
{
for (Effect effect : this.getEffects()) {
effect.setTargetPointer(new FixedTarget(event.getSourceId()));

View file

@ -97,9 +97,9 @@ class EarnestFellowshipEffect extends ContinuousEffectImpl {
@Override
public boolean apply(Game game, Ability source) {
for (Permanent permanent : game.getBattlefield().getActivePermanents(filter, source.getControllerId(), game)) {
if (permanent.getColor().hasColor()) {
if (permanent.getColor(game).hasColor()) {
List<ColorPredicate> colorPredicates = new ArrayList<>();
for (ObjectColor color : permanent.getColor().getColors()) {
for (ObjectColor color : permanent.getColor(game).getColors()) {
colorPredicates.add(new ColorPredicate(color));
}
FilterCard filterColors = new FilterCard("its colors");

View file

@ -127,8 +127,8 @@ class TestamentOfFaithBecomesCreatureSourceEffect extends ContinuousEffectImpl i
break;
case ColorChangingEffects_5:
if (sublayer == SubLayer.NA) {
if (token.getColor().hasColor()) {
permanent.getColor().setColor(token.getColor());
if (token.getColor(game).hasColor()) {
permanent.getColor(game).setColor(token.getColor(game));
}
}
break;

View file

@ -60,11 +60,8 @@ public class BoomBust extends SplitCard {
super(ownerId, 112, "Boom", "Bust", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{1}{R}", "{5}{R}", false);
this.expansionSetCode = "PLC";
this.color.setRed(true);
// Boom
// Destroy target land you control and target land you don't control.
getLeftHalfCard().getColor().setRed(true);
Effect effect = new DestroyTargetEffect();
effect.setText("Destroy target land you control and target land you don't control");
getLeftHalfCard().getSpellAbility().addEffect(effect);
@ -73,7 +70,6 @@ public class BoomBust extends SplitCard {
// Bust
// Destroy all lands.
getRightHalfCard().getColor().setRed(true);
getRightHalfCard().getSpellAbility().addEffect(new DestroyAllEffect(new FilterLandPermanent()));
}

View file

@ -1,6 +1,5 @@
package mage.sets.planarchaos;
import mage.abilities.Mode;
import mage.abilities.effects.common.DamageTargetEffect;
import mage.abilities.effects.common.ReturnToHandTargetEffect;
import mage.cards.Card;
@ -27,17 +26,14 @@ public class DeadGone extends SplitCard {
public DeadGone(UUID ownerId) {
super(ownerId, 113, "Dead", "Gone", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{R}", "{2}{R}", false);
this.expansionSetCode = "PLC";
this.color.setRed(true);
// Dead
// Dead deals 2 damage to target creature.
getLeftHalfCard().getColor().setRed(true);
getLeftHalfCard().getSpellAbility().addEffect(new DeadDamageEffect());
getLeftHalfCard().getSpellAbility().addTarget(new TargetCreaturePermanent());
// Gone
// Return target creature you don't control to its owner's hand.
getRightHalfCard().getColor().setRed(true);
getRightHalfCard().getSpellAbility().addEffect(new ReturnToHandTargetEffect());
getRightHalfCard().getSpellAbility().addTarget(new TargetCreaturePermanent(filter));
}

View file

@ -116,7 +116,7 @@ class LifeAndLimbEffect extends ContinuousEffectImpl {
}
break;
case ColorChangingEffects_5:
permanent.getColor().setColor(ObjectColor.GREEN);
permanent.getColor(game).setColor(ObjectColor.GREEN);
break;
case AbilityAddingRemovingEffects_6:
boolean flag = false;

View file

@ -178,7 +178,7 @@ class MeteorCraterEffect extends ManaEffect {
List<Permanent> controlledPermanents = game.getBattlefield().getActivePermanents(filter, source.getControllerId(), game);
Mana types = new Mana();
for (Permanent permanent : controlledPermanents) {
ObjectColor color = permanent.getColor();
ObjectColor color = permanent.getColor(game);
if (color.isBlack()) {
types.add(Mana.BlackMana);
}

View file

@ -28,7 +28,6 @@
package mage.sets.planeshift;
import java.util.UUID;
import mage.MageObject;
import mage.ObjectColor;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
@ -113,7 +112,7 @@ class ShiftingSkyEffect extends OneShotEffect {
Player p = game.getPlayer(playerId);
if (p != null) {
for (Permanent chosen : game.getBattlefield().getAllActivePermanents(filter, playerId, game)) {
setObject(chosen, colorString);
setObject(chosen, colorString, game);
}
}
}
@ -127,22 +126,22 @@ class ShiftingSkyEffect extends OneShotEffect {
return new ShiftingSkyEffect(this);
}
private void setObject(Permanent chosen, String colorString) {
private void setObject(Permanent chosen, String colorString, Game game) {
switch (colorString) {
case "W":
chosen.getColor().setWhite(true);
chosen.getColor(game).setWhite(true);
break;
case "B":
chosen.getColor().setBlack(true);
chosen.getColor(game).setBlack(true);
break;
case "U":
chosen.getColor().setBlue(true);
chosen.getColor(game).setBlue(true);
break;
case "G":
chosen.getColor().setGreen(true);
chosen.getColor(game).setGreen(true);
break;
case "R":
chosen.getColor().setRed(true);
chosen.getColor(game).setRed(true);
break;
}
}

View file

@ -104,7 +104,7 @@ class CrownOfConvergenceColorBoostEffect extends BoostAllEffect {
Card topCard = you.getLibrary().getFromTop(game);
if (topCard != null) {
for (Permanent permanent: game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source.getSourceId(), game)) {
if (permanent.getColor().shares(topCard.getColor()) && !permanent.getColor().isColorless()) {
if (permanent.getColor(game).shares(topCard.getColor(game)) && !permanent.getColor(game).isColorless()) {
permanent.addPower(power.calculate(game, source, this));
permanent.addToughness(toughness.calculate(game, source, this));
}

View file

@ -107,7 +107,7 @@ class DimirDoppelgangerEffect extends ContinuousEffectImpl {
permanent.setName(cardToCopy.getName());
permanent.getPower().setValue(cardToCopy.getPower().getValue());
permanent.getToughness().setValue(cardToCopy.getToughness().getValue());
permanent.getColor().setColor(cardToCopy.getColor());
permanent.getColor(game).setColor(cardToCopy.getColor(game));
permanent.getManaCost().clear();
permanent.getManaCost().add(cardToCopy.getManaCost());
permanent.getCardType().clear();

View file

@ -92,10 +92,10 @@ class LeaveNoTraceEffect extends OneShotEffect {
public boolean apply(Game game, Ability source) {
Permanent target = game.getPermanent(targetPointer.getFirst(game, source));
if (target != null) {
ObjectColor color = target.getColor();
ObjectColor color = target.getColor(game);
target.destroy(source.getSourceId(), game, false);
for (Permanent p : game.getBattlefield().getActivePermanents(filter, source.getControllerId(), game)) {
if (p.getColor().shares(color)) {
if (p.getColor(game).shares(color)) {
p.destroy(source.getSourceId(), game, false);
}
}

View file

@ -93,10 +93,10 @@ class RallyTheRighteousUntapEffect extends OneShotEffect {
public boolean apply(Game game, Ability source) {
Permanent target = game.getPermanent(getTargetPointer().getFirst(game, source));
if (target != null) {
ObjectColor color = target.getColor();
ObjectColor color = target.getColor(game);
target.untap(game);
for (Permanent permanent : game.getBattlefield().getActivePermanents(new FilterCreaturePermanent(), source.getControllerId(), source.getSourceId(), game)) {
if (permanent.getColor().shares(color) && !permanent.getId().equals(target.getId())) {
if (permanent.getColor(game).shares(color) && !permanent.getId().equals(target.getId())) {
permanent.untap(game);
}
}
@ -124,10 +124,10 @@ class RallyTheRighteousBoostEffect extends ContinuousEffectImpl {
Permanent target = game.getPermanent(getTargetPointer().getFirst(game, source));
if (target != null) {
affectedObjectList.add(new MageObjectReference(target, game));
ObjectColor color = target.getColor();
ObjectColor color = target.getColor(game);
target.addPower(2);
for (Permanent permanent : game.getBattlefield().getActivePermanents(new FilterCreaturePermanent(), source.getControllerId(), source.getSourceId(), game)) {
if (!permanent.getId().equals(target.getId()) && permanent.getColor().shares(color)) {
if (!permanent.getId().equals(target.getId()) && permanent.getColor(game).shares(color)) {
affectedObjectList.add(new MageObjectReference(permanent, game));
}
}

View file

@ -84,7 +84,7 @@ class CivicSaberColorCount implements DynamicValue {
if (equipment != null) {
Permanent permanent = game.getPermanent(equipment.getAttachedTo());
if (permanent != null) {
count = permanent.getColor().getColorCount();
count = permanent.getColor(game).getColorCount();
}
}
return count;

View file

@ -195,7 +195,7 @@ class GraveBetrayalContiniousEffect extends ContinuousEffectImpl {
break;
case ColorChangingEffects_5:
if (sublayer == SubLayer.NA) {
creature.getColor().setBlack(true);
creature.getColor(game).setBlack(true);
}
break;
}

View file

@ -97,7 +97,7 @@ class LobberCrewTriggeredAbility extends TriggeredAbilityImpl {
public boolean checkTrigger(GameEvent event, Game game) {
if (event.getType() == GameEvent.EventType.SPELL_CAST) {
Spell spell = game.getStack().getSpell(event.getTargetId());
if (spell != null && spell.getColor().isMulticolored() && event.getPlayerId().equals(getControllerId())) {
if (spell != null && spell.getColor(game).isMulticolored() && event.getPlayerId().equals(getControllerId())) {
return true;
}
}

View file

@ -85,7 +85,7 @@ class PyroconvergenceTriggeredAbility extends TriggeredAbilityImpl {
public boolean checkTrigger(GameEvent event, Game game) {
if (event.getType() == GameEvent.EventType.SPELL_CAST) {
Spell spell = game.getStack().getSpell(event.getTargetId());
if (spell != null && spell.getColor().isMulticolored() && event.getPlayerId().equals(getControllerId())) {
if (spell != null && spell.getColor(game).isMulticolored() && event.getPlayerId().equals(getControllerId())) {
return true;
}
}

View file

@ -138,10 +138,10 @@ class TabletOfTheGuildsGainLifeEffect extends OneShotEffect {
ObjectColor color1 = new ObjectColor((String) game.getState().getValue(source.getSourceId() + "_color1"));
ObjectColor color2 = new ObjectColor((String) game.getState().getValue(source.getSourceId() + "_color2"));
int amount = 0;
if (spell.getColor().contains(color1)) {
if (spell.getColor(game).contains(color1)) {
++amount;
}
if (spell.getColor().contains(color2)) {
if (spell.getColor(game).contains(color2)) {
++amount;
}
if (amount > 0) {

View file

@ -76,7 +76,7 @@ class AllIsDustEffect extends OneShotEffect {
public boolean apply(Game game, Ability source) {
List<Permanent> permanents = game.getBattlefield().getActivePermanents(source.getControllerId(), game);
for (Permanent p : permanents) {
if (!p.getColor().isColorless()) {
if (!p.getColor(game).isColorless()) {
p.sacrifice(source.getSourceId(), game);
}
}

View file

@ -131,7 +131,7 @@ class CurseOfWizardryPlayerCastsSpellChosenColorTriggeredAbility extends Trigger
if (chosenColor != null) {
if (event.getType() == GameEvent.EventType.SPELL_CAST) {
Spell spell = game.getStack().getSpell(event.getTargetId());
if (spell != null && spell.getColor().shares(chosenColor)) {
if (spell != null && spell.getColor(game).shares(chosenColor)) {
this.getEffects().get(0).setTargetPointer(new FixedTarget(event.getPlayerId()));
return true;
}

View file

@ -96,6 +96,6 @@ class EldraziTempleCondition implements Condition {
@Override
public boolean apply(Game game, Ability source) {
MageObject object = game.getObject(source.getSourceId());
return object != null && object.hasSubtype("Eldrazi") && object.getColor().isColorless();
return object != null && object.hasSubtype("Eldrazi") && object.getColor(game).isColorless();
}
}

View file

@ -133,7 +133,7 @@ class ZulaportEnforcerEffect extends RestrictionEffect {
@Override
public boolean canBeBlocked(Permanent attacker, Permanent blocker, Ability source, Game game) {
if (blocker.getColor().isBlack()) {
if (blocker.getColor(game).isBlack()) {
return true;
}
return false;

View file

@ -125,11 +125,11 @@ class GrandArchitectEffect extends ContinuousEffectImpl {
public boolean apply(Game game, Ability source) {
Permanent permanent = game.getPermanent(source.getFirstTarget());
if (permanent != null) {
permanent.getColor().setRed(false);
permanent.getColor().setWhite(false);
permanent.getColor().setGreen(false);
permanent.getColor().setBlue(true);
permanent.getColor().setBlack(false);
permanent.getColor(game).setRed(false);
permanent.getColor(game).setWhite(false);
permanent.getColor(game).setGreen(false);
permanent.getColor(game).setBlue(true);
permanent.getColor(game).setBlack(false);
return true;
}
return false;

View file

@ -145,7 +145,7 @@ class LiegeOfTheTangleEffect extends ContinuousEffectImpl {
break;
case ColorChangingEffects_5:
if (sublayer == SubLayer.NA) {
perm.getColor().setColor(token.getColor());
perm.getColor(game).setColor(token.getColor(game));
}
break;
case PTChangingEffects_7:

View file

@ -93,7 +93,7 @@ public class QuicksilverGargantuan extends CardImpl {
Card card = game.getCard(source.getFirstTarget());
Permanent permanent = game.getPermanent(source.getSourceId());
permanent.setName(card.getName());
permanent.getColor().setColor(card.getColor());
permanent.getColor(game).setColor(card.getColor(game));
permanent.getManaCost().clear();
permanent.getManaCost().add(card.getManaCost());
permanent.getCardType().clear();

View file

@ -83,7 +83,7 @@ class DarkestHourEffect extends ContinuousEffectImpl {
@Override
public boolean apply(Game game, Ability source) {
for (Permanent permanent : game.getBattlefield().getActivePermanents(new FilterCreaturePermanent(), source.getControllerId(), source.getSourceId(), game)) {
permanent.getColor().setColor(ObjectColor.BLACK);
permanent.getColor(game).setColor(ObjectColor.BLACK);
}
return true;
}

View file

@ -90,8 +90,8 @@ class ConsignToDreamEffect extends OneShotEffect {
public boolean apply(Game game, Ability source) {
Permanent target = game.getPermanent(source.getFirstTarget());
if (target != null) {
if (target.getColor().contains(ObjectColor.RED)
|| target.getColor().contains(ObjectColor.GREEN)) {
if (target.getColor(game).contains(ObjectColor.RED)
|| target.getColor(game).contains(ObjectColor.GREEN)) {
applied = target.moveToZone(Zone.LIBRARY, source.getSourceId(), game, true);
} else {
applied = target.moveToZone(Zone.HAND, source.getSourceId(), game, false);

View file

@ -90,8 +90,8 @@ class GloomlanceEffect extends OneShotEffect {
Player targetController = game.getPlayer(targetCreature.getControllerId());
targetCreature.destroy(source.getSourceId(), game, false);
Permanent destroyedCreature = game.getPermanentOrLKIBattlefield(source.getFirstTarget());
if (destroyedCreature.getColor().isGreen()
|| destroyedCreature.getColor().isWhite()) {
if (destroyedCreature.getColor(game).isGreen()
|| destroyedCreature.getColor(game).isWhite()) {
targetController.discard(1, false, source, game);
return true;
}

View file

@ -101,8 +101,8 @@ class GloomwidowsFeastEffect extends OneShotEffect {
if (targetCreature != null) {
targetCreature.destroy(source.getSourceId(), game, false);
Permanent destroyedCreature = game.getPermanentOrLKIBattlefield(source.getFirstTarget());
if (destroyedCreature.getColor().isBlue()
|| destroyedCreature.getColor().isBlack()) {
if (destroyedCreature.getColor(game).isBlue()
|| destroyedCreature.getColor(game).isBlack()) {
SpiderToken token = new SpiderToken();
token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId());
return true;

View file

@ -122,7 +122,7 @@ class TargetTwoCardsWithTheSameColorInHand extends TargetCardInHand {
Card chosenCard = cardsToCheck.get(entry.getKey(), game);
if (chosenCard != null) {
for (UUID cardToCheck : cardsToCheck) {
if (!cardToCheck.equals(chosenCard.getId()) && chosenCard.getColor().equals(game.getCard(cardToCheck).getColor())) {
if (!cardToCheck.equals(chosenCard.getId()) && chosenCard.getColor(game).equals(game.getCard(cardToCheck).getColor(game))) {
newPossibleTargets.add(cardToCheck);
}
}
@ -131,7 +131,7 @@ class TargetTwoCardsWithTheSameColorInHand extends TargetCardInHand {
} else {
for (UUID cardToCheck : cardsToCheck) {
FilterCard colorFilter = new FilterCard();
colorFilter.add(new ColorPredicate(game.getCard(cardToCheck).getColor()));
colorFilter.add(new ColorPredicate(game.getCard(cardToCheck).getColor(game)));
if (cardsToCheck.count(colorFilter, game) > 1) {
newPossibleTargets.add(cardToCheck);
}
@ -150,7 +150,7 @@ class TargetTwoCardsWithTheSameColorInHand extends TargetCardInHand {
int possibleCards = 0;
for (UUID cardToCheck : cardsToCheck) {
FilterCard colorFilter = new FilterCard();
colorFilter.add(new ColorPredicate(game.getCard(cardToCheck).getColor()));
colorFilter.add(new ColorPredicate(game.getCard(cardToCheck).getColor(game)));
if (cardsToCheck.count(colorFilter, game) > 1) {
++possibleCards;
}
@ -165,12 +165,12 @@ class TargetTwoCardsWithTheSameColorInHand extends TargetCardInHand {
if (card != null) {
if (targets.size() == 1) {
Card card2 = game.getCard(targets.entrySet().iterator().next().getKey());
if (card2 != null && card2.getColor().equals(card.getColor())) {
if (card2 != null && card2.getColor(game).equals(card.getColor(game))) {
return true;
}
} else {
FilterCard colorFilter = new FilterCard();
colorFilter.add(new ColorPredicate(card.getColor()));
colorFilter.add(new ColorPredicate(card.getColor(game)));
Player player = game.getPlayer(card.getOwnerId());
if (player.getHand().getCards(colorFilter, game).size() > 1) {
return true;

View file

@ -96,8 +96,8 @@ class InquisitorsSnareEffect extends OneShotEffect {
FilterCreaturePermanent filter = new FilterCreaturePermanent();
filter.add(new PermanentIdPredicate(targetCreature.getId()));
game.addEffect(new PreventAllDamageByAllEffect(filter, Duration.EndOfTurn, false), source);
if (targetCreature.getColor().contains(ObjectColor.BLACK)
|| targetCreature.getColor().contains(ObjectColor.RED)) {
if (targetCreature.getColor(game).contains(ObjectColor.BLACK)
|| targetCreature.getColor(game).contains(ObjectColor.RED)) {
return targetCreature.destroy(source.getSourceId(), game, false);
}
}

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