mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-15 02:08:00 +00:00
Merge pull request #45 from Northmoc/snc_ma
SNC: Maestros Ascendancy and support
This commit is contained in:
@@ -3360,8 +3360,8 @@ public class Card extends GameEntity implements Comparable<Card>, 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) {
|
||||
|
||||
@@ -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");
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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 | 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.
|
||||
Reference in New Issue
Block a user