From 1fb50f416c6a1ac9a6ff62d6643ddfaba299c2d8 Mon Sep 17 00:00:00 2001 From: Hans Mackowiak Date: Wed, 14 Jul 2021 03:11:06 +0000 Subject: [PATCH] CardUtil: fix getValidCardsToTarget for orcus --- .../src/main/java/forge/game/card/CardUtil.java | 6 +++--- .../upcoming/orcus_prince_of_undeath.txt | 15 +++++++++++++++ 2 files changed, 18 insertions(+), 3 deletions(-) create mode 100644 forge-gui/res/cardsfolder/upcoming/orcus_prince_of_undeath.txt diff --git a/forge-game/src/main/java/forge/game/card/CardUtil.java b/forge-game/src/main/java/forge/game/card/CardUtil.java index 8aa688e4678..18984d40709 100644 --- a/forge-game/src/main/java/forge/game/card/CardUtil.java +++ b/forge-game/src/main/java/forge/game/card/CardUtil.java @@ -530,6 +530,7 @@ public final class CardUtil { // however, due to the changes necessary for SA_Requirements this is much // different than the original public static List getValidCardsToTarget(TargetRestrictions tgt, SpellAbility ability) { + Card activatingCard = ability.getHostCard(); final Game game = ability.getActivatingPlayer().getGame(); final List zone = tgt.getZone(); @@ -539,7 +540,6 @@ public final class CardUtil { if (canTgtStack) { // Since getTargetableCards doesn't have additional checks if one of the Zones is stack // Remove the activating card from targeting itself if its on the Stack - Card activatingCard = ability.getHostCard(); if (activatingCard.isInZone(ZoneType.Stack)) { choices.remove(ability.getHostCard()); } @@ -561,7 +561,7 @@ public final class CardUtil { final List choicesCopy = Lists.newArrayList(choices); for (final Card c : choicesCopy) { - if (c.getCMC() > tgt.getMaxTotalCMC(c, ability) - totalCMCTargeted) { + if (c.getCMC() > tgt.getMaxTotalCMC(activatingCard, ability) - totalCMCTargeted) { choices.remove(c); } } @@ -576,7 +576,7 @@ public final class CardUtil { final List choicesCopy = Lists.newArrayList(choices); for (final Card c : choicesCopy) { - if (c.getNetPower() > tgt.getMaxTotalPower(c, ability) - totalPowerTargeted) { + if (c.getNetPower() > tgt.getMaxTotalPower(activatingCard, ability) - totalPowerTargeted) { choices.remove(c); } } diff --git a/forge-gui/res/cardsfolder/upcoming/orcus_prince_of_undeath.txt b/forge-gui/res/cardsfolder/upcoming/orcus_prince_of_undeath.txt new file mode 100644 index 00000000000..20c1b6f5c5d --- /dev/null +++ b/forge-gui/res/cardsfolder/upcoming/orcus_prince_of_undeath.txt @@ -0,0 +1,15 @@ +Name:Orcus, Prince of Undeath +ManaCost:X 2 B R +Types:Legendary Creature Demon +PT:5/3 +K:Flying +K:Trample +T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ TrigCharm | TriggerDescription$ When CARDNAME enters the battlefield, ABILITY +SVar:TrigCharm:DB$ Charm | Choices$ DBPumpAll,DBReturn +SVar:DBPumpAll:DB$ PumpAll | NumAtt$ -X | NumDef$ -X | ValidCards$ Creature.Other | IsCurse$ True | SubAbility$ DBLoseLife | SpellDescription$ Each other creature gets -X/-X until end of turn. You lose X life. +SVar:DBLoseLife:DB$ LoseLife | LifeAmount$ X +SVar:DBReturn:DB$ ChangeZone | Origin$ Graveyard | Destination$ Battlefield | TargetMin$ 0 | TargetMax$ X | MaxTotalTargetCMC$ X | ValidTgts$ Creature.YouOwn | SubAbility$ DBPump | TgtPrompt$ Select up to X target creature cards with total mana value X or less | StackDescription$ SpellDescription | SpellDescription$ Return up to X target creature cards with total mana value X or less from your graveyard to the battlefield. They gain haste until end of turn. +SVar:DBPump:DB$ Pump | Defined$ Targeted | KW$ Haste +SVar:X:Count$xPaid +SVar:PlayMain1:TRUE +Oracle:Flying, trample\nWhen Orcus, Prince of Undeath enters the battlefield, choose one —\n• Each other creature gets -X/-X until end of turn. You lose X life.\n• Return up to X target creature cards with total mana value X or less from your graveyard to the battlefield. They gain haste until end of turn.