cleanup meetsManaRestrictions

This commit is contained in:
Hans Mackowiak
2024-01-21 11:49:47 +01:00
committed by Chris H
parent afee45ca5a
commit ac12fa5b6f
14 changed files with 22 additions and 43 deletions

View File

@@ -221,6 +221,8 @@ public class ForgeScript {
return sa.isCycling();
} else if (property.equals("Dash")) {
return sa.isDash();
} else if (property.equals("Disturb")) {
return sa.isDisturb();
} else if (property.equals("Flashback")) {
return sa.isFlashBackAbility();
} else if (property.equals("Jumpstart")) {
@@ -235,6 +237,10 @@ public class ForgeScript {
return sa.isAftermath();
} else if (property.equals("MorphUp")) {
return sa.isMorphUp();
} else if (property.equals("ManifestUp")) {
return sa.isManifestUp();
} else if (property.equals("isCastFaceDown")) {
return sa.isCastFaceDown();
} else if (property.equals("Modular")) {
return sa.hasParam("Modular");
} else if (property.equals("Equip")) {
@@ -264,6 +270,8 @@ public class ForgeScript {
if (sa.getChapter() == sa.getHostCard().getCounters(CounterEnumType.LORE)) {
return false;
}
} else if (property.equals("CumulativeUpkeep")) {
return sa.isCumulativeUpkeep();
} else if (property.equals("LastChapter")) {
return sa.isLastChapter();
} else if (property.startsWith("ManaSpent")) {

View File

@@ -7053,6 +7053,7 @@ public class Card extends GameEntity implements Comparable<Card>, IHasSVars {
if (sa.isCastFaceDown()) {
turnFaceDown(true);
CardFactoryUtil.setFaceDownState(this, sa);
}
}

View File

@@ -111,7 +111,6 @@ public class CardFactoryUtil {
if (!hostCard.isFaceDown()) {
hostCard.setOriginalStateAsFaceDown();
}
CardFactoryUtil.setFaceDownState(hostCard, this);
final Game game = hostCard.getGame();
CardZoneTable table = new CardZoneTable(game.copyLastStateBattlefield(), game.copyLastStateBattlefield());
@@ -4058,6 +4057,7 @@ public class CardFactoryUtil {
faceDown.setType(new CardType(Arrays.asList(sa.getParam("FaceDownSetType").split(" & ")), false));
}
if (sa.hasParam("FaceDownKeyword")) {
faceDown.setIntrinsicKeywords(Lists.newArrayList(), false);
faceDown.addIntrinsicKeywords(Arrays.asList(sa.getParam("FaceDownKeyword").split(" & ")));
}

View File

@@ -366,17 +366,6 @@ public class AbilityManaPart implements java.io.Serializable {
// Loop over restrictions
for (String restriction : restrictions.split(",")) {
if (restriction.equals("nonSpell")) {
return !sa.isSpell();
}
if (restriction.equals("CumulativeUpkeep")) {
if (sa.isCumulativeupkeep()) {
return true;
}
continue;
}
if (restriction.startsWith("CostContains")) {
if (restriction.endsWith("X") && sa.costHasManaX()) {
return true;
@@ -387,21 +376,6 @@ public class AbilityManaPart implements java.io.Serializable {
continue;
}
if (restriction.equals("Disturb")) {
if (sa.isDisturb()) {
return true;
}
continue;
}
if (restriction.equals("MorphOrManifest")) {
if ((sa.isSpell() && sa.getHostCard().isCreature() && sa.isCastFaceDown())
|| sa.isManifestUp() || sa.isMorphUp()) {
return true;
}
continue;
}
//handled in meetsManaShardRestrictions
if (restriction.equals("CantPayGenericCosts")) {
return true;
@@ -422,10 +396,6 @@ public class AbilityManaPart implements java.io.Serializable {
}
}
if (restriction.equals("CantCastNonArtifactSpells")) {
return !sa.isSpell() || sa.getHostCard().isArtifact();
}
// the payment is for a resolving SA, currently no other restrictions would allow that
if (getSourceCard().getGame().getStack().getInstanceMatchingSpellAbilityID(sa.getRootAbility()) != null) {
return false;

View File

@@ -557,7 +557,7 @@ public abstract class SpellAbility extends CardTraitBase implements ISpellAbilit
return this.hasParam("Ninjutsu");
}
public boolean isCumulativeupkeep() {
public boolean isCumulativeUpkeep() {
return hasParam("CumulativeUpkeep");
}

View File

@@ -2,8 +2,8 @@ Name:Adarkar Unicorn
ManaCost:1 W W
Types:Creature Unicorn
PT:2/2
A:AB$ Mana | Cost$ T | Produced$ C U | RestrictValid$ CumulativeUpkeep | SpellDescription$ Add {C}{U}. Spend this mana only to pay cumulative upkeep costs.
A:AB$ Mana | Cost$ T | Produced$ U | RestrictValid$ CumulativeUpkeep | SpellDescription$ Add {U}. Spend this mana only to pay cumulative upkeep costs.
A:AB$ Mana | Cost$ T | Produced$ C U | RestrictValid$ Trigger.CumulativeUpkeep | SpellDescription$ Add {C}{U}. Spend this mana only to pay cumulative upkeep costs.
A:AB$ Mana | Cost$ T | Produced$ U | RestrictValid$ Trigger.CumulativeUpkeep | SpellDescription$ Add {U}. Spend this mana only to pay cumulative upkeep costs.
AI:RemoveDeck:All
AI:RemoveDeck:Random
Oracle:{T}: Add {U} or {C}{U}. Spend this mana only to pay cumulative upkeep costs.

View File

@@ -3,7 +3,7 @@ ManaCost:2 G U
Types:Creature Human Artificer
PT:3/4
S:Mode$ Continuous | Affected$ Creature.YouCtrl | AddAbility$ AnyMana | Description$ Creatures you control have "{T}: add {C}. This mana can't be spent to cast a nonartifact spell."
SVar:AnyMana:AB$ Mana | Cost$ T | Produced$ C | Amount$ 1 | RestrictValid$ CantCastNonArtifactSpells | SpellDescription$ add {C}. This mana can't be spent to cast a nonartifact spell.
SVar:AnyMana:AB$ Mana | Cost$ T | Produced$ C | Amount$ 1 | RestrictValid$ !Spell.!Artifact | SpellDescription$ add {C}. This mana can't be spent to cast a nonartifact spell.
T:Mode$ SpellCast | ValidCard$ Artifact.cmcGE6 | ValidActivatingPlayer$ You | TriggerZones$ Battlefield | Execute$ DBDraw | TriggerDescription$ Whenever you cast an artifact spell with mana value 6 or greater, draw a card.
SVar:DBDraw:DB$ Draw
DeckNeeds:Type$Artifact

View File

@@ -4,7 +4,7 @@ Types:Legendary Artifact Creature Robot
PT:3/4
K:More Than Meets the Eye:3 U
K:Flying
A:AB$ Mana | Cost$ RemoveAnyCounter<X1+/P1P1/Artifact.YouCtrl/among artifacts you control> | XMin$ 1 | ValidTgts$ Player | Produced$ C | Amount$ X | AmountDesc$ for each counter removed | RestrictValid$ CantCastNonArtifactSpells | SubAbility$ DBConvert | SpellDescription$ Target player adds that much {C}. This mana can't be spent to cast nonartifact spells.
A:AB$ Mana | Cost$ RemoveAnyCounter<X1+/P1P1/Artifact.YouCtrl/among artifacts you control> | XMin$ 1 | ValidTgts$ Player | Produced$ C | Amount$ X | AmountDesc$ for each counter removed | RestrictValid$ !Spell.!Artifact | SubAbility$ DBConvert | SpellDescription$ Target player adds that much {C}. This mana can't be spent to cast nonartifact spells.
SVar:DBConvert:DB$ SetState | Mode$ Transform | StackDescription$ SpellDescription | SpellDescription$ Convert NICKNAME.
SVar:X:Count$xPaid
AlternateMode:DoubleFaced

View File

@@ -4,7 +4,7 @@ Types:Legendary Artifact Creature Golem
PT:*/*
S:Mode$ Continuous | EffectZone$ All | CharacteristicDefining$ True | SetPower$ X | SetToughness$ X | Description$ CARDNAME's power and toughness are each equal to the greatest mana value among artifacts you control.
T:Mode$ Phase | Phase$ Upkeep | ValidPlayer$ You | Execute$ ArtifactMana | TriggerZones$ Battlefield | TriggerDescription$ At the beginning of your upkeep, add {C} for each artifact you control. This mana can't be spent to cast nonartifact spells. Until end of turn, you don't lose this mana as steps and phases end.
SVar:ArtifactMana:DB$ Mana | Produced$ C | Amount$ Y | PersistentMana$ True | RestrictValid$ CantCastNonArtifactSpells
SVar:ArtifactMana:DB$ Mana | Produced$ C | Amount$ Y | PersistentMana$ True | RestrictValid$ !Spell.!Artifact
SVar:X:Count$Valid Artifact.YouCtrl$GreatestCMC
SVar:Y:Count$Valid Artifact.YouCtrl
SVar:BuffedBy:Artifact

View File

@@ -3,8 +3,8 @@ ManaCost:2 U
Types:Enchantment
K:Cumulative upkeep:U
T:Mode$ TapsForMana | ValidCard$ Island | Execute$ TrigMana | Static$ True | TriggerZones$ Battlefield | OptionalDecider$ TriggeredCardController | TriggerDescription$ Whenever an Island is tapped for mana, its controller may add an additional {U}. If that Island is snow, its controller may add an additional {U}{U} instead. Spend this mana only to pay cumulative upkeep costs.
SVar:TrigMana:DB$ Mana | Produced$ U | Amount$ 1 | Defined$ TriggeredCardController | RestrictValid$ CumulativeUpkeep | ConditionDefined$ TriggeredCard | ConditionPresent$ Land.Snow | ConditionCompare$ EQ0 | SubAbility$ DBMana
SVar:DBMana:DB$ Mana | Produced$ U | Amount$ 2 | Defined$ TriggeredCardController | RestrictValid$ CumulativeUpkeep | ConditionDefined$ TriggeredCard | ConditionPresent$ Land.Snow | ConditionCompare$ GE1
SVar:TrigMana:DB$ Mana | Produced$ U | Amount$ 1 | Defined$ TriggeredCardController | RestrictValid$ Trigger.CumulativeUpkeep | ConditionDefined$ TriggeredCard | ConditionPresent$ Land.Snow | ConditionCompare$ EQ0 | SubAbility$ DBMana
SVar:DBMana:DB$ Mana | Produced$ U | Amount$ 2 | Defined$ TriggeredCardController | RestrictValid$ Trigger.CumulativeUpkeep | ConditionDefined$ TriggeredCard | ConditionPresent$ Land.Snow | ConditionCompare$ GE1
AI:RemoveDeck:Random
AI:RemoveDeck:All
Oracle:Cumulative upkeep {U} (At the beginning of your upkeep, put an age counter on this permanent, then sacrifice it unless you pay its upkeep cost for each age counter on it.)\nWhenever an Island is tapped for mana, its controller may add an additional {U}. If that Island is snow, its controller may add an additional {U}{U} instead. Spend this mana only to pay cumulative upkeep costs.

View File

@@ -5,7 +5,7 @@ T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.S
SVar:TrigCharm:DB$ Charm | Choices$ DBDraw,DBPump
SVar:DBDraw:DB$ Draw | Defined$ You | NumCards$ 2 | SpellDescription$ Draw two cards.
SVar:DBPump:DB$ Pump | IsCurse$ True | ValidTgts$ Creature | TgtPrompt$ Select target creature | NumAtt$ -5 | NumDef$ -5 | SpellDescription$ Target creature gets -5/-5 until end of turn.
A:AB$ Mana | Cost$ T | Produced$ C | Amount$ 2 | RestrictValid$ CantCastNonArtifactSpells | SpellDescription$ Add {C}{C}. This mana can't be spent to cast nonartifact spells.
A:AB$ Mana | Cost$ T | Produced$ C | Amount$ 2 | RestrictValid$ !Spell.!Artifact | SpellDescription$ Add {C}{C}. This mana can't be spent to cast nonartifact spells.
DeckHints:Name$Urza, Lord Protector
MeldPair:Urza, Lord Protector
AlternateMode:Meld

View File

@@ -2,6 +2,6 @@ Name:Thran Turbine
ManaCost:1
Types:Artifact
T:Mode$ Phase | Phase$ Upkeep | ValidPlayer$ You | OptionalDecider$ You | TriggerZones$ Battlefield | Execute$ DBMana | TriggerDescription$ At the beginning of your upkeep, you may add {C}{C}. You can't spend this mana to cast spells.
SVar:DBMana:DB$ Mana | Amount$ 2 | Produced$ C | RestrictValid$ nonSpell
SVar:DBMana:DB$ Mana | Amount$ 2 | Produced$ C | RestrictValid$ !Spell
AI:RemoveDeck:Random
Oracle:At the beginning of your upkeep, you may add {C}{C}. You can't spend this mana to cast spells.

View File

@@ -2,7 +2,7 @@ Name:Unblinking Observer
ManaCost:1 U
Types:Creature Homunculus
PT:2/1
A:AB$ Mana | Cost$ T | Produced$ U | RestrictValid$ Disturb,Spell.Instant,Spell.Sorcery | SpellDescription$ Add {U}. Spend this mana only to pay a disturb cost or cast an instant or sorcery spell.
A:AB$ Mana | Cost$ T | Produced$ U | RestrictValid$ Spell.Disturb,Spell.Instant,Spell.Sorcery | SpellDescription$ Add {U}. Spend this mana only to pay a disturb cost or cast an instant or sorcery spell.
DeckNeeds:Type$Instant|Sorcery
DeckHints:Keyword$Disturb
Oracle:{T}: Add {U}. Spend this mana only to pay a disturb cost or cast an instant or sorcery spell.

View File

@@ -2,6 +2,6 @@ Name:Powerstone token
ManaCost:no cost
Types:Artifact Powerstone
Colors:colorless
A:AB$ Mana | Cost$ T | Produced$ C | RestrictValid$ CantCastNonArtifactSpells | SpellDescription$ Add {C}. This mana can't be spent to cast a nonartifact spell.
A:AB$ Mana | Cost$ T | Produced$ C | RestrictValid$ !Spell.!Artifact | SpellDescription$ Add {C}. This mana can't be spent to cast a nonartifact spell.
Oracle:{T}: Add {C}. This mana can't be spent to cast a nonartifact spell.