Merge branch 'retrace' into 'master'

Fix Wrenn and Six Emblem not allowing to retrace adventures

See merge request core-developers/forge!5694
This commit is contained in:
Michael Kamensky
2021-10-30 17:58:26 +00:00
2 changed files with 38 additions and 3 deletions

View File

@@ -11,6 +11,7 @@ import org.apache.commons.lang3.StringUtils;
import com.google.common.collect.Iterables;
import forge.card.CardStateName;
import forge.card.mana.ManaCost;
import forge.game.Game;
import forge.game.GameActionUtil;
@@ -83,14 +84,20 @@ public class HumanPlay {
sa.setActivatingPlayer(p);
boolean flippedToCast = sa.isSpell() && source.isFaceDown();
source.setSplitStateToPlayAbility(sa);
sa = chooseOptionalAdditionalCosts(p, sa);
if (sa == null) {
return false;
}
final CardStateName oldState = source.getCurrentStateName();
source.setSplitStateToPlayAbility(sa);
// extra play check
if (sa.isSpell() && !sa.canPlay()) {
// in case human won't pay optional cost
if (source.getCurrentStateName() != oldState) {
source.setState(oldState, true);
}
return false;
}
@@ -143,7 +150,7 @@ public class HumanPlay {
final SpellAbility choosen = c.getAbilityToPlay(original.getHostCard(), abilities);
List<OptionalCostValue> list = GameActionUtil.getOptionalCostValues(choosen);
List<OptionalCostValue> list = GameActionUtil.getOptionalCostValues(choosen);
if (!list.isEmpty()) {
list = c.chooseOptionalCosts(choosen, list);
}