From 9804d0bb5587273ba8fcdfef19dd1a8ed17ac4a9 Mon Sep 17 00:00:00 2001 From: tool4ever Date: Thu, 15 Dec 2022 16:03:54 +0100 Subject: [PATCH] Restore fixes somehow dropped by 017a4c (#2108) --- forge-game/src/main/java/forge/game/card/CardProperty.java | 7 +++++-- .../main/java/forge/game/spellability/AbilityManaPart.java | 1 + forge-gui/res/cardsfolder/c/city_in_a_bottle.txt | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/forge-game/src/main/java/forge/game/card/CardProperty.java b/forge-game/src/main/java/forge/game/card/CardProperty.java index 653a082d921..1cd1130174a 100644 --- a/forge-game/src/main/java/forge/game/card/CardProperty.java +++ b/forge-game/src/main/java/forge/game/card/CardProperty.java @@ -1896,9 +1896,12 @@ public class CardProperty { } } else if (property.startsWith("set")) { final String setCode = property.substring(3, 6); + if (card.getName().isEmpty()) { + return false; + } final PaperCard setCard = StaticData.instance().getCommonCards().getCardFromEditions(card.getName(), - CardDb.CardArtPreference.ORIGINAL_ART_ALL_EDITIONS); - if (!setCard.getEdition().equals(setCode)) { + CardDb.CardArtPreference.ORIGINAL_ART_ALL_EDITIONS); + if (setCard != null && !setCard.getEdition().equals(setCode)) { return false; } } else if (property.startsWith("inZone")) { diff --git a/forge-game/src/main/java/forge/game/spellability/AbilityManaPart.java b/forge-game/src/main/java/forge/game/spellability/AbilityManaPart.java index 384e236ed27..b95f6119b3a 100644 --- a/forge-game/src/main/java/forge/game/spellability/AbilityManaPart.java +++ b/forge-game/src/main/java/forge/game/spellability/AbilityManaPart.java @@ -200,6 +200,7 @@ public class AbilityManaPart implements java.io.Serializable { final Map runParams = AbilityKey.mapFromCard(getSourceCard()); runParams.put(AbilityKey.Produced, mana); + runParams.put(AbilityKey.AbilityMana, root); runParams.put(AbilityKey.Activator, root.getActivatingPlayer()); getSourceCard().getGame().getTriggerHandler().runTrigger(TriggerType.TapsForMana, runParams, false); diff --git a/forge-gui/res/cardsfolder/c/city_in_a_bottle.txt b/forge-gui/res/cardsfolder/c/city_in_a_bottle.txt index f68431217da..38ae5be084d 100644 --- a/forge-gui/res/cardsfolder/c/city_in_a_bottle.txt +++ b/forge-gui/res/cardsfolder/c/city_in_a_bottle.txt @@ -2,7 +2,7 @@ Name:City in a Bottle ManaCost:2 Types:Artifact T:Mode$ Always | TriggerZones$ Battlefield | IsPresent$ Permanent.nonToken+setARN+Other | Execute$ TrigSac | TriggerDescription$ Whenever one or more other nontoken permanents with a name originally printed in the Arabian Nights expansion are on the battlefield, their controllers sacrifice them. -SVar:TrigSac:DB$ SacrificeAll | ValidCards$ Permanent.nontoken+setARN+Other +SVar:TrigSac:DB$ SacrificeAll | ValidCards$ Permanent.nonToken+setARN+Other S:Mode$ CantPlayLand | ValidCard$ Card.setARN | Description$ Players can't cast spells or play lands with a name originally printed in the Arabian Nights expansion. S:Mode$ CantBeCast | ValidCard$ Card.setARN AI:RemoveDeck:All