ConniveEffect - tidy up

This commit is contained in:
Northmoc
2022-05-24 06:51:15 -04:00
parent 34c19db4c2
commit c7fdab7996

View File

@@ -65,12 +65,7 @@ public class ConniveEffect extends SpellAbilityEffect {
} }
for (final Player p : controllers) { for (final Player p : controllers) {
CardCollection connivers = new CardCollection(); CardCollection connivers = CardLists.filterControlledBy(toConnive, p);
for (Card c : toConnive) {
if (c.getController() == p) {
connivers.add(c);
}
}
while (connivers.size() > 0) { while (connivers.size() > 0) {
GameEntityCounterTable table = new GameEntityCounterTable(); GameEntityCounterTable table = new GameEntityCounterTable();
final CardZoneTable triggerList = new CardZoneTable(); final CardZoneTable triggerList = new CardZoneTable();
@@ -84,14 +79,12 @@ public class ConniveEffect extends SpellAbilityEffect {
p.drawCards(num, sa, moveParams); p.drawCards(num, sa, moveParams);
CardCollectionView dPHand = p.getCardsIn(ZoneType.Hand); CardCollectionView validCards = p.getCardsIn(ZoneType.Hand);
dPHand = CardLists.filter(dPHand, CardPredicates.Presets.NON_TOKEN); validCards = CardLists.filter(validCards, CardPredicates.Presets.NON_TOKEN);
if (dPHand.isEmpty() || !p.canDiscardBy(sa, true)) { // hand being empty unlikely, but just to be safe if (validCards.isEmpty() || !p.canDiscardBy(sa, true)) { // hand being empty unlikely, just to be safe
continue; continue;
} }
CardCollection validCards = CardLists.getValidCards(dPHand, "Card", p, host, sa);
int amt = Math.min(validCards.size(), num); int amt = Math.min(validCards.size(), num);
CardCollectionView toBeDiscarded = amt == 0 ? CardCollection.EMPTY : CardCollectionView toBeDiscarded = amt == 0 ? CardCollection.EMPTY :
p.getController().chooseCardsToDiscardFrom(p, sa, validCards, amt, amt); p.getController().chooseCardsToDiscardFrom(p, sa, validCards, amt, amt);