Merge branch 'tibalt' into 'master'

Tibalt the Chaotic

See merge request core-developers/forge!3960
This commit is contained in:
Michael Kamensky
2021-02-22 14:53:48 +00:00
2 changed files with 21 additions and 13 deletions

View File

@@ -88,32 +88,32 @@ public class PlayEffect extends SpellAbilityEffect {
}
}
else if (sa.hasParam("AnySupportedCard")) {
List<PaperCard> cards = Lists.newArrayList(StaticData.instance().getCommonCards().getUniqueCards());
final String valid = sa.getParam("AnySupportedCard");
if (StringUtils.containsIgnoreCase(valid, "sorcery")) {
List<PaperCard> 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<PaperCard> 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<PaperCard> cpp = Predicates.compose(CardRulesPredicates.Presets.IS_INSTANT, PaperCard.FN_GET_RULES);
cards = Lists.newArrayList(Iterables.filter(cards, cpp));
}
if (sa.hasParam("RandomCopied")) {
final List<PaperCard> 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);

View File

@@ -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.