mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 03:08:02 +00:00
StaticAbilityContinuous support MayPlay altCost being additional using "RegularCost"
This commit is contained in:
@@ -937,25 +937,32 @@ public final class StaticAbilityContinuous {
|
|||||||
|
|
||||||
if (controllerMayPlay && (mayPlayLimit == null || stAb.getMayPlayTurn() < mayPlayLimit)) {
|
if (controllerMayPlay && (mayPlayLimit == null || stAb.getMayPlayTurn() < mayPlayLimit)) {
|
||||||
String mayPlayAltCost = mayPlayAltManaCost;
|
String mayPlayAltCost = mayPlayAltManaCost;
|
||||||
|
boolean additional = mayPlayAltCost.contains("RegularCost");
|
||||||
|
|
||||||
if (mayPlayAltCost != null && mayPlayAltCost.contains("ConvertedManaCost")) {
|
if (mayPlayAltCost != null) {
|
||||||
final String costcmc = Integer.toString(affectedCard.getCMC());
|
if (mayPlayAltCost.contains("ConvertedManaCost")) {
|
||||||
mayPlayAltCost = mayPlayAltCost.replace("ConvertedManaCost", costcmc);
|
final String costcmc = Integer.toString(affectedCard.getCMC());
|
||||||
|
mayPlayAltCost = mayPlayAltCost.replace("ConvertedManaCost", costcmc);
|
||||||
|
} else if (additional) {
|
||||||
|
final String regCost = affectedCard.getManaCost().getShortString();
|
||||||
|
mayPlayAltCost = mayPlayAltManaCost.replace("RegularCost", regCost);
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Player mayPlayController = params.containsKey("MayPlayPlayer") ?
|
Player mayPlayController = params.containsKey("MayPlayPlayer") ?
|
||||||
AbilityUtils.getDefinedPlayers(affectedCard, params.get("MayPlayPlayer"), stAb).get(0) :
|
AbilityUtils.getDefinedPlayers(affectedCard, params.get("MayPlayPlayer"), stAb).get(0) :
|
||||||
controller;
|
controller;
|
||||||
affectedCard.setMayPlay(mayPlayController, mayPlayWithoutManaCost,
|
affectedCard.setMayPlay(mayPlayController, mayPlayWithoutManaCost,
|
||||||
mayPlayAltCost != null ? new Cost(mayPlayAltCost, false) : null,
|
mayPlayAltCost != null ? new Cost(mayPlayAltCost, false) : null, additional, mayPlayWithFlash,
|
||||||
mayPlayWithFlash, mayPlayGrantZonePermissions, stAb);
|
mayPlayGrantZonePermissions, stAb);
|
||||||
|
|
||||||
// If the MayPlay effect only affected itself, check if it is in graveyard and give other player who cast Shaman's Trance MayPlay
|
// If the MayPlay effect only affected itself, check if it is in graveyard and give other player who cast Shaman's Trance MayPlay
|
||||||
if (stAb.hasParam("Affected") && stAb.getParam("Affected").equals("Card.Self") && affectedCard.isInZone(ZoneType.Graveyard)) {
|
if (stAb.hasParam("Affected") && stAb.getParam("Affected").equals("Card.Self") && affectedCard.isInZone(ZoneType.Graveyard)) {
|
||||||
for (final Player p : game.getPlayers()) {
|
for (final Player p : game.getPlayers()) {
|
||||||
if (p.hasKeyword("Shaman's Trance") && mayPlayController != p) {
|
if (p.hasKeyword("Shaman's Trance") && mayPlayController != p) {
|
||||||
affectedCard.setMayPlay(p, mayPlayWithoutManaCost,
|
affectedCard.setMayPlay(p, mayPlayWithoutManaCost,
|
||||||
mayPlayAltCost != null ? new Cost(mayPlayAltCost, false) : null,
|
mayPlayAltCost != null ? new Cost(mayPlayAltCost, false) : null, additional,
|
||||||
mayPlayWithFlash, mayPlayGrantZonePermissions, stAb);
|
mayPlayWithFlash, mayPlayGrantZonePermissions, stAb);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user