mirror of
https://github.com/magefree/mage.git
synced 2026-01-09 20:32:06 -08:00
* Started to fix color setting for cards (e.g. Painter's Serverant) #408 (not completely finished yet).
This commit is contained in:
parent
119422750c
commit
c27ef5ee97
169 changed files with 515 additions and 395 deletions
|
|
@ -26,7 +26,7 @@ public interface MageObject extends MageItem, Serializable {
|
|||
Abilities<Ability> getAbilities();
|
||||
boolean hasAbility(UUID abilityId, Game game);
|
||||
|
||||
ObjectColor getColor();
|
||||
ObjectColor getColor(Game game);
|
||||
ManaCosts<ManaCost> getManaCost();
|
||||
|
||||
MageInt getPower();
|
||||
|
|
|
|||
|
|
@ -157,7 +157,7 @@ public abstract class MageObjectImpl implements MageObject {
|
|||
}
|
||||
|
||||
@Override
|
||||
public ObjectColor getColor() {
|
||||
public ObjectColor getColor(Game game) {
|
||||
return color;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -97,7 +97,7 @@ public class CopyEffect extends ContinuousEffectImpl {
|
|||
return false;
|
||||
}
|
||||
permanent.setName(target.getName());
|
||||
permanent.getColor().setColor(target.getColor());
|
||||
permanent.getColor(game).setColor(target.getColor(game));
|
||||
permanent.getManaCost().clear();
|
||||
permanent.getManaCost().add(target.getManaCost());
|
||||
permanent.getCardType().clear();
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ public class CopyTokenEffect extends ContinuousEffectImpl {
|
|||
public boolean apply(Game game, Ability source) {
|
||||
Permanent permanent = game.getPermanent(source.getSourceId());
|
||||
permanent.setName(token.getName());
|
||||
permanent.getColor().setColor(token.getColor());
|
||||
permanent.getColor(game).setColor(token.getColor(game));
|
||||
permanent.getCardType().clear();
|
||||
for (CardType type: token.getCardType()) {
|
||||
permanent.getCardType().add(type);
|
||||
|
|
|
|||
|
|
@ -63,15 +63,15 @@ public class AddCardColorAttachedEffect extends ContinuousEffectImpl {
|
|||
Permanent target = game.getPermanent(equipment.getAttachedTo());
|
||||
if (target != null) {
|
||||
if (addedColor.isBlack())
|
||||
target.getColor().setBlack(true);
|
||||
target.getColor(game).setBlack(true);
|
||||
if (addedColor.isBlue())
|
||||
target.getColor().setBlue(true);
|
||||
target.getColor(game).setBlue(true);
|
||||
if (addedColor.isWhite())
|
||||
target.getColor().setWhite(true);
|
||||
target.getColor(game).setWhite(true);
|
||||
if (addedColor.isGreen())
|
||||
target.getColor().setGreen(true);
|
||||
target.getColor(game).setGreen(true);
|
||||
if (addedColor.isRed())
|
||||
target.getColor().setRed(true);
|
||||
target.getColor(game).setRed(true);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -85,11 +85,11 @@ public class BecomesBasicLandEnchantedEffect extends ContinuousEffectImpl {
|
|||
if (permanent != null) {
|
||||
switch (layer) {
|
||||
case ColorChangingEffects_5:
|
||||
permanent.getColor().setWhite(false);
|
||||
permanent.getColor().setGreen(false);
|
||||
permanent.getColor().setBlack(false);
|
||||
permanent.getColor().setBlue(false);
|
||||
permanent.getColor().setRed(false);
|
||||
permanent.getColor(game).setWhite(false);
|
||||
permanent.getColor(game).setGreen(false);
|
||||
permanent.getColor(game).setBlack(false);
|
||||
permanent.getColor(game).setBlue(false);
|
||||
permanent.getColor(game).setRed(false);
|
||||
break;
|
||||
case AbilityAddingRemovingEffects_6:
|
||||
permanent.removeAllAbilities(source.getSourceId(), game);
|
||||
|
|
|
|||
|
|
@ -107,7 +107,7 @@ public class BecomesColorTargetEffect extends ContinuousEffectImpl {
|
|||
MageObject o = game.getObject(targetId);
|
||||
if (o != null) {
|
||||
if (o instanceof Permanent || o instanceof StackObject) {
|
||||
o.getColor().setColor(objectColor);
|
||||
o.getColor(game).setColor(objectColor);
|
||||
result = true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -93,8 +93,8 @@ public class BecomesCreatureAllEffect extends ContinuousEffectImpl {
|
|||
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;
|
||||
case AbilityAddingRemovingEffects_6:
|
||||
|
|
|
|||
|
|
@ -115,14 +115,14 @@ public class BecomesCreatureAttachedEffect extends ContinuousEffectImpl {
|
|||
case ColorChangingEffects_5:
|
||||
if (sublayer == SubLayer.NA) {
|
||||
if (loseOther) {
|
||||
permanent.getColor().setBlack(false);
|
||||
permanent.getColor().setGreen(false);
|
||||
permanent.getColor().setBlue(false);
|
||||
permanent.getColor().setWhite(false);
|
||||
permanent.getColor().setRed(false);
|
||||
permanent.getColor(game).setBlack(false);
|
||||
permanent.getColor(game).setGreen(false);
|
||||
permanent.getColor(game).setBlue(false);
|
||||
permanent.getColor(game).setWhite(false);
|
||||
permanent.getColor(game).setRed(false);
|
||||
}
|
||||
if (token.getColor().hasColor()) {
|
||||
permanent.getColor().setColor(token.getColor());
|
||||
if (token.getColor(game).hasColor()) {
|
||||
permanent.getColor(game).setColor(token.getColor(game));
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -105,8 +105,8 @@ public class BecomesCreatureSourceEffect extends ContinuousEffectImpl implements
|
|||
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;
|
||||
|
|
|
|||
|
|
@ -111,14 +111,14 @@ public class BecomesCreatureTargetEffect extends ContinuousEffectImpl {
|
|||
case ColorChangingEffects_5:
|
||||
if (sublayer == SubLayer.NA) {
|
||||
if (loseAllAbilities) {
|
||||
permanent.getColor().setBlack(false);
|
||||
permanent.getColor().setGreen(false);
|
||||
permanent.getColor().setBlue(false);
|
||||
permanent.getColor().setWhite(false);
|
||||
permanent.getColor().setBlack(false);
|
||||
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);
|
||||
}
|
||||
if (token.getColor().hasColor()) {
|
||||
permanent.getColor().setColor(token.getColor());
|
||||
if (token.getColor(game).hasColor()) {
|
||||
permanent.getColor(game).setColor(token.getColor(game));
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -118,7 +118,7 @@ public class BecomesFaceDownCreatureAllEffect extends ContinuousEffectImpl imple
|
|||
permanent.getManaCost().clear();
|
||||
break;
|
||||
case ColorChangingEffects_5:
|
||||
permanent.getColor().setColor(new ObjectColor());
|
||||
permanent.getColor(game).setColor(new ObjectColor());
|
||||
break;
|
||||
case AbilityAddingRemovingEffects_6:
|
||||
Card card = game.getCard(permanent.getId()); //
|
||||
|
|
|
|||
|
|
@ -175,7 +175,7 @@ public class BecomesFaceDownCreatureEffect extends ContinuousEffectImpl implemen
|
|||
permanent.getSubtype().clear();
|
||||
break;
|
||||
case ColorChangingEffects_5:
|
||||
permanent.getColor().setColor(new ObjectColor());
|
||||
permanent.getColor(game).setColor(new ObjectColor());
|
||||
break;
|
||||
case AbilityAddingRemovingEffects_6:
|
||||
Card card = game.getCard(permanent.getId()); //
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ public class SetCardColorAttachedEffect extends ContinuousEffectImpl {
|
|||
if (equipment != null && equipment.getAttachedTo() != null) {
|
||||
Permanent target = game.getPermanent(equipment.getAttachedTo());
|
||||
if (target != null) {
|
||||
target.getColor().setColor(setColor);
|
||||
target.getColor(game).setColor(setColor);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ public class SetCardColorSourceEffect extends ContinuousEffectImpl {
|
|||
MageObject o = game.getObject(source.getSourceId());
|
||||
if (o != null) {
|
||||
if (o instanceof Permanent || o instanceof StackObject) {
|
||||
o.getColor().setColor(setColor);
|
||||
o.getColor(game).setColor(setColor);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -207,7 +207,7 @@ class ConvokeEffect extends OneShotEffect {
|
|||
String manaName;
|
||||
if (!perm.isTapped() && perm.tap(game)) {
|
||||
ManaPool manaPool = controller.getManaPool();
|
||||
Choice chooseManaType = buildChoice(perm.getColor(), unpaid.getMana());
|
||||
Choice chooseManaType = buildChoice(perm.getColor(game), unpaid.getMana());
|
||||
if (chooseManaType.getChoices().size() > 0) {
|
||||
if (chooseManaType.getChoices().size() > 1) {
|
||||
chooseManaType.getChoices().add("Colorless");
|
||||
|
|
|
|||
|
|
@ -91,7 +91,7 @@ class FearEffect extends RestrictionEffect implements MageSingleton {
|
|||
|
||||
@Override
|
||||
public boolean canBeBlocked(Permanent attacker, Permanent blocker, Ability source, Game game) {
|
||||
if (blocker.getCardType().contains(CardType.ARTIFACT) || blocker.getColor().isBlack()) {
|
||||
if (blocker.getCardType().contains(CardType.ARTIFACT) || blocker.getColor(game).isBlack()) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ class IntimidateEffect extends RestrictionEffect implements MageSingleton {
|
|||
if (blocker.getCardType().contains(CardType.ARTIFACT) && (blocker.getCardType().contains(CardType.CREATURE))) {
|
||||
result = true;
|
||||
}
|
||||
if (attacker.getColor().shares(blocker.getColor())) {
|
||||
if (attacker.getColor(game).shares(blocker.getColor(game))) {
|
||||
result = true;
|
||||
}
|
||||
return result;
|
||||
|
|
|
|||
|
|
@ -219,7 +219,7 @@ public class MorphAbility extends StaticAbility implements AlternativeSourceCost
|
|||
}
|
||||
}
|
||||
// change spell colors
|
||||
ObjectColor spellColor = spell.getColor();
|
||||
ObjectColor spellColor = spell.getColor(game);
|
||||
spellColor.setBlack(false);
|
||||
spellColor.setRed(false);
|
||||
spellColor.setGreen(false);
|
||||
|
|
@ -297,7 +297,7 @@ public class MorphAbility extends StaticAbility implements AlternativeSourceCost
|
|||
mageObject.getPower().initValue(2);
|
||||
mageObject.getToughness().initValue(2);
|
||||
mageObject.getAbilities().clear();
|
||||
mageObject.getColor().setColor(new ObjectColor());
|
||||
mageObject.getColor(null).setColor(new ObjectColor());
|
||||
mageObject.setName("");
|
||||
mageObject.getCardType().clear();
|
||||
mageObject.getCardType().add(CardType.CREATURE);
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ public class TransformAbility extends SimpleStaticAbility {
|
|||
}
|
||||
|
||||
permanent.setName(sourceCard.getName());
|
||||
permanent.getColor().setColor(sourceCard.getColor());
|
||||
permanent.getColor(game).setColor(sourceCard.getColor(game));
|
||||
permanent.getManaCost().clear();
|
||||
permanent.getManaCost().add(sourceCard.getManaCost());
|
||||
permanent.getCardType().clear();
|
||||
|
|
|
|||
|
|
@ -33,6 +33,7 @@ import java.util.List;
|
|||
import java.util.UUID;
|
||||
import mage.MageObject;
|
||||
import mage.Mana;
|
||||
import mage.ObjectColor;
|
||||
import mage.abilities.Abilities;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.SpellAbility;
|
||||
|
|
@ -134,5 +135,5 @@ public interface Card extends MageObject {
|
|||
*/
|
||||
Card getMainCard();
|
||||
|
||||
void setZone(Zone zone, Game game);
|
||||
void setZone(Zone zone, Game game);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -36,6 +36,7 @@ import java.util.UUID;
|
|||
import mage.MageObject;
|
||||
import mage.MageObjectImpl;
|
||||
import mage.Mana;
|
||||
import mage.ObjectColor;
|
||||
import mage.abilities.Abilities;
|
||||
import mage.abilities.AbilitiesImpl;
|
||||
import mage.abilities.Ability;
|
||||
|
|
@ -59,6 +60,7 @@ import static mage.constants.Zone.PICK;
|
|||
import static mage.constants.Zone.STACK;
|
||||
import mage.counters.Counter;
|
||||
import mage.counters.Counters;
|
||||
import mage.game.CardAttribute;
|
||||
import mage.game.CardState;
|
||||
import mage.game.Game;
|
||||
import mage.game.command.Commander;
|
||||
|
|
@ -763,5 +765,15 @@ public abstract class CardImpl extends MageObjectImpl implements Card {
|
|||
public void setSpellAbility(SpellAbility ability) {
|
||||
spellAbility = ability;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public ObjectColor getColor(Game game) {
|
||||
if (game != null) {
|
||||
CardAttribute cardAttribute = game.getState().getCardAttribute(getId());
|
||||
if (cardAttribute != null) {
|
||||
return cardAttribute.getColor();
|
||||
}
|
||||
}
|
||||
return super.getColor(game); //To change body of generated methods, choose Tools | Templates.
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -132,11 +132,11 @@ public class CardInfo {
|
|||
this.secondSideName = secondSide.getName();
|
||||
}
|
||||
|
||||
this.blue = card.getColor().isBlue();
|
||||
this.black = card.getColor().isBlack();
|
||||
this.green = card.getColor().isGreen();
|
||||
this.red = card.getColor().isRed();
|
||||
this.white = card.getColor().isWhite();
|
||||
this.blue = card.getColor(null).isBlue();
|
||||
this.black = card.getColor(null).isBlack();
|
||||
this.green = card.getColor(null).isGreen();
|
||||
this.red = card.getColor(null).isRed();
|
||||
this.white = card.getColor(null).isWhite();
|
||||
|
||||
this.setTypes(card.getCardType());
|
||||
this.setSubtypes(card.getSubtype());
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ public class ColorPredicate implements Predicate<MageObject> {
|
|||
|
||||
@Override
|
||||
public boolean apply(MageObject input, Game game) {
|
||||
return input.getColor().contains(color);
|
||||
return input.getColor(game).contains(color);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ public class ColorlessPredicate implements Predicate<MageObject> {
|
|||
|
||||
@Override
|
||||
public boolean apply(MageObject input, Game game) {
|
||||
return input.getColor().isColorless();
|
||||
return input.getColor(game).isColorless();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ public class MonocoloredPredicate implements Predicate<MageObject> {
|
|||
|
||||
@Override
|
||||
public boolean apply(MageObject input, Game game) {
|
||||
return 1 == input.getColor().getColorCount();
|
||||
return 1 == input.getColor(game).getColorCount();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ public class MulticoloredPredicate implements Predicate<MageObject> {
|
|||
|
||||
@Override
|
||||
public boolean apply(MageObject input, Game game) {
|
||||
return 1 < input.getColor().getColorCount();
|
||||
return 1 < input.getColor(game).getColorCount();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ public class SharesColorWithSourcePredicate implements ObjectSourcePlayerPredica
|
|||
public boolean apply(ObjectSourcePlayer<MageObject> input, Game game) {
|
||||
MageObject sourceObject = game.getObject(input.getSourceId());
|
||||
if (sourceObject != null) {
|
||||
return input.getObject().getColor().shares(sourceObject.getColor());
|
||||
return input.getObject().getColor(game).shares(sourceObject.getColor(game));
|
||||
}
|
||||
return false;
|
||||
|
||||
|
|
|
|||
29
Mage/src/mage/game/CardAttribute.java
Normal file
29
Mage/src/mage/game/CardAttribute.java
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
/*
|
||||
* To change this license header, choose License Headers in Project Properties.
|
||||
* To change this template file, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
package mage.game;
|
||||
|
||||
import java.io.Serializable;
|
||||
import mage.ObjectColor;
|
||||
import mage.cards.Card;
|
||||
|
||||
/**
|
||||
* This class saves changed attributes of cards (e.g. in graveyard, exile or player hands or libraries).
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class CardAttribute implements Serializable {
|
||||
|
||||
protected ObjectColor color;
|
||||
|
||||
public CardAttribute(Card card) {
|
||||
color = card.getColor(null).copy();
|
||||
}
|
||||
|
||||
public ObjectColor getColor() {
|
||||
return color;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -109,6 +109,7 @@ public class GameState implements Serializable, Copyable<GameState> {
|
|||
private Map<UUID, Zone> zones = new HashMap<>();
|
||||
private List<GameEvent> simultaneousEvents = new ArrayList<>();
|
||||
private Map<UUID, CardState> cardState = new HashMap<>();
|
||||
private Map<UUID, CardAttribute> cardAttribute = new HashMap<>();
|
||||
private Map<UUID, Integer> zoneChangeCounter = new HashMap<>();
|
||||
private Map<UUID, Card> copiedCards = new HashMap<>();
|
||||
private int permanentOrderNumber;
|
||||
|
|
@ -831,6 +832,7 @@ public class GameState implements Serializable, Copyable<GameState> {
|
|||
for (CardState state: cardState.values()) {
|
||||
state.clearAbilities();
|
||||
}
|
||||
cardAttribute.clear();
|
||||
}
|
||||
|
||||
public void clear() {
|
||||
|
|
@ -892,11 +894,23 @@ public class GameState implements Serializable, Copyable<GameState> {
|
|||
public CardState getCardState(UUID cardId) {
|
||||
if (!cardState.containsKey(cardId)) {
|
||||
cardState.put(cardId, new CardState());
|
||||
// cardState.putIfAbsent(cardId, new CardState());
|
||||
}
|
||||
return cardState.get(cardId);
|
||||
}
|
||||
|
||||
public CardAttribute getCardAttribute(UUID cardId) {
|
||||
return cardAttribute.get(cardId);
|
||||
}
|
||||
|
||||
public CardAttribute getCreateCardAttribute(Card card) {
|
||||
CardAttribute cardAtt = cardAttribute.get(card.getId());
|
||||
if (cardAtt == null) {
|
||||
cardAtt = new CardAttribute(card);
|
||||
cardAttribute.put(card.getId(), cardAtt);
|
||||
}
|
||||
return cardAtt;
|
||||
}
|
||||
|
||||
public void addWatcher(Watcher watcher) {
|
||||
this.watchers.add(watcher);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -149,8 +149,8 @@ public class Commander implements CommandObject{
|
|||
}
|
||||
|
||||
@Override
|
||||
public ObjectColor getColor() {
|
||||
return card.getColor();
|
||||
public ObjectColor getColor(Game game) {
|
||||
return card.getColor(game);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -150,7 +150,7 @@ public class Emblem implements CommandObject {
|
|||
}
|
||||
|
||||
@Override
|
||||
public ObjectColor getColor() {
|
||||
public ObjectColor getColor(Game game) {
|
||||
return emptyColor;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -99,7 +99,7 @@ public class PermanentCard extends PermanentImpl {
|
|||
this.abilities.setSourceId(objectId);
|
||||
this.cardType.clear();
|
||||
this.cardType.addAll(card.getCardType());
|
||||
this.color = card.getColor().copy();
|
||||
this.color = card.getColor(null).copy();
|
||||
this.manaCost = card.getManaCost().copy();
|
||||
this.power = card.getPower().copy();
|
||||
this.toughness = card.getToughness().copy();
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@ import java.util.Map;
|
|||
import java.util.UUID;
|
||||
import mage.MageObject;
|
||||
import mage.MageObjectReference;
|
||||
import mage.ObjectColor;
|
||||
import mage.abilities.Abilities;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.effects.ContinuousEffect;
|
||||
|
|
@ -1359,5 +1360,11 @@ public abstract class PermanentImpl extends CardImpl implements Permanent {
|
|||
public void setCreateOrder(int createOrder) {
|
||||
this.createOrder = createOrder;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public ObjectColor getColor(Game game) {
|
||||
return color;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -82,7 +82,7 @@ public class PermanentToken extends PermanentImpl {
|
|||
this.getManaCost().add(cost.copy());
|
||||
}
|
||||
this.cardType = token.getCardType();
|
||||
this.color = token.getColor().copy();
|
||||
this.color = token.getColor(game).copy();
|
||||
this.power.initValue(token.getPower().getValue());
|
||||
this.toughness.initValue(token.getToughness().getValue());
|
||||
this.supertype = token.getSupertype();
|
||||
|
|
|
|||
|
|
@ -81,7 +81,7 @@ public class Spell extends StackObjImpl implements Card {
|
|||
|
||||
public Spell(Card card, SpellAbility ability, UUID controllerId, Zone fromZone) {
|
||||
this.card = card;
|
||||
this.color = card.getColor().copy();
|
||||
this.color = card.getColor(null).copy();
|
||||
id = ability.getId();
|
||||
this.ability = ability;
|
||||
this.ability.setControllerId(controllerId);
|
||||
|
|
@ -431,7 +431,7 @@ public class Spell extends StackObjImpl implements Card {
|
|||
}
|
||||
|
||||
@Override
|
||||
public ObjectColor getColor() {
|
||||
public ObjectColor getColor(Game game) {
|
||||
return color;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -175,7 +175,7 @@ public class StackAbility extends StackObjImpl implements Ability {
|
|||
}
|
||||
|
||||
@Override
|
||||
public ObjectColor getColor() {
|
||||
public ObjectColor getColor(Game game) {
|
||||
return emptyColor;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ public class GameLog {
|
|||
}
|
||||
|
||||
public static String getColoredObjectName(MageObject mageObject) {
|
||||
return "<font color=\'" + getColorName(mageObject.getColor()) + "\'>" + mageObject.getName() + " ["+mageObject.getId().toString().substring(0,3) + "]</font>";
|
||||
return "<font color=\'" + getColorName(mageObject.getColor(null)) + "\'>" + mageObject.getName() + " ["+mageObject.getId().toString().substring(0,3) + "]</font>";
|
||||
}
|
||||
|
||||
public static String getNeutralColoredText(String text) {
|
||||
|
|
|
|||
|
|
@ -83,7 +83,7 @@ public class CopyTokenFunction implements Function<Token, Card> {
|
|||
}
|
||||
|
||||
target.setName(sourceObj.getName());
|
||||
target.getColor().setColor(sourceObj.getColor());
|
||||
target.getColor(null).setColor(sourceObj.getColor(null));
|
||||
target.getManaCost().clear();
|
||||
target.getManaCost().add(sourceObj.getManaCost());
|
||||
target.getCardType().clear();
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ public class TraceUtil {
|
|||
for (UUID blockerId : group.getBlockers()) {
|
||||
Permanent blocker = game.getPermanent(blockerId);
|
||||
if (blocker != null && !blocker.getCardType().contains(CardType.ARTIFACT)
|
||||
&& !attacker.getColor().shares(blocker.getColor())) {
|
||||
&& !attacker.getColor(game).shares(blocker.getColor(game))) {
|
||||
log.warn("Found creature with intimidate blocked by non artifact not sharing color creature");
|
||||
traceCombat(game, attacker, blocker);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue