mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 11:48:02 +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;
|
||||
|
||||
11
forge-gui/res/cardsfolder/upcoming/damping_sphere.txt
Normal file
11
forge-gui/res/cardsfolder/upcoming/damping_sphere.txt
Normal file
@@ -0,0 +1,11 @@
|
||||
Name:Damping Sphere
|
||||
ManaCost:2
|
||||
Types:Artifact
|
||||
R:Event$ ProduceMana | ActiveZones$ Battlefield | ValidCard$ Land | ManaAmount$ GE2 | ManaReplacement$ ProduceC | Description$ If a land is tapped for mana, it produces {C} instead of any other type and amount.
|
||||
SVar:ProduceC:Any->C
|
||||
S:Mode$ RaiseCost | Activator$ Player | Type$ Spell | Amount$ X | AffectedAmount$ True | Description$ Each spell a player casts costs {1} more to cast for each other spell that player has cast this turn.
|
||||
SVar:X:Count$ThisTurnCast_Card.YouCtrl
|
||||
SVar:RemAIDeck:True
|
||||
SVar:NonStackingEffect:True
|
||||
SVar:Picture:http://www.wizards.com/global/images/magic/general/damping_sphere.jpg
|
||||
Oracle:If a land is tapped for two or more mana, it produces {C} instead of any other type and amount.\nEach spell a player casts costs {1} more to cast for each other spell that player has cast this turn.
|
||||
Reference in New Issue
Block a user