diff --git a/forge-game/src/main/java/forge/game/GameAction.java b/forge-game/src/main/java/forge/game/GameAction.java index 1b94afa2e08..e5200630258 100644 --- a/forge-game/src/main/java/forge/game/GameAction.java +++ b/forge-game/src/main/java/forge/game/GameAction.java @@ -258,6 +258,36 @@ public class GameAction { } } + // special rule for Worms of the Earth + if (toBattlefield && game.getStaticEffects().getGlobalRuleChange(GlobalRuleChange.noLandBattlefield)) { + // something that is already a Land cant enter the battlefield + if (c.isLand()) { + return c; + } + // check if something would be a land + Card noLandLKI = CardUtil.getLKICopy(c); + + //setZone is not enough + //noLandLKI.setZone(zoneTo); + noLandLKI.setImmutable(true); // immu doesn't trigger Zone + zoneTo.add(noLandLKI); + + noLandLKI.setImmutable(false); // but need to remove that or Static doesn't find it + checkStaticAbilities(false, Sets.newHashSet(noLandLKI)); + + boolean noLand = noLandLKI.isLand(); + zoneTo.remove(noLandLKI); + + // reset static + checkStaticAbilities(false, Sets.newHashSet(noLandLKI)); + + if(noLand) { + // if something would only be a land when entering the battlefield and not before + // put it into the graveyard instead + zoneTo = c.getOwner().getZone(ZoneType.Graveyard); + } + } + if (!suppress) { if (zoneFrom == null) { copied.getOwner().addInboundToken(copied); diff --git a/forge-game/src/main/java/forge/game/GlobalRuleChange.java b/forge-game/src/main/java/forge/game/GlobalRuleChange.java index cfe6dba4050..a7db8c7d25f 100644 --- a/forge-game/src/main/java/forge/game/GlobalRuleChange.java +++ b/forge-game/src/main/java/forge/game/GlobalRuleChange.java @@ -34,7 +34,8 @@ public enum GlobalRuleChange { onlyOneBlocker ("No more than one creature can block each combat."), onlyTwoBlockers ("No more than two creatures can block each combat."), toughnessAssignsDamage ("Each creature assigns combat damage equal to its toughness rather than its power."), - blankIsChaos("Each blank roll of the planar dice is a {CHAOS} roll."); + blankIsChaos("Each blank roll of the planar dice is a {CHAOS} roll."), + noLandBattlefield("Lands can't enter the battlefield."); private final String ruleText; diff --git a/forge-gui/res/cardsfolder/w/worms_of_the_earth.txt b/forge-gui/res/cardsfolder/w/worms_of_the_earth.txt index d88106e73ae..eb7f7e5499e 100644 --- a/forge-gui/res/cardsfolder/w/worms_of_the_earth.txt +++ b/forge-gui/res/cardsfolder/w/worms_of_the_earth.txt @@ -2,9 +2,7 @@ Name:Worms of the Earth ManaCost:2 B B B Types:Enchantment S:Mode$ CantPlayLand | Description$ Players can't play lands. -R:Event$ Moved | ActiveZones$ Battlefield | Origin$ Battlefield,Hand,Library,Graveyard,Exile,Command | Destination$ Battlefield | ValidCard$ Land | Prevent$ True | Description$ Lands can't enter the battlefield. -R:Event$ Moved | ActiveZones$ Battlefield | Origin$ Stack | Destination$ Battlefield | ValidCard$ Land | ReplaceWith$ MoveToGraveyard | Description$ Lands can't enter the battlefield. -SVar:MoveToGraveyard:DB$ ChangeZone | Destination$ Graveyard | Defined$ ReplacedCard +S:Mode$ Continuous | EffectZone$ Battlefield | GlobalRule$ Lands can't enter the battlefield. | Description$ Lands can't enter the battlefield. T:Mode$ Phase | Phase$ Upkeep | TriggerZones$ Battlefield | Execute$ RepeatAbility | TriggerDescription$ At the beginning of each upkeep, any player may sacrifice two lands or have CARDNAME deal 5 damage to him or her. If a player does either, destroy CARDNAME. SVar:RepeatAbility:DB$ RepeatEach | RepeatPlayers$ Player | RepeatSubAbility$ DBChoose SVar:DBChoose:DB$ GenericChoice | Defined$ Player.IsRemembered | Choices$ SacTwoLands,DealDmg | AILogic$ PayUnlessCost