Fix Embodiment of Agonies counting Asmoranomardicadaistinaculdacar (#6388)

This commit is contained in:
tool4ever
2024-10-20 12:02:48 +02:00
committed by GitHub
parent 42893234b3
commit 98c0959d8f
8 changed files with 13 additions and 30 deletions

View File

@@ -2740,6 +2740,7 @@ public class AbilityUtils {
for (Card card : cards) {
manaCost.add(card.getManaCost().getShortString());
}
manaCost.remove(ManaCost.NO_COST.getShortString());
return doXMath(manaCost.size(), expr, c, ctb);
}

View File

@@ -389,9 +389,6 @@ public class PlayEffect extends SpellAbilityEffect {
abCost = Iterables.find(tgtCard.getNonManaAbilities(), s -> s.isKeyword(Keyword.SUSPEND)).getPayCosts();
} else {
if (cost.contains("ConvertedManaCost")) {
if (unpayableCost) {
continue;
}
final String costcmc = Integer.toString(tgtCard.getCMC());
cost = cost.replace("ConvertedManaCost", costcmc);
}

View File

@@ -474,15 +474,6 @@ public class PumpEffect extends SpellAbilityEffect {
List<String> affectedKeywords = Lists.newArrayList(keywords);
if (!affectedKeywords.isEmpty()) {
Iterables.removeIf(affectedKeywords, input -> {
if (input.contains("CardManaCost")) {
if (tgtC.getManaCost().isNoCost()) {
return true;
}
}
return false;
});
affectedKeywords = Lists.transform(affectedKeywords, input -> {
if (input.contains("CardManaCost")) {
input = input.replace("CardManaCost", tgtC.getManaCost().getShortString());

View File

@@ -1462,7 +1462,7 @@ public class CardFactoryUtil {
final String trigStr = "Mode$ Exiled | ValidCard$ Card.Self | Madness$ True | Secondary$ True"
+ " | TriggerDescription$ Play Madness " + ManaCostParser.parse(manacost) + " - " + card.getName();
final String playMadnessStr = "DB$ Play | Defined$ Self | PlayCost$ " + manacost +
final String playMadnessStr = "DB$ Play | Defined$ Self | ValidSA$ Spell | PlayCost$ " + manacost +
" | ConditionDefined$ Self | ConditionPresent$ Card.StrictlySelf+inZoneExile" +
" | Optional$ True | RememberPlayed$ True | Madness$ True";

View File

@@ -23,7 +23,6 @@ import forge.game.card.CardCopyService;
import org.apache.commons.lang3.ObjectUtils;
import forge.card.CardStateName;
import forge.card.mana.ManaCost;
import forge.game.Game;
import forge.game.ability.AbilityKey;
import forge.game.card.Card;
@@ -71,6 +70,11 @@ public abstract class Spell extends SpellAbility implements java.io.Serializable
return false;
}
// CR 118.6 cost is unpayable
if (getPayCosts().hasManaCost() && getPayCosts().getCostMana().getMana().isNoCost()) {
return false;
}
Player activator = this.getActivatingPlayer();
if (activator == null) {
activator = card.getController();
@@ -84,9 +88,6 @@ public abstract class Spell extends SpellAbility implements java.io.Serializable
return false;
}
// Save the original cost and the face down info for a later check since the LKI copy will overwrite them
ManaCost origCost = card.getState(card.isFaceDown() ? CardStateName.Original : card.getCurrentStateName()).getManaCost();
// do performanceMode only for cases where the activator is different than controller
if (!Spell.performanceMode && !card.getController().equals(activator)) {
// always make a lki copy in this case?
@@ -100,13 +101,6 @@ public abstract class Spell extends SpellAbility implements java.io.Serializable
return false;
}
// for uncastables like lotus bloom, check if manaCost is blank (except for morph spells)
// but ignore if it comes from PlayEffect
if (!isCastFaceDown() && !isCastFromPlayEffect()
&& isBasicSpell() && origCost.isNoCost()) {
return false;
}
if (!CostPayment.canPayAdditionalCosts(this.getPayCosts(), this, false)) {
return false;
}

View File

@@ -731,9 +731,6 @@ public final class StaticAbilityContinuous {
final List<String> extraKeywords = Lists.newArrayList();
Iterables.removeIf(newKeywords, input -> {
if (input.contains("CardManaCost") && affectedCard.getManaCost().isNoCost()) {
return true;
}
// replace one Keyword with list of keywords
if (input.startsWith("Protection") && input.contains("CardColors")) {
for (Byte color : affectedCard.getColor()) {