diff --git a/.gitattributes b/.gitattributes index 0e66b9eb5fe..62004ac2788 100644 --- a/.gitattributes +++ b/.gitattributes @@ -4801,6 +4801,7 @@ forge-gui/res/cardsfolder/e/epiphany_storm.txt -text forge-gui/res/cardsfolder/e/epochrasite.txt -text forge-gui/res/cardsfolder/e/equal_treatment.txt -text forge-gui/res/cardsfolder/e/equilibrium.txt svneol=native#text/plain +forge-gui/res/cardsfolder/e/equipoise.txt -text forge-gui/res/cardsfolder/e/eradicate.txt svneol=native#text/plain forge-gui/res/cardsfolder/e/erase.txt svneol=native#text/plain forge-gui/res/cardsfolder/e/erayo_soratami_ascendant_erayos_essence.txt -text diff --git a/forge-game/src/main/java/forge/game/ability/effects/ChooseCardEffect.java b/forge-game/src/main/java/forge/game/ability/effects/ChooseCardEffect.java index 4916e23cc39..fb8f07c2698 100644 --- a/forge-game/src/main/java/forge/game/ability/effects/ChooseCardEffect.java +++ b/forge-game/src/main/java/forge/game/ability/effects/ChooseCardEffect.java @@ -59,6 +59,10 @@ public class ChooseCardEffect extends SpellAbilityEffect { final String numericAmount = sa.getParamOrDefault("Amount", "1"); final int validAmount = StringUtils.isNumeric(numericAmount) ? Integer.parseInt(numericAmount) : CardFactoryUtil.xCount(host, host.getSVar(numericAmount)); + if (validAmount <= 0) { + return; + } + for (final Player p : tgtPlayers) { if (sa.hasParam("EachBasicType")) { // Get all lands, diff --git a/forge-game/src/main/java/forge/game/ability/effects/CleanUpEffect.java b/forge-game/src/main/java/forge/game/ability/effects/CleanUpEffect.java index 99e46dfb2cd..2b09dc636a9 100644 --- a/forge-game/src/main/java/forge/game/ability/effects/CleanUpEffect.java +++ b/forge-game/src/main/java/forge/game/ability/effects/CleanUpEffect.java @@ -38,6 +38,9 @@ public class CleanUpEffect extends SpellAbilityEffect { if (sa.hasParam("ClearCoinFlips")) { source.clearFlipResult(); } + if (sa.hasParam("ClearChosenCard")) { + source.getChosenCard().clear(); + } } } diff --git a/forge-gui/res/cardsfolder/e/equipoise.txt b/forge-gui/res/cardsfolder/e/equipoise.txt new file mode 100644 index 00000000000..698e0950e1b --- /dev/null +++ b/forge-gui/res/cardsfolder/e/equipoise.txt @@ -0,0 +1,26 @@ +Name:Equipoise +ManaCost:2 W +Types:Enchantment +T:Mode$ Phase | Phase$ Upkeep | ValidPlayer$ You | TriggerZones$ Battlefield | Execute$ TrigEquipoise | TriggerDescription$ At the beginning of your upkeep, for each land target player controls in excess of the number you control, choose a land he or she controls, then the chosen permanents phase out. Repeat this process for artifacts and creatures. (While they're phased out, they're treated as though they don't exist. They phase in before that player untaps during his or her next untap step.) +SVar:TrigEquipoise:AB$ Pump | Cost$ 0 | ValidTgts$ Player | IsCurse$ True | RememberTargets$ True | SubAbility$ ChooseLand +SVar:ChooseLand:DB$ ChooseCard | Choices$ Land.TargetedPlayerCtrl | Mandatory$ True | Amount$ LandX | ChoiceTitle$ Choose a land that player controls | SubAbility$ PhasesLand | References$ LandX,OppLand,YourLand,ExcessLand +SVar:PhasesLand:DB$ Phases | Defined$ ChosenCard | SubAbility$ ChooseArtifact +SVar:ChooseArtifact:DB$ ChooseCard | Choices$ Artifact.TargetedPlayerCtrl | Mandatory$ True | Amount$ ArtifactX | ChoiceTitle$ Choose a artifact that player controls | SubAbility$ PhasesArtifact | References$ ArtifactX,OppArtifact,YourArtifact,ExcessArtifact +SVar:PhasesArtifact:DB$ Phases | Defined$ ChosenCard | SubAbility$ ChooseCreature +SVar:ChooseCreature:DB$ ChooseCard | Choices$ Creature.TargetedPlayerCtrl | Mandatory$ True | Amount$ CreatureX | ChoiceTitle$ Choose a creature that player controls | SubAbility$ PhasesCreature | References$ CreatureX,OppCreature,YourCreature,ExcessCreature +SVar:PhasesCreature:DB$ Phases | Defined$ ChosenCard | SubAbility$ DBCleanup +SVar:DBCleanup:DB$ Cleanup | ClearChosenCard$ True | ClearRemembered$ True +SVar:LandX:SVar$ExcessLand/LimitMin.0 +SVar:OppLand:Count$Valid Land.RememberedPlayerCtrl +SVar:YourLand:Count$Valid Land.YouCtrl +SVar:ExcessLand:SVar$OppLand/Minus.YourLand +SVar:ArtifactX:SVar$ExcessArtifact/LimitMin.0 +SVar:OppArtifact:Count$Valid Artifact.RememberedPlayerCtrl +SVar:YourArtifact:Count$Valid Artifact.YouCtrl +SVar:ExcessArtifact:SVar$OppArtifact/Minus.YourArtifact +SVar:CreatureX:SVar$ExcessCreature/LimitMin.0 +SVar:OppCreature:Count$Valid Creature.RememberedPlayerCtrl +SVar:YourCreature:Count$Valid Creature.YouCtrl +SVar:ExcessCreature:SVar$OppCreature/Minus.YourCreature +SVar:Picture:http://www.wizards.com/global/images/magic/general/equipoise.jpg +Oracle:At the beginning of your upkeep, for each land target player controls in excess of the number you control, choose a land he or she controls, then the chosen permanents phase out. Repeat this process for artifacts and creatures. (While they're phased out, they're treated as though they don't exist. They phase in before that player untaps during his or her next untap step.)