mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-16 18:58:00 +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)) {
|
||||
String mayPlayAltCost = mayPlayAltManaCost;
|
||||
boolean additional = mayPlayAltCost.contains("RegularCost");
|
||||
|
||||
if (mayPlayAltCost != null && mayPlayAltCost.contains("ConvertedManaCost")) {
|
||||
final String costcmc = Integer.toString(affectedCard.getCMC());
|
||||
mayPlayAltCost = mayPlayAltCost.replace("ConvertedManaCost", costcmc);
|
||||
if (mayPlayAltCost != null) {
|
||||
if (mayPlayAltCost.contains("ConvertedManaCost")) {
|
||||
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") ?
|
||||
AbilityUtils.getDefinedPlayers(affectedCard, params.get("MayPlayPlayer"), stAb).get(0) :
|
||||
controller;
|
||||
affectedCard.setMayPlay(mayPlayController, mayPlayWithoutManaCost,
|
||||
mayPlayAltCost != null ? new Cost(mayPlayAltCost, false) : null,
|
||||
mayPlayWithFlash, mayPlayGrantZonePermissions, stAb);
|
||||
mayPlayAltCost != null ? new Cost(mayPlayAltCost, false) : null, additional, mayPlayWithFlash,
|
||||
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 (stAb.hasParam("Affected") && stAb.getParam("Affected").equals("Card.Self") && affectedCard.isInZone(ZoneType.Graveyard)) {
|
||||
for (final Player p : game.getPlayers()) {
|
||||
if (p.hasKeyword("Shaman's Trance") && mayPlayController != p) {
|
||||
affectedCard.setMayPlay(p, mayPlayWithoutManaCost,
|
||||
mayPlayAltCost != null ? new Cost(mayPlayAltCost, false) : null,
|
||||
mayPlayAltCost != null ? new Cost(mayPlayAltCost, false) : null, additional,
|
||||
mayPlayWithFlash, mayPlayGrantZonePermissions, stAb);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user