forked from External/mage
Rework AsThough handling to allow choosing/affecting a specific alternate cast (#11114)
* Rework AsThoughEffect * some cleanup of MageIdentifer * refactor ActivationStatus * fix bolas's citadel * fix a couple of the Alternative Cost being applied too broadly. * fix Risen Executioneer * allow cancellation of AsThough choice. * fix One with the Multiverse * cleanup cards needing their own MageIdentifier * last couple of fixes * apply reviews for cleaner code. * some more cleanup
This commit is contained in:
parent
ba135abc78
commit
7c454fb24c
66 changed files with 1176 additions and 395 deletions
|
|
@ -2,6 +2,7 @@ package mage.util;
|
|||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import mage.ApprovingObject;
|
||||
import mage.MageIdentifier;
|
||||
import mage.MageObject;
|
||||
import mage.Mana;
|
||||
import mage.abilities.*;
|
||||
|
|
@ -147,7 +148,7 @@ public final class CardUtil {
|
|||
ability.addManaCostsToPay(adjustedCost);
|
||||
}
|
||||
|
||||
private static ManaCosts<ManaCost> adjustCost(ManaCosts<ManaCost> manaCosts, int reduceCount) {
|
||||
public static ManaCosts<ManaCost> adjustCost(ManaCosts<ManaCost> manaCosts, int reduceCount) {
|
||||
ManaCosts<ManaCost> newCost = new ManaCostsImpl<>();
|
||||
|
||||
// nothing to change
|
||||
|
|
@ -1447,8 +1448,8 @@ public final class CardUtil {
|
|||
Costs<Cost> additionalCostsLeft = leftHalfCard.getSpellAbility().getCosts();
|
||||
Costs<Cost> additionalCostsRight = rightHalfCard.getSpellAbility().getCosts();
|
||||
// set alternative cost and any additional cost
|
||||
player.setCastSourceIdWithAlternateMana(leftHalfCard.getId(), manaCost, additionalCostsLeft);
|
||||
player.setCastSourceIdWithAlternateMana(rightHalfCard.getId(), manaCost, additionalCostsRight);
|
||||
player.setCastSourceIdWithAlternateMana(leftHalfCard.getId(), manaCost, additionalCostsLeft, MageIdentifier.Default);
|
||||
player.setCastSourceIdWithAlternateMana(rightHalfCard.getId(), manaCost, additionalCostsRight, MageIdentifier.Default);
|
||||
}
|
||||
// allow the card to be cast
|
||||
game.getState().setValue("PlayFromNotOwnHandZone" + leftHalfCard.getId(), Boolean.TRUE);
|
||||
|
|
@ -1465,13 +1466,13 @@ public final class CardUtil {
|
|||
// get additional cost if any
|
||||
Costs<Cost> additionalCostsMDFCLeft = leftHalfCard.getSpellAbility().getCosts();
|
||||
// set alternative cost and any additional cost
|
||||
player.setCastSourceIdWithAlternateMana(leftHalfCard.getId(), manaCost, additionalCostsMDFCLeft);
|
||||
player.setCastSourceIdWithAlternateMana(leftHalfCard.getId(), manaCost, additionalCostsMDFCLeft, MageIdentifier.Default);
|
||||
}
|
||||
if (!rightHalfCard.isLand(game)) {
|
||||
// get additional cost if any
|
||||
Costs<Cost> additionalCostsMDFCRight = rightHalfCard.getSpellAbility().getCosts();
|
||||
// set alternative cost and any additional cost
|
||||
player.setCastSourceIdWithAlternateMana(rightHalfCard.getId(), manaCost, additionalCostsMDFCRight);
|
||||
player.setCastSourceIdWithAlternateMana(rightHalfCard.getId(), manaCost, additionalCostsMDFCRight, MageIdentifier.Default);
|
||||
}
|
||||
}
|
||||
// allow the card to be cast
|
||||
|
|
@ -1488,8 +1489,8 @@ public final class CardUtil {
|
|||
Costs<Cost> additionalCostsCreature = creatureCard.getSpellAbility().getCosts();
|
||||
Costs<Cost> additionalCostsSpellCard = spellCard.getSpellAbility().getCosts();
|
||||
// set alternative cost and any additional cost
|
||||
player.setCastSourceIdWithAlternateMana(creatureCard.getId(), manaCost, additionalCostsCreature);
|
||||
player.setCastSourceIdWithAlternateMana(spellCard.getId(), manaCost, additionalCostsSpellCard);
|
||||
player.setCastSourceIdWithAlternateMana(creatureCard.getId(), manaCost, additionalCostsCreature, MageIdentifier.Default);
|
||||
player.setCastSourceIdWithAlternateMana(spellCard.getId(), manaCost, additionalCostsSpellCard, MageIdentifier.Default);
|
||||
}
|
||||
// allow the card to be cast
|
||||
game.getState().setValue("PlayFromNotOwnHandZone" + creatureCard.getId(), Boolean.TRUE);
|
||||
|
|
@ -1500,7 +1501,7 @@ public final class CardUtil {
|
|||
if (manaCost != null) {
|
||||
// get additional cost if any
|
||||
Costs<Cost> additionalCostsNormalCard = card.getSpellAbility().getCosts();
|
||||
player.setCastSourceIdWithAlternateMana(card.getMainCard().getId(), manaCost, additionalCostsNormalCard);
|
||||
player.setCastSourceIdWithAlternateMana(card.getMainCard().getId(), manaCost, additionalCostsNormalCard, MageIdentifier.Default);
|
||||
}
|
||||
|
||||
// cast it
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue