Fix Shifting Shadow trigger

This commit is contained in:
tool4EvEr
2021-08-18 13:26:50 +02:00
parent 6545470f09
commit f44eca100a
3 changed files with 16 additions and 13 deletions

View File

@@ -243,7 +243,7 @@ public class Cost implements Serializable {
} else {
CostPart cp = parseCostPart(part, tapCost, untapCost);
if (null != cp )
if (cp instanceof CostPartMana ) {
if (cp instanceof CostPartMana) {
parsedMana = (CostPartMana) cp;
} else {
this.costParts.add(cp);

View File

@@ -47,19 +47,22 @@ public class CostAdjustment {
Cost result = cost.copy();
boolean isStateChangeToFaceDown = false;
if (sa.isSpell() && sa.isCastFaceDown()) {
// Turn face down to apply cost modifiers correctly
host.turnFaceDownNoUpdate();
isStateChangeToFaceDown = true;
} // isSpell
// Commander Tax there
if (sa.isSpell() && host.isCommander() && ZoneType.Command.equals(host.getCastFrom())) {
int n = player.getCommanderCast(host) * 2;
if (n > 0) {
result.add(new Cost(ManaCost.get(n), false));
if (sa.isSpell()) {
if (sa.isCastFaceDown()) {
// Turn face down to apply cost modifiers correctly
host.turnFaceDownNoUpdate();
isStateChangeToFaceDown = true;
}
}
// Commander Tax there
if (host.isCommander() && ZoneType.Command.equals(host.getCastFrom())) {
int n = player.getCommanderCast(host) * 2;
if (n > 0) {
result.add(new Cost(ManaCost.get(n), false));
}
}
} // isSpell
CardCollection cardsOnBattlefield = new CardCollection(game.getCardsIn(ZoneType.Battlefield));
cardsOnBattlefield.addAll(game.getCardsIn(ZoneType.Stack));