mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-14 09:48:02 +00:00
Card: fix Grist again
This commit is contained in:
@@ -285,6 +285,9 @@ public class GameAction {
|
|||||||
copied.copyChangedTextFrom(c);
|
copied.copyChangedTextFrom(c);
|
||||||
copied.setTimestamp(c.getTimestamp());
|
copied.setTimestamp(c.getTimestamp());
|
||||||
|
|
||||||
|
// clean up changes that come from its own static abilities
|
||||||
|
copied.cleanupCopiedChangesFrom(c);
|
||||||
|
|
||||||
// copy exiled properties when adding to stack
|
// copy exiled properties when adding to stack
|
||||||
// will be cleanup later in MagicStack
|
// will be cleanup later in MagicStack
|
||||||
copied.setExiledWith(c.getExiledWith());
|
copied.setExiledWith(c.getExiledWith());
|
||||||
|
|||||||
@@ -555,8 +555,8 @@ public class Card extends GameEntity implements Comparable<Card>, IHasSVars {
|
|||||||
// The following methods are used to selectively update certain view components (text,
|
// The following methods are used to selectively update certain view components (text,
|
||||||
// P/T, card types) in order to avoid card flickering due to aggressive full update
|
// P/T, card types) in order to avoid card flickering due to aggressive full update
|
||||||
public void updateAbilityTextForView() {
|
public void updateAbilityTextForView() {
|
||||||
updateKeywords();
|
updateKeywords(); // does call update Ability text
|
||||||
view.getCurrentState().updateAbilityText(this, getCurrentState());
|
//view.getCurrentState().updateAbilityText(this, getCurrentState());
|
||||||
}
|
}
|
||||||
|
|
||||||
public final void updatePowerToughnessForView() {
|
public final void updatePowerToughnessForView() {
|
||||||
@@ -4347,10 +4347,10 @@ public class Card extends GameEntity implements Comparable<Card>, IHasSVars {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public final void removeChangedTextColorWord(final Long timestamp, final long staticId) {
|
public final void removeChangedTextColorWord(final Long timestamp, final long staticId) {
|
||||||
changedTextColors.remove(timestamp);
|
if (changedTextColors.remove(timestamp)) {
|
||||||
updateKeywordsOnRemoveChangedText(
|
updateKeywordsOnRemoveChangedText(removeChangedCardKeywords(timestamp, staticId));
|
||||||
removeChangedCardKeywords(timestamp, staticId));
|
updateChangedText();
|
||||||
updateChangedText();
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -4370,11 +4370,11 @@ 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);
|
if (changedTextTypes.remove(timestamp)) {
|
||||||
removeChangedCardTypes(timestamp, staticId);
|
removeChangedCardTypes(timestamp, staticId);
|
||||||
updateKeywordsOnRemoveChangedText(
|
updateKeywordsOnRemoveChangedText(removeChangedCardKeywords(timestamp, staticId));
|
||||||
removeChangedCardKeywords(timestamp, staticId));
|
updateChangedText();
|
||||||
updateChangedText();
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateKeywordsChangedText(final Long timestamp, final long staticId) {
|
private void updateKeywordsChangedText(final Long timestamp, final long staticId) {
|
||||||
@@ -6654,6 +6654,15 @@ public class Card extends GameEntity implements Comparable<Card>, IHasSVars {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void cleanupCopiedChangesFrom(Card c) {
|
||||||
|
for (StaticAbility stAb : c.getStaticAbilities()) {
|
||||||
|
this.removeChangedCardTypes(c.getTimestamp(), stAb.getId(), false);
|
||||||
|
this.removeColor(c.getTimestamp(), stAb.getId());
|
||||||
|
this.removeChangedCardKeywords(c.getTimestamp(), stAb.getId(), false);
|
||||||
|
this.removeChangedCardTraits(c.getTimestamp(), stAb.getId());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void forceTurnFaceUp() {
|
public void forceTurnFaceUp() {
|
||||||
getGame().getTriggerHandler().suppressMode(TriggerType.TurnFaceUp);
|
getGame().getTriggerHandler().suppressMode(TriggerType.TurnFaceUp);
|
||||||
turnFaceUp(false, false, null);
|
turnFaceUp(false, false, null);
|
||||||
|
|||||||
@@ -24,9 +24,9 @@ public final class CardChangedWords {
|
|||||||
return stamp;
|
return stamp;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void remove(final Long timestamp) {
|
public boolean remove(final Long timestamp) {
|
||||||
map.remove(timestamp);
|
|
||||||
isDirty = true;
|
isDirty = true;
|
||||||
|
return map.remove(timestamp) != null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void removeAll() {
|
public void removeAll() {
|
||||||
|
|||||||
Reference in New Issue
Block a user