diff --git a/forge-game/src/main/java/forge/game/ability/effects/VentureEffect.java b/forge-game/src/main/java/forge/game/ability/effects/VentureEffect.java index 8c7cc036900..c13a27706ff 100644 --- a/forge-game/src/main/java/forge/game/ability/effects/VentureEffect.java +++ b/forge-game/src/main/java/forge/game/ability/effects/VentureEffect.java @@ -17,6 +17,7 @@ import forge.game.card.CounterType; import forge.game.event.GameEventCardCounters; import forge.game.player.Player; import forge.game.spellability.SpellAbility; +import forge.game.staticability.StaticAbilityCantVenture; import forge.game.trigger.Trigger; import forge.game.trigger.TriggerType; import forge.game.trigger.WrappedAbility; @@ -85,7 +86,7 @@ public class VentureEffect extends SpellAbilityEffect { } private void ventureIntoDungeon(SpellAbility sa, Player player) { - if (player.getVenturedThisTurn() >= 1 && player.hasKeyword("You can't venture into the dungeon more than once each turn.")) { + if (StaticAbilityCantVenture.cantVenture(player)) { return; } diff --git a/forge-game/src/main/java/forge/game/player/PlayerProperty.java b/forge-game/src/main/java/forge/game/player/PlayerProperty.java index bc719ead392..8199adcc3a0 100644 --- a/forge-game/src/main/java/forge/game/player/PlayerProperty.java +++ b/forge-game/src/main/java/forge/game/player/PlayerProperty.java @@ -392,6 +392,10 @@ public class PlayerProperty { if (player.getCreaturesAttackedThisTurn().isEmpty()) { return false; } + } else if (property.equals("VenturedThisTurn")) { + if (player.getVenturedThisTurn() < 1) { + return false; + } } return true; } diff --git a/forge-game/src/main/java/forge/game/staticability/StaticAbilityCantVenture.java b/forge-game/src/main/java/forge/game/staticability/StaticAbilityCantVenture.java new file mode 100644 index 00000000000..4f9855155a7 --- /dev/null +++ b/forge-game/src/main/java/forge/game/staticability/StaticAbilityCantVenture.java @@ -0,0 +1,33 @@ +package forge.game.staticability; + +import forge.game.Game; +import forge.game.card.Card; +import forge.game.player.Player; +import forge.game.zone.ZoneType; + +public class StaticAbilityCantVenture { + + static String MODE = "CantVenture"; + + static public boolean cantVenture(Player player) { + final Game game = player.getGame(); + for (final Card ca : game.getCardsIn(ZoneType.STATIC_ABILITIES_SOURCE_ZONES)) { + for (final StaticAbility stAb : ca.getStaticAbilities()) { + if (!stAb.getParam("Mode").equals(MODE) || stAb.isSuppressed() || !stAb.checkConditions()) { + continue; + } + if (applyCantVentureAbility(stAb, player)) { + return true; + } + } + } + return false; + } + + static public boolean applyCantVentureAbility(StaticAbility stAb, Player player) { + if (!stAb.matchesValidParam("ValidPlayer", player)) { + return false; + } + return true; + } +} diff --git a/forge-gui/res/cardsfolder/k/keen_eared_sentry.txt b/forge-gui/res/cardsfolder/k/keen_eared_sentry.txt index 21a4c66608c..e08fe420613 100644 --- a/forge-gui/res/cardsfolder/k/keen_eared_sentry.txt +++ b/forge-gui/res/cardsfolder/k/keen_eared_sentry.txt @@ -3,5 +3,5 @@ ManaCost:1 W Types:Creature Human Soldier PT:2/1 S:Mode$ Continuous | Affected$ You | AddKeyword$ Hexproof | Description$ You have hexproof. (You can't be the target of spells or abilities your opponents control.) -S:Mode$ Continuous | Affected$ Opponent | AddKeyword$ You can't venture into the dungeon more than once each turn. | Description$ Each opponent can't venture into the dungeon more than once each turn. +S:Mode$ CantVenture | ValidPlayer$ Opponent.VenturedThisTurn | Description$ Each opponent can't venture into the dungeon more than once each turn. Oracle:You have hexproof. (You can't be the target of spells or abilities your opponents control.)\nEach opponent can't venture into the dungeon more than once each turn.