From 41ce9920aedf24b33f2c66b431ec365ac49cca8a Mon Sep 17 00:00:00 2001 From: tool4EvEr Date: Tue, 10 Aug 2021 19:28:38 +0200 Subject: [PATCH] Fix Egon exiling single card --- .../java/forge/game/ability/SpellAbilityEffect.java | 6 +++--- .../e/egon_god_of_death_throne_of_death.txt | 9 +++------ forge-gui/src/main/java/forge/player/HumanPlay.java | 10 +++++++--- 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/forge-game/src/main/java/forge/game/ability/SpellAbilityEffect.java b/forge-game/src/main/java/forge/game/ability/SpellAbilityEffect.java index c84d0c0eb1a..73eb9fec5aa 100644 --- a/forge-game/src/main/java/forge/game/ability/SpellAbilityEffect.java +++ b/forge-game/src/main/java/forge/game/ability/SpellAbilityEffect.java @@ -753,10 +753,10 @@ public abstract class SpellAbilityEffect { } else if ("UntilUntaps".equals(duration)) { host.addUntapCommand(until); } else if ("UntilUnattached".equals(duration)) { - sa.getHostCard().addUnattachCommand(until); + host.addUnattachCommand(until); } else if ("UntilFacedown".equals(duration)) { - sa.getHostCard().addFacedownCommand(until); - }else { + host.addFacedownCommand(until); + } else { game.getEndOfTurn().addUntil(until); } } diff --git a/forge-gui/res/cardsfolder/e/egon_god_of_death_throne_of_death.txt b/forge-gui/res/cardsfolder/e/egon_god_of_death_throne_of_death.txt index 158eefdcfef..05e137e4f57 100644 --- a/forge-gui/res/cardsfolder/e/egon_god_of_death_throne_of_death.txt +++ b/forge-gui/res/cardsfolder/e/egon_god_of_death_throne_of_death.txt @@ -3,12 +3,9 @@ ManaCost:2 B Types:Legendary Creature God PT:6/6 K:Deathtouch -T:Mode$ Phase | Phase$ Upkeep | ValidPlayer$ You | TriggerZones$ Battlefield | Execute$ TrigExile | TriggerDescription$ At the beginning of your upkeep, exile two cards from your graveyard. If you can't, sacrifice NICKNAME and draw a card. -SVar:TrigExile:DB$ ChangeZone | Origin$ Graveyard | Destination$ Exile | ChangeType$ Card.YouOwn | ChangeNum$ 2 | RememberChanged$ True | Hidden$ True | Mandatory$ True | SubAbility$ DBSacSelf -SVar:DBSacSelf:DB$ Sacrifice | Defined$ Self | ConditionCheckSVar$ X | ConditionSVarCompare$ LT2 | SubAbility$ DBDraw -SVar:DBDraw:DB$ Draw | NumCards$ 1 | ConditionCheckSVar$ X | ConditionSVarCompare$ LT2 | SubAbility$ DBCleanup -SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True -SVar:X:Remembered$Amount +T:Mode$ Phase | Phase$ Upkeep | ValidPlayer$ You | TriggerZones$ Battlefield | Execute$ DBSacSelf | TriggerDescription$ At the beginning of your upkeep, exile two cards from your graveyard. If you can't, sacrifice NICKNAME and draw a card. +SVar:DBSacSelf:DB$ Sacrifice | Defined$ Self | UnlessCost$ Mandatory ExileFromGrave<2/Card> | UnlessPayer$ You | UnlessResolveSubs$ WhenNotPaid | SubAbility$ DBDraw +SVar:DBDraw:DB$ Draw | NumCards$ 1 AlternateMode:Modal DeckHints:Ability$Discard & Ability$Graveyard Oracle:Deathtouch\nAt the beginning of your upkeep, exile two cards from your graveyard. If you can't, sacrifice Egon and draw a card. diff --git a/forge-gui/src/main/java/forge/player/HumanPlay.java b/forge-gui/src/main/java/forge/player/HumanPlay.java index 43d00fa4319..0888afa10ac 100644 --- a/forge-gui/src/main/java/forge/player/HumanPlay.java +++ b/forge-gui/src/main/java/forge/player/HumanPlay.java @@ -410,8 +410,7 @@ public class HumanPlay { } costExile.payAsDecided(p, PaymentDecision.card(p.getCardsIn(ZoneType.Graveyard)), sourceAbility); - } - else { + } else { from = costExile.getFrom(); CardCollection list = CardLists.getValidCards(p.getCardsIn(from), part.getType().split(";"), p, source, sourceAbility); final int nNeeded = getAmountFromPart(costPart, source, sourceAbility); @@ -429,7 +428,12 @@ public class HumanPlay { CardCollection newList = new CardCollection(); GameEntityViewMap gameCacheList = GameEntityView.getMap(list); for (int i = 0; i < nNeeded; i++) { - final CardView cv = SGuiChoose.oneOrNone(Localizer.getInstance().getMessage("lblExileFromZone", from.getTranslatedName()), gameCacheList.getTrackableKeys()); + final CardView cv; + if (mandatory) { + cv = SGuiChoose.one(Localizer.getInstance().getMessage("lblExileFromZone", from.getTranslatedName()), gameCacheList.getTrackableKeys()); + } else { + cv = SGuiChoose.oneOrNone(Localizer.getInstance().getMessage("lblExileFromZone", from.getTranslatedName()), gameCacheList.getTrackableKeys()); + } if (cv == null || !gameCacheList.containsKey(cv)) { return false; }