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