From 566603cac159619c4bb128387b8748dae58f0eb2 Mon Sep 17 00:00:00 2001 From: Northmoc Date: Fri, 15 Apr 2022 08:35:02 -0400 Subject: [PATCH 1/5] maestros_ascendancy.txt --- forge-gui/res/cardsfolder/upcoming/maestros_ascendancy.txt | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 forge-gui/res/cardsfolder/upcoming/maestros_ascendancy.txt diff --git a/forge-gui/res/cardsfolder/upcoming/maestros_ascendancy.txt b/forge-gui/res/cardsfolder/upcoming/maestros_ascendancy.txt new file mode 100644 index 00000000000..7266df0845a --- /dev/null +++ b/forge-gui/res/cardsfolder/upcoming/maestros_ascendancy.txt @@ -0,0 +1,7 @@ +Name:Maestros Ascendancy +ManaCost:U B R +Types:Enchantment +S:Mode$ Continuous | Affected$ Instant.YouCtrl,Sorcery.YouCtrl | Condition$ PlayerTurn | MayPlay$ True | MayPlayAdditionalCost$ Sac<1/Creature> | MayPlayLimit$ 1 | EffectZone$ Battlefield | AffectedZone$ Graveyard | Description$ Once during each of your turns, you may cast an instant or sorcery spell from your graveyard by sacrificing a creature in addition to paying its other costs. If a spell cast this way would be put into your graveyard, exile it instead. +R:Event$ Moved | ValidLKI$ Card.CastSa Spell.MayPlaySource | Origin$ Stack | Destination$ Graveyard | ReplaceWith$ MoveExile +SVar:MoveExile:DB$ ChangeZone | Defined$ ReplacedCard | Origin$ Stack | Destination$ Exile +Oracle:Once during each of your turns, you may cast an instant or sorcery spell from your graveyard by sacrificing a creature in addition to paying its other costs. If a spell cast this way would be put into your graveyard, exile it instead. From 2f3fd97a9c2714541311b8eaaf441a81f7a7c2c0 Mon Sep 17 00:00:00 2001 From: Northmoc Date: Fri, 15 Apr 2022 12:08:30 -0400 Subject: [PATCH 2/5] maestros_ascendancy.txt better --- forge-gui/res/cardsfolder/upcoming/maestros_ascendancy.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/forge-gui/res/cardsfolder/upcoming/maestros_ascendancy.txt b/forge-gui/res/cardsfolder/upcoming/maestros_ascendancy.txt index 7266df0845a..76b886fb25e 100644 --- a/forge-gui/res/cardsfolder/upcoming/maestros_ascendancy.txt +++ b/forge-gui/res/cardsfolder/upcoming/maestros_ascendancy.txt @@ -1,7 +1,7 @@ Name:Maestros Ascendancy ManaCost:U B R Types:Enchantment -S:Mode$ Continuous | Affected$ Instant.YouCtrl,Sorcery.YouCtrl | Condition$ PlayerTurn | MayPlay$ True | MayPlayAdditionalCost$ Sac<1/Creature> | MayPlayLimit$ 1 | EffectZone$ Battlefield | AffectedZone$ Graveyard | Description$ Once during each of your turns, you may cast an instant or sorcery spell from your graveyard by sacrificing a creature in addition to paying its other costs. If a spell cast this way would be put into your graveyard, exile it instead. +S:Mode$ Continuous | Affected$ Instant.YouCtrl,Sorcery.YouCtrl | Condition$ PlayerTurn | MayPlay$ True | MayPlayAltManaCost$ RegularCost Sac<1/Creature> | MayPlayLimit$ 1 | EffectZone$ Battlefield | AffectedZone$ Graveyard | Description$ Once during each of your turns, you may cast an instant or sorcery spell from your graveyard by sacrificing a creature in addition to paying its other costs. If a spell cast this way would be put into your graveyard, exile it instead. R:Event$ Moved | ValidLKI$ Card.CastSa Spell.MayPlaySource | Origin$ Stack | Destination$ Graveyard | ReplaceWith$ MoveExile SVar:MoveExile:DB$ ChangeZone | Defined$ ReplacedCard | Origin$ Stack | Destination$ Exile Oracle:Once during each of your turns, you may cast an instant or sorcery spell from your graveyard by sacrificing a creature in addition to paying its other costs. If a spell cast this way would be put into your graveyard, exile it instead. From f747176d7e163872b9c8a1f80d22d885c83067b5 Mon Sep 17 00:00:00 2001 From: Northmoc Date: Fri, 15 Apr 2022 12:14:13 -0400 Subject: [PATCH 3/5] CardPlayOption updates for altIsAdditional, prompt --- .../java/forge/game/card/CardPlayOption.java | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/forge-game/src/main/java/forge/game/card/CardPlayOption.java b/forge-game/src/main/java/forge/game/card/CardPlayOption.java index 5c7fa3ebb86..4a58e153557 100644 --- a/forge-game/src/main/java/forge/game/card/CardPlayOption.java +++ b/forge-game/src/main/java/forge/game/card/CardPlayOption.java @@ -20,11 +20,12 @@ public final class CardPlayOption { private final boolean withFlash; private final boolean grantsZonePermissions; private final Cost altManaCost; + private final boolean altIsAdditional; - public CardPlayOption(final Player player, final StaticAbility sta, final boolean withoutManaCost, final Cost altManaCost, final boolean withFlash, final boolean grantZonePermissions) { - this(player, sta, withoutManaCost ? PayManaCost.NO : PayManaCost.YES, altManaCost, withFlash, grantZonePermissions); + public CardPlayOption(final Player player, final StaticAbility sta, final boolean withoutManaCost, final Cost altManaCost, final boolean altIsAdditional, final boolean withFlash, final boolean grantZonePermissions) { + this(player, sta, withoutManaCost ? PayManaCost.NO : PayManaCost.YES, altManaCost, altIsAdditional, withFlash, grantZonePermissions); } - private CardPlayOption(final Player player, final StaticAbility sta, final PayManaCost payManaCost, final Cost altManaCost, final boolean withFlash, + private CardPlayOption(final Player player, final StaticAbility sta, final PayManaCost payManaCost, final Cost altManaCost, final boolean altIsAdditional, final boolean withFlash, final boolean grantZonePermissions) { this.player = player; this.sta = sta; @@ -32,6 +33,7 @@ public final class CardPlayOption { this.withFlash = withFlash; this.grantsZonePermissions = grantZonePermissions; this.altManaCost = altManaCost; + this.altIsAdditional = altIsAdditional; } @@ -86,9 +88,14 @@ public final class CardPlayOption { switch (getPayManaCost()) { case YES: if (altManaCost != null) { - String insteadCost = getFormattedAltManaCost(); - insteadCost = insteadCost.replace("Pay ",""); - sb.append(" (by paying ").append(insteadCost).append(" instead of paying its mana cost"); + if (altIsAdditional) { + String desc = sta.getParam("Description"); + sb.append(" (").append(desc, desc.indexOf("by "), desc.indexOf(".")); + } else { + String insteadCost = getFormattedAltManaCost(); + insteadCost = insteadCost.replace("Pay ",""); + sb.append(" (by paying ").append(insteadCost).append(" instead of paying its mana cost"); + } if (isWithFlash()) { sb.append(" and as though it has flash"); } From 0a1a15ae896f33e01bdd30c4d9f56e0cfdb4e5c7 Mon Sep 17 00:00:00 2001 From: Northmoc Date: Fri, 15 Apr 2022 12:15:08 -0400 Subject: [PATCH 4/5] StaticAbilityContinuous support MayPlay altCost being additional using "RegularCost" --- .../StaticAbilityContinuous.java | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/forge-game/src/main/java/forge/game/staticability/StaticAbilityContinuous.java b/forge-game/src/main/java/forge/game/staticability/StaticAbilityContinuous.java index 2460aad3bf6..c447e44b99e 100644 --- a/forge-game/src/main/java/forge/game/staticability/StaticAbilityContinuous.java +++ b/forge-game/src/main/java/forge/game/staticability/StaticAbilityContinuous.java @@ -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); } } From 45f3aa2a94aac20468ee9782340fd420173da3fc Mon Sep 17 00:00:00 2001 From: Northmoc Date: Fri, 15 Apr 2022 12:15:48 -0400 Subject: [PATCH 5/5] Card.java > setMayPlay : add altIsAdditional --- forge-game/src/main/java/forge/game/card/Card.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/forge-game/src/main/java/forge/game/card/Card.java b/forge-game/src/main/java/forge/game/card/Card.java index b138ec0061c..d5409793e72 100644 --- a/forge-game/src/main/java/forge/game/card/Card.java +++ b/forge-game/src/main/java/forge/game/card/Card.java @@ -3358,8 +3358,8 @@ public class Card extends GameEntity implements Comparable, IHasSVars { } return result; } - public final void setMayPlay(final Player player, final boolean withoutManaCost, final Cost altManaCost, final boolean withFlash, final boolean grantZonePermissions, final StaticAbility sta) { - this.mayPlay.put(sta, new CardPlayOption(player, sta, withoutManaCost, altManaCost, withFlash, grantZonePermissions)); + public final void setMayPlay(final Player player, final boolean withoutManaCost, final Cost altManaCost, final boolean altIsAdditional, final boolean withFlash, final boolean grantZonePermissions, final StaticAbility sta) { + this.mayPlay.put(sta, new CardPlayOption(player, sta, withoutManaCost, altManaCost, altIsAdditional, withFlash, grantZonePermissions)); this.updateMayPlay(); } public final void removeMayPlay(final StaticAbility sta) {