mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 04:38:00 +00:00
Fix Embodiment of Agonies counting Asmoranomardicadaistinaculdacar (#6388)
This commit is contained in:
@@ -42,7 +42,7 @@ public final class ManaCost implements Comparable<ManaCost>, Iterable<ManaCostSh
|
||||
|
||||
private List<ManaCostShard> shards;
|
||||
private final int genericCost;
|
||||
private final boolean hasNoCost; // lands cost
|
||||
private boolean hasNoCost = true; // lands cost
|
||||
private String stringValue; // precalculated for toString;
|
||||
|
||||
private Float compareWeight = null;
|
||||
@@ -92,8 +92,8 @@ public final class ManaCost implements Comparable<ManaCost>, Iterable<ManaCostSh
|
||||
*/
|
||||
public ManaCost(final IParserManaCost parser) {
|
||||
final List<ManaCostShard> shardsTemp = Lists.newArrayList();
|
||||
this.hasNoCost = false;
|
||||
while (parser.hasNext()) {
|
||||
this.hasNoCost = false;
|
||||
final ManaCostShard shard = parser.next();
|
||||
if (shard != null && shard != ManaCostShard.GENERIC) {
|
||||
shardsTemp.add(shard);
|
||||
@@ -281,6 +281,9 @@ public final class ManaCost implements Comparable<ManaCost>, Iterable<ManaCostSh
|
||||
* @return
|
||||
*/
|
||||
public String getShortString() {
|
||||
if (isNoCost()) {
|
||||
return "-1";
|
||||
}
|
||||
StringBuilder sb = new StringBuilder();
|
||||
int generic = getGenericCost();
|
||||
if (this.isZero()) {
|
||||
|
||||
@@ -54,7 +54,7 @@ public class ManaCostParser implements IParserManaCost {
|
||||
*/
|
||||
@Override
|
||||
public final boolean hasNext() {
|
||||
return this.nextToken < this.cost.length;
|
||||
return this.nextToken < this.cost.length && !this.cost[this.nextToken].equals("-1");
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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());
|
||||
|
||||
@@ -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";
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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()) {
|
||||
|
||||
Reference in New Issue
Block a user