- Transformed objects must be reset to Original before they go through CardFactory.copyCard, or they end up in a mixed state, at least visually (since the transformed state is set on the copied object).

This commit is contained in:
Agetian
2018-12-17 17:21:34 +03:00
parent 0bd8e3a9a2
commit f703a903f5

View File

@@ -213,14 +213,18 @@ public class GameAction {
c.updateStateForView(); c.updateStateForView();
} }
if (fromBattlefield && c.getCurrentStateName() != CardStateName.Original) {
// when a card leaves the battlefield, ensure it's in its original state
// (we need to do this on the object before copying it, or it won't work correctly e.g.
// on Transformed objects)
c.setState(CardStateName.Original, false);
}
copied = CardFactory.copyCard(c, false); copied = CardFactory.copyCard(c, false);
copied.setUnearthed(c.isUnearthed()); copied.setUnearthed(c.isUnearthed());
copied.setTapped(false); copied.setTapped(false);
if (fromBattlefield) {
// when a card leaves the battlefield, ensure it's in its original state
copied.setState(CardStateName.Original, false);
}
for (final Trigger trigger : copied.getTriggers()) { for (final Trigger trigger : copied.getTriggers()) {
trigger.setHostCard(copied); trigger.setHostCard(copied);
} }