From c9e0d7722cf8b3ac9e62d2b3c5b64e48103f4a98 Mon Sep 17 00:00:00 2001 From: swordshine Date: Sat, 20 Jun 2020 21:51:29 +0800 Subject: [PATCH] Add Carrion Grub --- .../main/java/forge/game/card/CardFactoryUtil.java | 11 +++++++---- forge-gui/res/cardsfolder/upcoming/carrion_grub.txt | 10 ++++++++++ 2 files changed, 17 insertions(+), 4 deletions(-) create mode 100644 forge-gui/res/cardsfolder/upcoming/carrion_grub.txt diff --git a/forge-game/src/main/java/forge/game/card/CardFactoryUtil.java b/forge-game/src/main/java/forge/game/card/CardFactoryUtil.java index a583250c15d..8bab7a0c324 100644 --- a/forge-game/src/main/java/forge/game/card/CardFactoryUtil.java +++ b/forge-game/src/main/java/forge/game/card/CardFactoryUtil.java @@ -719,10 +719,13 @@ public class CardFactoryUtil { return c.getImprintedCards().get(0).getCMC(); } - if (l[0].startsWith("GreatestPower_")) { - final String restriction = l[0].substring(14); - final String[] rest = restriction.split(","); - CardCollection list = CardLists.getValidCards(cc.getGame().getCardsIn(ZoneType.Battlefield), rest, cc, c, null); + if (l[0].startsWith("GreatestPower")) { + final String[] lparts = l[0].split("_", 2); + final String[] rest = lparts[1].split(","); + final CardCollectionView cardsInZones = lparts[0].length() > 13 + ? game.getCardsIn(ZoneType.listValueOf(lparts[0].substring(13))) + : game.getCardsIn(ZoneType.Battlefield); + CardCollection list = CardLists.getValidCards(cardsInZones, rest, cc, c, null); int highest = 0; for (final Card crd : list) { if (crd.getNetPower() > highest) { diff --git a/forge-gui/res/cardsfolder/upcoming/carrion_grub.txt b/forge-gui/res/cardsfolder/upcoming/carrion_grub.txt new file mode 100644 index 00000000000..6495bda95bb --- /dev/null +++ b/forge-gui/res/cardsfolder/upcoming/carrion_grub.txt @@ -0,0 +1,10 @@ +Name:Carrion Grub +ManaCost:3 B +Types:Creature Insect +PT:0/5 +S:Mode$ Continuous | Affected$ Card.Self | AddPower$ X | References$ X | Description$ CARDNAME gets +X/+0, where X is the greatest power among creature cards in your graveyard. +SVar:X:Count$GreatestPowerGraveyard_Creature.YouOwn +T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ TrigMill | TriggerDescription$ When CARDNAME enters the battlefield, mill four cards. +SVar:TrigMill:DB$ Mill | Defined$ You | NumCards$ 4 +DeckHas:Ability$Graveyard +Oracle:Carrion Grub gets +X/+0, where X is the greatest power among creature cards in your graveyard.\nWhen Carrion Grub enters the battlefield, mill four cards. (Put the top four cards of your library into your graveyard.)