mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 04:08:01 +00:00
- remove Keyword:CardManaCost when targeted card has no mana cost
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
package forge.game.ability.effects;
|
||||
|
||||
import com.google.common.base.Predicate;
|
||||
import com.google.common.collect.Iterables;
|
||||
import forge.GameCommand;
|
||||
import forge.card.CardType;
|
||||
import forge.game.Game;
|
||||
@@ -404,6 +406,17 @@ public class PumpEffect extends SpellAbilityEffect {
|
||||
// substitute specific tgtC mana cost for keyword placeholder CardManaCost
|
||||
if (sa.getParam("KW").contains("CardManaCost")) {
|
||||
String cost = tgtC.getManaCost().getShortString();
|
||||
Iterables.removeIf(keywords, new Predicate<String>() {
|
||||
@Override
|
||||
public boolean apply(String input) {
|
||||
if (input.contains("CardManaCost")) {
|
||||
if (tgtC.getManaCost().isNoCost()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
});
|
||||
for (int i = 0; i < keywords.size(); i++) {
|
||||
keywords.set(i, TextUtil.fastReplace(keywords.get(i), "CardManaCost", cost));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user