diff --git a/forge-game/src/main/java/forge/game/ability/effects/ChooseCardEffect.java b/forge-game/src/main/java/forge/game/ability/effects/ChooseCardEffect.java index d60a1bd5532..58c6141c8b0 100644 --- a/forge-game/src/main/java/forge/game/ability/effects/ChooseCardEffect.java +++ b/forge-game/src/main/java/forge/game/ability/effects/ChooseCardEffect.java @@ -1,9 +1,8 @@ package forge.game.ability.effects; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; +import java.util.*; +import com.google.common.collect.Sets; import forge.game.player.DelayedReveal; import forge.game.player.PlayerView; import forge.util.CardTranslation; @@ -119,6 +118,23 @@ public class ChooseCardEffect extends SpellAbilityEffect { } } } + } else if (sa.hasParam("ChooseParty")) { + Set partyTypes = Sets.newHashSet("Cleric", "Rogue", "Warrior", "Wizard"); + for (final String type : partyTypes) { + CardCollection valids = CardLists.filter(p.getCardsIn(ZoneType.Battlefield), + CardPredicates.isType(type)); + for (Card alreadyChosen : chosen) { + valids.remove(alreadyChosen); + } + if (!valids.isEmpty()) { + final String prompt = Localizer.getInstance().getMessage("lblChoose") + " " + + Lang.nounWithNumeralExceptOne(1, type); + Card c = p.getController().chooseSingleEntityForEffect(valids, sa, prompt, true, null); + if (c != null) { + chosen.add(c); + } + } + } } else if (sa.hasParam("WithTotalPower")) { final int totP = AbilityUtils.calculateAmount(host, sa.getParam("WithTotalPower"), sa); CardCollection negativeCreats = CardLists.filterLEPower(p.getCreaturesInPlay(), -1); diff --git a/forge-gui/res/cardsfolder/upcoming/stick_together.txt b/forge-gui/res/cardsfolder/upcoming/stick_together.txt new file mode 100644 index 00000000000..b97333a2366 --- /dev/null +++ b/forge-gui/res/cardsfolder/upcoming/stick_together.txt @@ -0,0 +1,9 @@ +Name:Stick Together +ManaCost:3 W W +Types:Sorcery +A:SP$ ChooseCard | Defined$ Player | ChooseParty$ True | SubAbility$ SacAllOthers | StackDescription$ SpellDescription | SpellDescription$ Each player chooses a party from among creatures they control, +SVar:SacAllOthers:DB$ SacrificeAll | ValidCards$ Creature.nonChosenCard | StackDescription$ then sacrifices the rest. | SpellDescription$ then sacrifices the rest. (To choose a party, choose up to one each of Cleric, Rogue, Warrior, and Wizard.) +DeckHints:Ability$Party +DeckNeeds:Type$Cleric|Rogue|Warrior|Wizard +AI:RemoveDeck:Random +Oracle:Each player chooses a party from among creatures they control, then sacrifices the rest. (To choose a party, choose up to one each of Cleric, Rogue, Warrior, and Wizard.)