From eefc6ea9d3da18f0e94f7799ac4f77c467e2b2ed Mon Sep 17 00:00:00 2001 From: tehdiplomat Date: Tue, 25 Sep 2018 23:23:46 -0400 Subject: [PATCH] Experimental Frenzy --- .../forge/game/spellability/LandAbility.java | 45 +------------------ .../StaticAbilityCantBeCast.java | 8 ++++ .../upcoming/experimental_frenzy.txt | 10 +++++ 3 files changed, 19 insertions(+), 44 deletions(-) create mode 100644 forge-gui/res/cardsfolder/upcoming/experimental_frenzy.txt diff --git a/forge-game/src/main/java/forge/game/spellability/LandAbility.java b/forge-game/src/main/java/forge/game/spellability/LandAbility.java index a524a7222a9..96d80560451 100644 --- a/forge-game/src/main/java/forge/game/spellability/LandAbility.java +++ b/forge-game/src/main/java/forge/game/spellability/LandAbility.java @@ -39,51 +39,8 @@ public class LandAbility extends Ability { public boolean canPlay() { final Card land = this.getHostCard(); final Player p = this.getActivatingPlayer(); - final Game game = p.getGame(); - if (!p.canCastSorcery()) { - return false; - } - // CantBeCast static abilities - for (final Card ca : game.getCardsIn(ZoneType.listValueOf("Battlefield,Command"))) { - final Iterable staticAbilities = ca.getStaticAbilities(); - for (final StaticAbility stAb : staticAbilities) { - if (stAb.applyAbility("CantPlayLand", land, this)) { - return false; - } - } - } - - if (land != null) { - final boolean mayPlay = getMayPlay() != null; - if (land.getOwner() != p && !mayPlay) { - return false; - } - - final Zone zone = game.getZoneOf(land); - if (zone != null && (zone.is(ZoneType.Battlefield) || (!zone.is(ZoneType.Hand) && !mayPlay))) { - return false; - } - } - - // **** Check for land play limit per turn **** - // Dev Mode - if (p.getController().canPlayUnlimitedLands() || p.hasKeyword("You may play any number of additional lands on each of your turns.")) { - return true; - } - - // check for adjusted max lands play per turn - int adjMax = 1; - for (String keyword : p.getKeywords()) { - if (keyword.startsWith("AdjustLandPlays")) { - final String[] k = keyword.split(":"); - adjMax += Integer.valueOf(k[1]); - } - } - if (p.getLandsPlayedThisTurn() < adjMax) { - return true; - } - return false; + return p.canPlayLand(land); } @Override public void resolve() { diff --git a/forge-game/src/main/java/forge/game/staticability/StaticAbilityCantBeCast.java b/forge-game/src/main/java/forge/game/staticability/StaticAbilityCantBeCast.java index 49a95c13fa6..307d64d366a 100644 --- a/forge-game/src/main/java/forge/game/staticability/StaticAbilityCantBeCast.java +++ b/forge-game/src/main/java/forge/game/staticability/StaticAbilityCantBeCast.java @@ -160,6 +160,14 @@ public class StaticAbilityCantBeCast { return false; } + if (params.containsKey("Origin")) { + List src = ZoneType.listValueOf(params.get("Origin")); + + if (!src.contains(card.getZone().getZoneType())) { + return false; + } + } + if (params.containsKey("Player") && (player != null) && !player.isValid(params.get("Player"), hostCard.getController(), hostCard, null)) { return false; diff --git a/forge-gui/res/cardsfolder/upcoming/experimental_frenzy.txt b/forge-gui/res/cardsfolder/upcoming/experimental_frenzy.txt new file mode 100644 index 00000000000..d98744b9149 --- /dev/null +++ b/forge-gui/res/cardsfolder/upcoming/experimental_frenzy.txt @@ -0,0 +1,10 @@ +Name:Experimental Frenzy +ManaCost:3 R +Types:Enchantment +S:Mode$ Continuous | Affected$ Card.TopLibrary+YouCtrl | AffectedZone$ Library | MayLookAt$ Player | Description$ You may look at the top card of your library any time. +S:Mode$ Continuous | Affected$ Card.TopLibrary+YouCtrl | AffectedZone$ Library | MayPlay$ True | Description$ You may play the top card of your library. +S:Mode$ CantPlayLand | Player$ You | Origin$ Hand | Description$ You can't play lands from your hand. +S:Mode$ CantBeCast | ValidCard$ Card | Caster$ You | Origin$ Hand | Description$ You can't play cards from your hand. +SVar:NonStackingEffect:True +A:AB$ Destroy | Cost$ 3 R | Defined$ Self | SpellDescription$ Destroy CARDNAME. +Oracle:You may look at the top card of your library any time.\nYou may play the top card of your library.\nYou can't play cards from your hand.\n{3}{R}: Destroy Experimental Frenzy. \ No newline at end of file