mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 12:48:00 +00:00
- When a permanent leaves the battlefield, remove all changed keywords on it (fixes e.g. the results of Magical Hack on Leviathan still partially persisting after it dies and is reanimated by something).
This commit is contained in:
@@ -437,6 +437,8 @@ public class GameAction {
|
||||
copied.setState(CardStateName.Original, true);
|
||||
}
|
||||
unattachCardLeavingBattlefield(copied);
|
||||
// Remove all changed keywords
|
||||
copied.removeAllChangedText(game.getNextTimestamp());
|
||||
} else if (toBattlefield) {
|
||||
// reset timestamp in changezone effects so they have same timestamp if ETB simutaneously
|
||||
copied.setTimestamp(game.getNextTimestamp());
|
||||
|
||||
@@ -3371,6 +3371,13 @@ public class Card extends GameEntity implements Comparable<Card> {
|
||||
updateChangedText();
|
||||
}
|
||||
|
||||
public final void removeAllChangedText(final Long timestamp) {
|
||||
changedTextTypes.removeAll();
|
||||
changedTextColors.removeAll();
|
||||
updateKeywordsOnRemoveChangedText(removeChangedCardKeywords(timestamp));
|
||||
updateChangedText();
|
||||
}
|
||||
|
||||
private void updateKeywordsChangedText(final Long timestamp) {
|
||||
if (hasSVar("LockInKeywords")) {
|
||||
return;
|
||||
|
||||
@@ -29,6 +29,11 @@ public final class CardChangedWords {
|
||||
isDirty = true;
|
||||
}
|
||||
|
||||
public void removeAll() {
|
||||
map.clear();
|
||||
isDirty = true;
|
||||
}
|
||||
|
||||
void copyFrom(final CardChangedWords other) {
|
||||
map.clear();
|
||||
map.putAll(other.map);
|
||||
|
||||
Reference in New Issue
Block a user