From a2f061e6d131b261855fcf0d3830bf1d65e2003a Mon Sep 17 00:00:00 2001 From: Northmoc Date: Sun, 12 Dec 2021 19:56:07 -0500 Subject: [PATCH 1/5] angel_of_eternal_dawn.txt --- .../res/cardsfolder/upcoming/angel_of_eternal_dawn.txt | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 forge-gui/res/cardsfolder/upcoming/angel_of_eternal_dawn.txt diff --git a/forge-gui/res/cardsfolder/upcoming/angel_of_eternal_dawn.txt b/forge-gui/res/cardsfolder/upcoming/angel_of_eternal_dawn.txt new file mode 100644 index 00000000000..f9db35ce8e6 --- /dev/null +++ b/forge-gui/res/cardsfolder/upcoming/angel_of_eternal_dawn.txt @@ -0,0 +1,10 @@ +Name:Angel of Eternal Dawn +ManaCost:2 W +Types:Creature Angel +PT:2/4 +K:Flying +T:Mode$ ChangesZone | ValidCard$ Card.Self | Origin$ Any | Destination$ Battlefield | Execute$ TrigDay | TriggerDescription$ When CARDNAME enters the battlefield, it becomes day. +SVar:TrigDay:DB$ DayTime | Value$ Day +S:Mode$ Continuous | GlobalRule$ It can't become night. | Description$ It can't become night. +S:Mode$ CantBeCast | ValidCard$ Card | cmcGT$ Turns | Caster$ Opponent | Description$ Your opponents can't cast spells with mana value greater than the number of turns they have begun. +Oracle:Flying\nWhen Angel of Eternal Dawn enters the battlefield, it becomes day.\nIt can't become night.\nYour opponents can't cast spells with mana value greater than the number of turns they have begun. From 80edd52ef657e1a64320d814abe903656b230f13 Mon Sep 17 00:00:00 2001 From: Northmoc Date: Sun, 12 Dec 2021 19:56:51 -0500 Subject: [PATCH 2/5] add noNight GlobalRuleChange --- forge-game/src/main/java/forge/game/GlobalRuleChange.java | 1 + 1 file changed, 1 insertion(+) diff --git a/forge-game/src/main/java/forge/game/GlobalRuleChange.java b/forge-game/src/main/java/forge/game/GlobalRuleChange.java index 2a02d696449..e0b5007432a 100644 --- a/forge-game/src/main/java/forge/game/GlobalRuleChange.java +++ b/forge-game/src/main/java/forge/game/GlobalRuleChange.java @@ -27,6 +27,7 @@ public enum GlobalRuleChange { manaBurn ("A player losing unspent mana causes that player to lose that much life."), noCreatureETBTriggers ("Creatures entering the battlefield don't cause abilities to trigger."), noCreatureDyingTriggers ("Creatures dying don't cause abilities to trigger."), + noNight ("It can't become night."), noLegendRule ("The legend rule doesn't apply."), /* onlyOneAttackerATurn ("No more than one creature can attack each turn."), */ onlyOneAttackerACombat ("No more than one creature can attack each combat."), From 520169b2c763153c5256757cd21955047ecd1031 Mon Sep 17 00:00:00 2001 From: Northmoc Date: Sun, 12 Dec 2021 19:57:21 -0500 Subject: [PATCH 3/5] support noNight in DayTimeEffect --- .../main/java/forge/game/ability/effects/DayTimeEffect.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/forge-game/src/main/java/forge/game/ability/effects/DayTimeEffect.java b/forge-game/src/main/java/forge/game/ability/effects/DayTimeEffect.java index d5ba9c75d8d..a7e3074c9a2 100644 --- a/forge-game/src/main/java/forge/game/ability/effects/DayTimeEffect.java +++ b/forge-game/src/main/java/forge/game/ability/effects/DayTimeEffect.java @@ -1,6 +1,7 @@ package forge.game.ability.effects; import forge.game.Game; +import forge.game.GlobalRuleChange; import forge.game.ability.SpellAbilityEffect; import forge.game.card.Card; import forge.game.spellability.SpellAbility; @@ -18,16 +19,17 @@ public class DayTimeEffect extends SpellAbilityEffect { public void resolve(SpellAbility sa) { Card host = sa.getHostCard(); Game game = host.getGame(); + boolean cantBeNight = game.getStaticEffects().getGlobalRuleChange(GlobalRuleChange.noNight); String newValue = sa.getParam("Value"); if (newValue.equals("Day")) { game.setDayTime(false); - } else if (newValue.equals("Night")) { + } else if (newValue.equals("Night") && !cantBeNight) { game.setDayTime(true); } else if (newValue.equals("Switch")) { // logic for the Celestus Boolean oldValue = game.getDayTime(); - if (oldValue == null) { + if (oldValue == null && !cantBeNight) { game.setDayTime(true); // if it was neither it becomes night } else { game.setDayTime(!oldValue); From ed5152f2a25250dedd01a629c8e2ce8d554a3d07 Mon Sep 17 00:00:00 2001 From: Northmoc Date: Sun, 12 Dec 2021 19:57:53 -0500 Subject: [PATCH 4/5] support "cmcGT$ Turns" in StaticAbilityCantBeCast --- .../game/staticability/StaticAbilityCantBeCast.java | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) 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 a466761a774..7a1b2d37e4d 100644 --- a/forge-game/src/main/java/forge/game/staticability/StaticAbilityCantBeCast.java +++ b/forge-game/src/main/java/forge/game/staticability/StaticAbilityCantBeCast.java @@ -125,10 +125,15 @@ public class StaticAbilityCantBeCast { return false; } - if (stAb.hasParam("cmcGT") && (activator != null) - && (card.getCMC() <= CardLists.getType(activator.getCardsIn(ZoneType.Battlefield), - stAb.getParam("cmcGT")).size())) { - return false; + if (stAb.hasParam("cmcGT") && (activator != null)) { + if (stAb.getParam("cmcGT").equals("Turns")) { + if (card.getCMC() <= activator.getTurn()) { + return false; + } + } else if (card.getCMC() <= CardLists.getType(activator.getCardsIn(ZoneType.Battlefield), + stAb.getParam("cmcGT")).size()) { + return false; + } } if (stAb.hasParam("NumLimitEachTurn") && activator != null) { From 4be769fff955215ac955d9d56240aa67e2be5345 Mon Sep 17 00:00:00 2001 From: Northmoc Date: Mon, 13 Dec 2021 14:57:02 -0500 Subject: [PATCH 5/5] add cantBeNight check to Untap.java --- forge-game/src/main/java/forge/game/phase/Untap.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/forge-game/src/main/java/forge/game/phase/Untap.java b/forge-game/src/main/java/forge/game/phase/Untap.java index 30916be7c23..5a4bc3c4683 100644 --- a/forge-game/src/main/java/forge/game/phase/Untap.java +++ b/forge-game/src/main/java/forge/game/phase/Untap.java @@ -30,6 +30,7 @@ import com.google.common.collect.Maps; import forge.card.CardType; import forge.game.Game; +import forge.game.GlobalRuleChange; import forge.game.ability.ApiType; import forge.game.card.Card; import forge.game.card.CardCollection; @@ -291,8 +292,9 @@ public class Untap extends Phase { } final Game game = previous.getGame(); List casted = game.getStack().getSpellsCastLastTurn(); + boolean cantBeNight = game.getStaticEffects().getGlobalRuleChange(GlobalRuleChange.noNight); - if (game.isDay() && !Iterables.any(casted, CardPredicates.isController(previous))) { + if (game.isDay() && !cantBeNight && !Iterables.any(casted, CardPredicates.isController(previous))) { game.setDayTime(true); } else if (game.isNight() && Iterables.size(Iterables.filter(casted, CardPredicates.isController(previous))) > 1) { game.setDayTime(false);