From 670f8077e902d2dbfdd19b0c1a185d0141089428 Mon Sep 17 00:00:00 2001 From: Adam Pantel <> Date: Sun, 21 Feb 2021 11:38:33 -0500 Subject: [PATCH] Tibalt the Chaotic --- .../game/ability/effects/PlayEffect.java | 26 +++++++++---------- .../res/cardsfolder/t/tibalt_the_chaotic.txt | 8 ++++++ 2 files changed, 21 insertions(+), 13 deletions(-) create mode 100644 forge-gui/res/cardsfolder/t/tibalt_the_chaotic.txt diff --git a/forge-game/src/main/java/forge/game/ability/effects/PlayEffect.java b/forge-game/src/main/java/forge/game/ability/effects/PlayEffect.java index 09e91dd67e5..a76b1013c53 100644 --- a/forge-game/src/main/java/forge/game/ability/effects/PlayEffect.java +++ b/forge-game/src/main/java/forge/game/ability/effects/PlayEffect.java @@ -88,32 +88,32 @@ public class PlayEffect extends SpellAbilityEffect { } } else if (sa.hasParam("AnySupportedCard")) { - List cards = Lists.newArrayList(StaticData.instance().getCommonCards().getUniqueCards()); final String valid = sa.getParam("AnySupportedCard"); - if (StringUtils.containsIgnoreCase(valid, "sorcery")) { + List cards = null; + if (valid.startsWith("Names:")){ + cards = new ArrayList<>(); + for (String name : valid.substring(6).split(",")) { + name = name.replace(";", ","); + cards.add(StaticData.instance().getCommonCards().getUniqueByName(name)); + } + } else if (valid.equalsIgnoreCase("sorcery")) { + cards = Lists.newArrayList(StaticData.instance().getCommonCards().getUniqueCards()); final Predicate cpp = Predicates.compose(CardRulesPredicates.Presets.IS_SORCERY, PaperCard.FN_GET_RULES); cards = Lists.newArrayList(Iterables.filter(cards, cpp)); - } - if (StringUtils.containsIgnoreCase(valid, "instant")) { + } else if (valid.equalsIgnoreCase("instant")) { + cards = Lists.newArrayList(StaticData.instance().getCommonCards().getUniqueCards()); final Predicate cpp = Predicates.compose(CardRulesPredicates.Presets.IS_INSTANT, PaperCard.FN_GET_RULES); cards = Lists.newArrayList(Iterables.filter(cards, cpp)); } if (sa.hasParam("RandomCopied")) { - final List copysource = new ArrayList<>(cards); final CardCollection choice = new CardCollection(); final String num = sa.hasParam("RandomNum") ? sa.getParam("RandomNum") : "1"; int ncopied = AbilityUtils.calculateAmount(source, num, sa); - while (ncopied > 0) { - final PaperCard cp = Aggregates.random(copysource); + for (PaperCard cp : Aggregates.random(cards, ncopied)) { final Card possibleCard = Card.fromPaperCard(cp, sa.getActivatingPlayer()); // Need to temporarily set the Owner so the Game is set possibleCard.setOwner(sa.getActivatingPlayer()); - - if (possibleCard.isValid(valid, source.getController(), source, sa)) { - choice.add(possibleCard); - copysource.remove(cp); - ncopied -= 1; - } + choice.add(possibleCard); } if (sa.hasParam("ChoiceNum")) { final int choicenum = AbilityUtils.calculateAmount(source, sa.getParam("ChoiceNum"), sa); diff --git a/forge-gui/res/cardsfolder/t/tibalt_the_chaotic.txt b/forge-gui/res/cardsfolder/t/tibalt_the_chaotic.txt new file mode 100644 index 00000000000..556f9135dd0 --- /dev/null +++ b/forge-gui/res/cardsfolder/t/tibalt_the_chaotic.txt @@ -0,0 +1,8 @@ +Name:Tibalt the Chaotic +ManaCost:1 R R +Types:Legendary Planeswalker Tibalt +Loyalty:4 +A:AB$ Play | Cost$ AddCounter<1/LOYALTY> | Planeswalker$ True | AnySupportedCard$ Names:Ignorant Bliss,Crack the Earth,Blazing Volley | RandomCopied$ True | CopyCard$ True | WithoutManaCost$ Trues | SpellDescription$ Cast a copy of one of the following cards chosen at random—Ignorant Bliss, Crack the Earth, Blazing Volley. +A:AB$ Play | Cost$ SubCounter<3/LOYALTY> | Planeswalker$ True | AnySupportedCard$ Names:Seething Song,Dance with Devils,Flamebreak | RandomCopied$ True | CopyCard$ True | WithoutManaCost$ True | SpellDescription$ Cast a copy of one of the following cards chosen at random—Seething Song, Dance with Devils, Flamebreak. +A:AB$ Play | Cost$ SubCounter<6/LOYALTY> | Planeswalker$ True | Ultimate$ True | AnySupportedCard$ Names:Hellion Eruption,Insurrection,Warp World | RandomCopied$ True | CopyCard$ True | WithoutManaCost$ True | SpellDescription$ Cast a copy of one of the following cards chosen at random—Hellion Eruption, Insurrection, Warp World. +Oracle:[+1]: Cast a copy of one of the following cards chosen at random—Ignorant Bliss, Crack the Earth, Blazing Volley.[−3]: Cast a copy of one of the following cards chosen at random—Seething Song, Dance with Devils, Flamebreak.[−6]: Cast a copy of one of the following cards chosen at random—Hellion Eruption, Insurrection, Warp World. \ No newline at end of file