mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 19:28:01 +00:00
- Added Damping Sphere
This commit is contained in:
@@ -1,10 +1,14 @@
|
||||
package forge.game.replacement;
|
||||
|
||||
import forge.game.card.Card;
|
||||
import forge.game.card.CardFactoryUtil;
|
||||
import forge.game.spellability.SpellAbility;
|
||||
import forge.util.Expressions;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
/**
|
||||
* TODO: Write javadoc for this type.
|
||||
*
|
||||
@@ -37,6 +41,22 @@ public class ReplaceProduceMana extends ReplacementEffect {
|
||||
}
|
||||
}
|
||||
|
||||
if (hasParam("ManaAmount")) {
|
||||
String full = getParam("ManaAmount");
|
||||
String operator = full.substring(0, 2);
|
||||
String operand = full.substring(2);
|
||||
int intoperand = 0;
|
||||
try {
|
||||
intoperand = Integer.parseInt(operand);
|
||||
} catch (NumberFormatException e) {
|
||||
intoperand = CardFactoryUtil.xCount(getHostCard(), getHostCard().getSVar(operand));
|
||||
}
|
||||
int manaAmount = StringUtils.countMatches((String) runParams.get("Mana"), " ") + 1;
|
||||
if (!Expressions.compare(manaAmount, operator, intoperand)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (this.getMapParams().containsKey("ValidCard")) {
|
||||
if (!matchesValid(runParams.get("Affected"), this.getMapParams().get("ValidCard").split(","), this.getHostCard())) {
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user