mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 11:18:01 +00:00
Card: changed Color/Type as Table
This commit is contained in:
@@ -285,11 +285,11 @@ public class GameCopier {
|
|||||||
newCard.setPTBoost(c.getPTBoostTable());
|
newCard.setPTBoost(c.getPTBoostTable());
|
||||||
newCard.setDamage(c.getDamage());
|
newCard.setDamage(c.getDamage());
|
||||||
|
|
||||||
newCard.setChangedCardColors(c.getChangedCardColorsMap());
|
newCard.setChangedCardColors(c.getChangedCardColorsTable());
|
||||||
newCard.setChangedCardColorsCharacterDefining(c.getChangedCardColorsCharacterDefiningMap());
|
newCard.setChangedCardColorsCharacterDefining(c.getChangedCardColorsCharacterDefiningTable());
|
||||||
|
|
||||||
newCard.setChangedCardTypes(c.getChangedCardTypesMap());
|
newCard.setChangedCardTypes(c.getChangedCardTypesTable());
|
||||||
newCard.setChangedCardTypesCharacterDefining(c.getChangedCardTypesCharacterDefiningMap());
|
newCard.setChangedCardTypesCharacterDefining(c.getChangedCardTypesCharacterDefiningTable());
|
||||||
newCard.setChangedCardKeywords(c.getChangedCardKeywords());
|
newCard.setChangedCardKeywords(c.getChangedCardKeywords());
|
||||||
newCard.setChangedCardNames(c.getChangedCardNames());
|
newCard.setChangedCardNames(c.getChangedCardNames());
|
||||||
|
|
||||||
|
|||||||
@@ -274,11 +274,11 @@ public class GameAction {
|
|||||||
|
|
||||||
if (zoneTo.is(ZoneType.Stack)) {
|
if (zoneTo.is(ZoneType.Stack)) {
|
||||||
// when moving to stack, copy changed card information
|
// when moving to stack, copy changed card information
|
||||||
copied.setChangedCardColors(c.getChangedCardColorsMap());
|
copied.setChangedCardColors(c.getChangedCardColorsTable());
|
||||||
copied.setChangedCardColorsCharacterDefining(c.getChangedCardColorsCharacterDefiningMap());
|
copied.setChangedCardColorsCharacterDefining(c.getChangedCardColorsCharacterDefiningTable());
|
||||||
copied.setChangedCardKeywords(c.getChangedCardKeywords());
|
copied.setChangedCardKeywords(c.getChangedCardKeywords());
|
||||||
copied.setChangedCardTypes(c.getChangedCardTypesMap());
|
copied.setChangedCardTypes(c.getChangedCardTypesTable());
|
||||||
copied.setChangedCardTypesCharacterDefining(c.getChangedCardTypesCharacterDefiningMap());
|
copied.setChangedCardTypesCharacterDefining(c.getChangedCardTypesCharacterDefiningTable());
|
||||||
copied.setChangedCardNames(c.getChangedCardNames());
|
copied.setChangedCardNames(c.getChangedCardNames());
|
||||||
copied.setChangedCardTraits(c.getChangedCardTraits());
|
copied.setChangedCardTraits(c.getChangedCardTraits());
|
||||||
|
|
||||||
|
|||||||
@@ -244,12 +244,12 @@ public class StaticEffect {
|
|||||||
// remove Types
|
// remove Types
|
||||||
if (hasParam("AddType") || hasParam("RemoveType")) {
|
if (hasParam("AddType") || hasParam("RemoveType")) {
|
||||||
// the view is updated in GameAction#checkStaticAbilities to avoid flickering
|
// the view is updated in GameAction#checkStaticAbilities to avoid flickering
|
||||||
affectedCard.removeChangedCardTypes(getTimestamp(), false);
|
affectedCard.removeChangedCardTypes(getTimestamp(), ability.getId(), false);
|
||||||
}
|
}
|
||||||
|
|
||||||
// remove colors
|
// remove colors
|
||||||
if (hasParam("AddColor") || hasParam("SetColor")) {
|
if (hasParam("AddColor") || hasParam("SetColor")) {
|
||||||
affectedCard.removeColor(getTimestamp());
|
affectedCard.removeColor(getTimestamp(), ability.getId());
|
||||||
}
|
}
|
||||||
|
|
||||||
// remove may look at
|
// remove may look at
|
||||||
|
|||||||
@@ -94,7 +94,7 @@ public abstract class AnimateEffectBase extends SpellAbilityEffect {
|
|||||||
|
|
||||||
if (!addType.isEmpty() || !removeType.isEmpty() || removeCreatureTypes) {
|
if (!addType.isEmpty() || !removeType.isEmpty() || removeCreatureTypes) {
|
||||||
c.addChangedCardTypes(addType, removeType, removeSuperTypes, removeCardTypes, removeSubTypes,
|
c.addChangedCardTypes(addType, removeType, removeSuperTypes, removeCardTypes, removeSubTypes,
|
||||||
removeLandTypes, removeCreatureTypes, removeArtifactTypes, removeEnchantmentTypes, timestamp, true, false);
|
removeLandTypes, removeCreatureTypes, removeArtifactTypes, removeEnchantmentTypes, timestamp, 0, true, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
c.addChangedCardKeywords(keywords, removeKeywords, removeAll, timestamp, 0);
|
c.addChangedCardKeywords(keywords, removeKeywords, removeAll, timestamp, 0);
|
||||||
@@ -107,7 +107,7 @@ public abstract class AnimateEffectBase extends SpellAbilityEffect {
|
|||||||
c.addHiddenExtrinsicKeywords(timestamp, 0, hiddenKeywords);
|
c.addHiddenExtrinsicKeywords(timestamp, 0, hiddenKeywords);
|
||||||
}
|
}
|
||||||
|
|
||||||
c.addColor(colors, !sa.hasParam("OverwriteColors"), timestamp, false);
|
c.addColor(colors, !sa.hasParam("OverwriteColors"), timestamp, 0, false);
|
||||||
|
|
||||||
if (sa.hasParam("LeaveBattlefield")) {
|
if (sa.hasParam("LeaveBattlefield")) {
|
||||||
addLeaveBattlefieldReplacement(c, sa, sa.getParam("LeaveBattlefield"));
|
addLeaveBattlefieldReplacement(c, sa, sa.getParam("LeaveBattlefield"));
|
||||||
@@ -223,8 +223,8 @@ public abstract class AnimateEffectBase extends SpellAbilityEffect {
|
|||||||
|
|
||||||
c.removeChangedCardKeywords(timestamp, 0);
|
c.removeChangedCardKeywords(timestamp, 0);
|
||||||
|
|
||||||
c.removeChangedCardTypes(timestamp);
|
c.removeChangedCardTypes(timestamp, 0);
|
||||||
c.removeColor(timestamp);
|
c.removeColor(timestamp, 0);
|
||||||
|
|
||||||
c.removeChangedCardTraits(timestamp, 0);
|
c.removeChangedCardTraits(timestamp, 0);
|
||||||
|
|
||||||
|
|||||||
@@ -123,16 +123,17 @@ public class Card extends GameEntity implements Comparable<Card>, IHasSVars {
|
|||||||
|
|
||||||
private final Map<StaticAbility, CardPlayOption> mayPlay = Maps.newHashMap();
|
private final Map<StaticAbility, CardPlayOption> mayPlay = Maps.newHashMap();
|
||||||
|
|
||||||
// changes by AF animate and continuous static effects - timestamp is the key of maps
|
// changes by AF animate and continuous static effects
|
||||||
private final Map<Long, CardChangedType> changedCardTypes = Maps.newTreeMap();
|
// x=timestamp y=StaticAbility id
|
||||||
|
private final Table<Long, Long, CardChangedType> changedCardTypes = TreeBasedTable.create();
|
||||||
private final NavigableMap<Long, String> changedCardNames = Maps.newTreeMap();
|
private final NavigableMap<Long, String> changedCardNames = Maps.newTreeMap();
|
||||||
private final Table<Long, Long, KeywordsChange> changedCardKeywords = TreeBasedTable.create();
|
private final Table<Long, Long, KeywordsChange> changedCardKeywords = TreeBasedTable.create();
|
||||||
// x=timestamp y=StaticAbility id
|
// x=timestamp y=StaticAbility id
|
||||||
private final Table<Long, Long, CardTraitChanges> changedCardTraits = TreeBasedTable.create();
|
private final Table<Long, Long, CardTraitChanges> changedCardTraits = TreeBasedTable.create();
|
||||||
private final Map<Long, CardColor> changedCardColors = Maps.newTreeMap();
|
private final Table<Long, Long, CardColor> changedCardColors = TreeBasedTable.create();
|
||||||
|
|
||||||
private final Map<Long, CardChangedType> changedCardTypesCharacterDefining = Maps.newTreeMap();
|
private final Table<Long, Long, CardChangedType> changedCardTypesCharacterDefining = TreeBasedTable.create();
|
||||||
private final Map<Long, CardColor> changedCardColorsCharacterDefining = Maps.newTreeMap();
|
private final Table<Long, Long, CardColor> changedCardColorsCharacterDefining = TreeBasedTable.create();
|
||||||
|
|
||||||
private final NavigableMap<Long, CardCloneStates> clonedStates = Maps.newTreeMap();
|
private final NavigableMap<Long, CardCloneStates> clonedStates = Maps.newTreeMap();
|
||||||
private final NavigableMap<Long, CardCloneStates> textChangeStates = Maps.newTreeMap();
|
private final NavigableMap<Long, CardCloneStates> textChangeStates = Maps.newTreeMap();
|
||||||
@@ -152,6 +153,7 @@ public class Card extends GameEntity implements Comparable<Card>, IHasSVars {
|
|||||||
// changes that say "replace each instance of one [color,type] by another - timestamp is the key of maps
|
// changes that say "replace each instance of one [color,type] by another - timestamp is the key of maps
|
||||||
private final CardChangedWords changedTextColors = new CardChangedWords();
|
private final CardChangedWords changedTextColors = new CardChangedWords();
|
||||||
private final CardChangedWords changedTextTypes = new CardChangedWords();
|
private final CardChangedWords changedTextTypes = new CardChangedWords();
|
||||||
|
|
||||||
/** List of the keywords that have been added by text changes. */
|
/** List of the keywords that have been added by text changes. */
|
||||||
private final List<KeywordInterface> keywordsGrantedByTextChanges = Lists.newArrayList();
|
private final List<KeywordInterface> keywordsGrantedByTextChanges = Lists.newArrayList();
|
||||||
|
|
||||||
@@ -1467,7 +1469,7 @@ public class Card extends GameEntity implements Comparable<Card>, IHasSVars {
|
|||||||
long timestamp = game.getNextTimestamp();
|
long timestamp = game.getNextTimestamp();
|
||||||
counterTypeTimestamps.put(counterType, timestamp);
|
counterTypeTimestamps.put(counterType, timestamp);
|
||||||
// becomes land in instead of other card types
|
// becomes land in instead of other card types
|
||||||
addChangedCardTypes(new CardType(ImmutableList.of("Land"), false), null, false, true, true, false, false, false, false, timestamp, updateView, false);
|
addChangedCardTypes(new CardType(ImmutableList.of("Land"), false), null, false, true, true, false, false, false, false, timestamp, 0, updateView, false);
|
||||||
|
|
||||||
String abStr = "AB$ ManaReflected | Cost$ T | Valid$ Defined.Self | ColorOrType$ Color | ReflectProperty$ Is | SpellDescription$ Add one mana of any of this card's colors.";
|
String abStr = "AB$ ManaReflected | Cost$ T | Valid$ Defined.Self | ColorOrType$ Color | ReflectProperty$ Is | SpellDescription$ Add one mana of any of this card's colors.";
|
||||||
|
|
||||||
@@ -1494,7 +1496,7 @@ public class Card extends GameEntity implements Comparable<Card>, IHasSVars {
|
|||||||
public boolean removeCounterTimestamp(CounterType counterType, boolean updateView) {
|
public boolean removeCounterTimestamp(CounterType counterType, boolean updateView) {
|
||||||
Long old = counterTypeTimestamps.remove(counterType);
|
Long old = counterTypeTimestamps.remove(counterType);
|
||||||
if (old != null) {
|
if (old != null) {
|
||||||
removeChangedCardTypes(old, updateView);
|
removeChangedCardTypes(old, 0, updateView);
|
||||||
removeChangedCardTraits(old, 0);
|
removeChangedCardTraits(old, 0);
|
||||||
removeChangedCardKeywords(old, 0, updateView);
|
removeChangedCardKeywords(old, 0, updateView);
|
||||||
}
|
}
|
||||||
@@ -3558,15 +3560,24 @@ public class Card extends GameEntity implements Comparable<Card>, IHasSVars {
|
|||||||
return types;
|
return types;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public final CardTypeView getOriginalType() {
|
||||||
|
return getOriginalType(currentState);
|
||||||
|
}
|
||||||
|
|
||||||
|
public final CardTypeView getOriginalType(CardState state) {
|
||||||
|
return state.getType();
|
||||||
|
}
|
||||||
|
|
||||||
|
// TODO add changed type by card text
|
||||||
public Iterable<CardChangedType> getChangedCardTypes() {
|
public Iterable<CardChangedType> getChangedCardTypes() {
|
||||||
return Iterables.unmodifiableIterable(Iterables.concat(changedCardTypesCharacterDefining.values(), changedCardTypes.values()));
|
return Iterables.unmodifiableIterable(Iterables.concat(changedCardTypesCharacterDefining.values(), changedCardTypes.values()));
|
||||||
}
|
}
|
||||||
|
|
||||||
public Map<Long, CardChangedType> getChangedCardTypesMap() {
|
public Table<Long, Long, CardChangedType> getChangedCardTypesTable() {
|
||||||
return Collections.unmodifiableMap(changedCardTypes);
|
return Tables.unmodifiableTable(changedCardTypes);
|
||||||
}
|
}
|
||||||
public Map<Long, CardChangedType> getChangedCardTypesCharacterDefiningMap() {
|
public Table<Long, Long, CardChangedType> getChangedCardTypesCharacterDefiningTable() {
|
||||||
return Collections.unmodifiableMap(changedCardTypesCharacterDefining);
|
return Tables.unmodifiableTable(changedCardTypesCharacterDefining);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean clearChangedCardTypes() {
|
public boolean clearChangedCardTypes() {
|
||||||
@@ -3601,10 +3612,10 @@ public class Card extends GameEntity implements Comparable<Card>, IHasSVars {
|
|||||||
return changedCardKeywords;
|
return changedCardKeywords;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Map<Long, CardColor> getChangedCardColorsMap() {
|
public Table<Long, Long, CardColor> getChangedCardColorsTable() {
|
||||||
return changedCardColors;
|
return changedCardColors;
|
||||||
}
|
}
|
||||||
public Map<Long, CardColor> getChangedCardColorsCharacterDefiningMap() {
|
public Table<Long, Long, CardColor> getChangedCardColorsCharacterDefiningTable() {
|
||||||
return changedCardColorsCharacterDefining;
|
return changedCardColorsCharacterDefining;
|
||||||
}
|
}
|
||||||
public Iterable<CardColor> getChangedCardColors() {
|
public Iterable<CardColor> getChangedCardColors() {
|
||||||
@@ -3615,8 +3626,8 @@ public class Card extends GameEntity implements Comparable<Card>, IHasSVars {
|
|||||||
final boolean removeSuperTypes, final boolean removeCardTypes, final boolean removeSubTypes,
|
final boolean removeSuperTypes, final boolean removeCardTypes, final boolean removeSubTypes,
|
||||||
final boolean removeLandTypes, final boolean removeCreatureTypes, final boolean removeArtifactTypes,
|
final boolean removeLandTypes, final boolean removeCreatureTypes, final boolean removeArtifactTypes,
|
||||||
final boolean removeEnchantmentTypes,
|
final boolean removeEnchantmentTypes,
|
||||||
final long timestamp, final boolean updateView, final boolean cda) {
|
final long timestamp, final long staticId, final boolean updateView, final boolean cda) {
|
||||||
(cda ? changedCardTypesCharacterDefining : changedCardTypes).put(timestamp, new CardChangedType(
|
(cda ? changedCardTypesCharacterDefining : changedCardTypes).put(timestamp, staticId, new CardChangedType(
|
||||||
addType, removeType, removeSuperTypes, removeCardTypes, removeSubTypes,
|
addType, removeType, removeSuperTypes, removeCardTypes, removeSubTypes,
|
||||||
removeLandTypes, removeCreatureTypes, removeArtifactTypes, removeEnchantmentTypes));
|
removeLandTypes, removeCreatureTypes, removeArtifactTypes, removeEnchantmentTypes));
|
||||||
if (updateView) {
|
if (updateView) {
|
||||||
@@ -3628,7 +3639,7 @@ public class Card extends GameEntity implements Comparable<Card>, IHasSVars {
|
|||||||
final boolean removeSuperTypes, final boolean removeCardTypes, final boolean removeSubTypes,
|
final boolean removeSuperTypes, final boolean removeCardTypes, final boolean removeSubTypes,
|
||||||
final boolean removeLandTypes, final boolean removeCreatureTypes, final boolean removeArtifactTypes,
|
final boolean removeLandTypes, final boolean removeCreatureTypes, final boolean removeArtifactTypes,
|
||||||
final boolean removeEnchantmentTypes,
|
final boolean removeEnchantmentTypes,
|
||||||
final long timestamp, final boolean updateView, final boolean cda) {
|
final long timestamp, final long staticId, final boolean updateView, final boolean cda) {
|
||||||
CardType addType = null;
|
CardType addType = null;
|
||||||
CardType removeType = null;
|
CardType removeType = null;
|
||||||
if (types != null) {
|
if (types != null) {
|
||||||
@@ -3641,31 +3652,31 @@ public class Card extends GameEntity implements Comparable<Card>, IHasSVars {
|
|||||||
|
|
||||||
addChangedCardTypes(addType, removeType, removeSuperTypes, removeCardTypes, removeSubTypes,
|
addChangedCardTypes(addType, removeType, removeSuperTypes, removeCardTypes, removeSubTypes,
|
||||||
removeLandTypes, removeCreatureTypes, removeArtifactTypes, removeEnchantmentTypes,
|
removeLandTypes, removeCreatureTypes, removeArtifactTypes, removeEnchantmentTypes,
|
||||||
timestamp, updateView, cda);
|
timestamp, staticId, updateView, cda);
|
||||||
}
|
}
|
||||||
|
|
||||||
public final void removeChangedCardTypes(final long timestamp) {
|
public final void removeChangedCardTypes(final long timestamp, final long staticId) {
|
||||||
removeChangedCardTypes(timestamp, true);
|
removeChangedCardTypes(timestamp, staticId, true);
|
||||||
}
|
}
|
||||||
public final void removeChangedCardTypes(final long timestamp, final boolean updateView) {
|
public final void removeChangedCardTypes(final long timestamp, final long staticId, final boolean updateView) {
|
||||||
boolean removed = false;
|
boolean removed = false;
|
||||||
removed |= changedCardTypes.remove(timestamp) != null;
|
removed |= changedCardTypes.remove(timestamp, staticId) != null;
|
||||||
removed |= changedCardTypesCharacterDefining.remove(timestamp) != null;
|
removed |= changedCardTypesCharacterDefining.remove(timestamp, staticId) != null;
|
||||||
if (removed && updateView) {
|
if (removed && updateView) {
|
||||||
currentState.getView().updateType(currentState);
|
currentState.getView().updateType(currentState);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public final void addColor(final String s, final boolean addToColors, final long timestamp, final boolean cda) {
|
public final void addColor(final String s, final boolean addToColors, final long timestamp, final long staticId, final boolean cda) {
|
||||||
(cda ? changedCardColorsCharacterDefining : changedCardColors).put(timestamp, new CardColor(s, addToColors, timestamp));
|
(cda ? changedCardColorsCharacterDefining : changedCardColors).put(timestamp, staticId, new CardColor(s, addToColors, timestamp));
|
||||||
currentState.getView().updateColors(this);
|
currentState.getView().updateColors(this);
|
||||||
currentState.getView().updateHasChangeColors(!Iterables.isEmpty(getChangedCardColors()));
|
currentState.getView().updateHasChangeColors(!Iterables.isEmpty(getChangedCardColors()));
|
||||||
}
|
}
|
||||||
|
|
||||||
public final void removeColor(final long timestampIn) {
|
public final void removeColor(final long timestampIn, final long staticId) {
|
||||||
boolean removed = false;
|
boolean removed = false;
|
||||||
removed |= changedCardColors.remove(timestampIn) != null;
|
removed |= changedCardColors.remove(timestampIn, staticId) != null;
|
||||||
removed |= changedCardColorsCharacterDefining.remove(timestampIn) != null;
|
removed |= changedCardColorsCharacterDefining.remove(timestampIn, staticId) != null;
|
||||||
|
|
||||||
if (removed) {
|
if (removed) {
|
||||||
currentState.getView().updateColors(this);
|
currentState.getView().updateColors(this);
|
||||||
@@ -4358,8 +4369,9 @@ public class Card extends GameEntity implements Comparable<Card>, IHasSVars {
|
|||||||
public final void addChangedTextTypeWord(final String originalWord, final String newWord, final Long timestamp, final long staticId) {
|
public final void addChangedTextTypeWord(final String originalWord, final String newWord, final Long timestamp, final long staticId) {
|
||||||
changedTextTypes.add(timestamp, originalWord, newWord);
|
changedTextTypes.add(timestamp, originalWord, newWord);
|
||||||
if (getType().hasSubtype(originalWord)) {
|
if (getType().hasSubtype(originalWord)) {
|
||||||
|
// need other table because different layer
|
||||||
addChangedCardTypes(CardType.parse(newWord, true), CardType.parse(originalWord, true),
|
addChangedCardTypes(CardType.parse(newWord, true), CardType.parse(originalWord, true),
|
||||||
false, false, false, false, false, false, false, timestamp, true, false);
|
false, false, false, false, false, false, false, timestamp, staticId, true, false);
|
||||||
}
|
}
|
||||||
updateKeywordsChangedText(timestamp, staticId);
|
updateKeywordsChangedText(timestamp, staticId);
|
||||||
updateChangedText();
|
updateChangedText();
|
||||||
@@ -4367,7 +4379,7 @@ public class Card extends GameEntity implements Comparable<Card>, IHasSVars {
|
|||||||
|
|
||||||
public final void removeChangedTextTypeWord(final Long timestamp, final long staticId) {
|
public final void removeChangedTextTypeWord(final Long timestamp, final long staticId) {
|
||||||
changedTextTypes.remove(timestamp);
|
changedTextTypes.remove(timestamp);
|
||||||
removeChangedCardTypes(timestamp);
|
removeChangedCardTypes(timestamp, staticId);
|
||||||
updateKeywordsOnRemoveChangedText(
|
updateKeywordsOnRemoveChangedText(
|
||||||
removeChangedCardKeywords(timestamp, staticId));
|
removeChangedCardKeywords(timestamp, staticId));
|
||||||
updateChangedText();
|
updateChangedText();
|
||||||
@@ -5564,7 +5576,7 @@ public class Card extends GameEntity implements Comparable<Card>, IHasSVars {
|
|||||||
bestowTimestamp = getGame().getNextTimestamp();
|
bestowTimestamp = getGame().getNextTimestamp();
|
||||||
addChangedCardTypes(new CardType(Collections.singletonList("Aura"), true),
|
addChangedCardTypes(new CardType(Collections.singletonList("Aura"), true),
|
||||||
new CardType(Collections.singletonList("Creature"), true),
|
new CardType(Collections.singletonList("Creature"), true),
|
||||||
false, false, false, false, false, false, true, bestowTimestamp, updateView, false);
|
false, false, false, false, false, false, true, bestowTimestamp, 0, updateView, false);
|
||||||
addChangedCardKeywords(Collections.singletonList("Enchant creature"), Lists.newArrayList(),
|
addChangedCardKeywords(Collections.singletonList("Enchant creature"), Lists.newArrayList(),
|
||||||
false, bestowTimestamp, 0, updateView);
|
false, bestowTimestamp, 0, updateView);
|
||||||
}
|
}
|
||||||
@@ -5578,7 +5590,7 @@ public class Card extends GameEntity implements Comparable<Card>, IHasSVars {
|
|||||||
}
|
}
|
||||||
|
|
||||||
removeChangedCardKeywords(bestowTimestamp, 0, updateView);
|
removeChangedCardKeywords(bestowTimestamp, 0, updateView);
|
||||||
removeChangedCardTypes(bestowTimestamp, updateView);
|
removeChangedCardTypes(bestowTimestamp, 0, updateView);
|
||||||
bestowTimestamp = -1;
|
bestowTimestamp = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -6617,16 +6629,16 @@ public class Card extends GameEntity implements Comparable<Card>, IHasSVars {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setChangedCardTypes(Map<Long, CardChangedType> changedCardTypes) {
|
public void setChangedCardTypes(Table<Long, Long, CardChangedType> changedCardTypes) {
|
||||||
this.changedCardTypes.clear();
|
this.changedCardTypes.clear();
|
||||||
for (Entry<Long, CardChangedType> entry : changedCardTypes.entrySet()) {
|
for (Table.Cell<Long, Long, CardChangedType> entry : changedCardTypes.cellSet()) {
|
||||||
this.changedCardTypes.put(entry.getKey(), entry.getValue());
|
this.changedCardTypes.put(entry.getRowKey(), entry.getColumnKey(), entry.getValue());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public void setChangedCardTypesCharacterDefining(Map<Long, CardChangedType> changedCardTypes) {
|
public void setChangedCardTypesCharacterDefining(Table<Long, Long, CardChangedType> changedCardTypes) {
|
||||||
this.changedCardTypesCharacterDefining.clear();
|
this.changedCardTypesCharacterDefining.clear();
|
||||||
for (Entry<Long, CardChangedType> entry : changedCardTypes.entrySet()) {
|
for (Table.Cell<Long, Long, CardChangedType> entry : changedCardTypes.cellSet()) {
|
||||||
this.changedCardTypesCharacterDefining.put(entry.getKey(), entry.getValue());
|
this.changedCardTypesCharacterDefining.put(entry.getRowKey(), entry.getColumnKey(), entry.getValue());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -6637,16 +6649,16 @@ public class Card extends GameEntity implements Comparable<Card>, IHasSVars {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setChangedCardColors(Map<Long, CardColor> changedCardColors) {
|
public void setChangedCardColors(Table<Long, Long, CardColor> changedCardColors) {
|
||||||
this.changedCardColors.clear();
|
this.changedCardColors.clear();
|
||||||
for (Entry<Long, CardColor> entry : changedCardColors.entrySet()) {
|
for (Table.Cell<Long, Long, CardColor> entry : changedCardColors.cellSet()) {
|
||||||
this.changedCardColors.put(entry.getKey(), entry.getValue());
|
this.changedCardColors.put(entry.getRowKey(), entry.getColumnKey(), entry.getValue());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public void setChangedCardColorsCharacterDefining(Map<Long, CardColor> changedCardColors) {
|
public void setChangedCardColorsCharacterDefining(Table<Long, Long, CardColor> changedCardColors) {
|
||||||
this.changedCardColorsCharacterDefining.clear();
|
this.changedCardColorsCharacterDefining.clear();
|
||||||
for (Entry<Long, CardColor> entry : changedCardColors.entrySet()) {
|
for (Table.Cell<Long, Long, CardColor> entry : changedCardColors.cellSet()) {
|
||||||
this.changedCardColorsCharacterDefining.put(entry.getKey(), entry.getValue());
|
this.changedCardColorsCharacterDefining.put(entry.getRowKey(), entry.getColumnKey(), entry.getValue());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -140,7 +140,7 @@ public class CardFactory {
|
|||||||
}
|
}
|
||||||
final String finalColors = tmp;
|
final String finalColors = tmp;
|
||||||
|
|
||||||
c.addColor(finalColors, !sourceSA.hasParam("OverwriteColors"), c.getTimestamp(), false);
|
c.addColor(finalColors, !sourceSA.hasParam("OverwriteColors"), c.getTimestamp(), 0, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
c.clearControllers();
|
c.clearControllers();
|
||||||
|
|||||||
@@ -281,11 +281,11 @@ public final class CardUtil {
|
|||||||
|
|
||||||
newCopy.setUnearthed(in.isUnearthed());
|
newCopy.setUnearthed(in.isUnearthed());
|
||||||
|
|
||||||
newCopy.setChangedCardColors(in.getChangedCardColorsMap());
|
newCopy.setChangedCardColors(in.getChangedCardColorsTable());
|
||||||
newCopy.setChangedCardColorsCharacterDefining(in.getChangedCardColorsCharacterDefiningMap());
|
newCopy.setChangedCardColorsCharacterDefining(in.getChangedCardColorsCharacterDefiningTable());
|
||||||
newCopy.setChangedCardKeywords(in.getChangedCardKeywords());
|
newCopy.setChangedCardKeywords(in.getChangedCardKeywords());
|
||||||
newCopy.setChangedCardTypes(in.getChangedCardTypesMap());
|
newCopy.setChangedCardTypes(in.getChangedCardTypesTable());
|
||||||
newCopy.setChangedCardTypesCharacterDefining(in.getChangedCardTypesCharacterDefiningMap());
|
newCopy.setChangedCardTypesCharacterDefining(in.getChangedCardTypesCharacterDefiningTable());
|
||||||
newCopy.setChangedCardNames(in.getChangedCardNames());
|
newCopy.setChangedCardNames(in.getChangedCardNames());
|
||||||
newCopy.setChangedCardTraits(in.getChangedCardTraits());
|
newCopy.setChangedCardTraits(in.getChangedCardTraits());
|
||||||
|
|
||||||
|
|||||||
@@ -846,12 +846,12 @@ public final class StaticAbilityContinuous {
|
|||||||
if ((addTypes != null) || (removeTypes != null)) {
|
if ((addTypes != null) || (removeTypes != null)) {
|
||||||
affectedCard.addChangedCardTypes(addTypes, removeTypes, removeSuperTypes, removeCardTypes,
|
affectedCard.addChangedCardTypes(addTypes, removeTypes, removeSuperTypes, removeCardTypes,
|
||||||
removeSubTypes, removeLandTypes, removeCreatureTypes, removeArtifactTypes,
|
removeSubTypes, removeLandTypes, removeCreatureTypes, removeArtifactTypes,
|
||||||
removeEnchantmentTypes, hostCard.getTimestamp(), true, stAb.hasParam("CharacteristicDefining"));
|
removeEnchantmentTypes, hostCard.getTimestamp(), stAb.getId(), true, stAb.hasParam("CharacteristicDefining"));
|
||||||
}
|
}
|
||||||
|
|
||||||
// add colors
|
// add colors
|
||||||
if (addColors != null) {
|
if (addColors != null) {
|
||||||
affectedCard.addColor(addColors, !overwriteColors, hostCard.getTimestamp(), stAb.hasParam("CharacteristicDefining"));
|
affectedCard.addColor(addColors, !overwriteColors, hostCard.getTimestamp(), stAb.getId(), stAb.hasParam("CharacteristicDefining"));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (layer == StaticAbilityLayer.RULES) {
|
if (layer == StaticAbilityLayer.RULES) {
|
||||||
|
|||||||
Reference in New Issue
Block a user