CLB: Stick Together and support (#1062)

* stick_together.txt

* ChooseCardEffect support "Choose Party"
This commit is contained in:
Northmoc
2022-07-09 11:35:28 -04:00
committed by GitHub
parent ba54f0f05e
commit 373e4d59e6
2 changed files with 28 additions and 3 deletions

View File

@@ -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<String> 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);

View File

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