From c7fdab79962389281b02c0ded031ceca7f2457cc Mon Sep 17 00:00:00 2001 From: Northmoc Date: Tue, 24 May 2022 06:51:15 -0400 Subject: [PATCH] ConniveEffect - tidy up --- .../forge/game/ability/effects/ConniveEffect.java | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/forge-game/src/main/java/forge/game/ability/effects/ConniveEffect.java b/forge-game/src/main/java/forge/game/ability/effects/ConniveEffect.java index 0c21c641f04..5859043d936 100644 --- a/forge-game/src/main/java/forge/game/ability/effects/ConniveEffect.java +++ b/forge-game/src/main/java/forge/game/ability/effects/ConniveEffect.java @@ -65,12 +65,7 @@ public class ConniveEffect extends SpellAbilityEffect { } for (final Player p : controllers) { - CardCollection connivers = new CardCollection(); - for (Card c : toConnive) { - if (c.getController() == p) { - connivers.add(c); - } - } + CardCollection connivers = CardLists.filterControlledBy(toConnive, p); while (connivers.size() > 0) { GameEntityCounterTable table = new GameEntityCounterTable(); final CardZoneTable triggerList = new CardZoneTable(); @@ -84,14 +79,12 @@ public class ConniveEffect extends SpellAbilityEffect { p.drawCards(num, sa, moveParams); - CardCollectionView dPHand = p.getCardsIn(ZoneType.Hand); - dPHand = CardLists.filter(dPHand, CardPredicates.Presets.NON_TOKEN); - if (dPHand.isEmpty() || !p.canDiscardBy(sa, true)) { // hand being empty unlikely, but just to be safe + CardCollectionView validCards = p.getCardsIn(ZoneType.Hand); + validCards = CardLists.filter(validCards, CardPredicates.Presets.NON_TOKEN); + if (validCards.isEmpty() || !p.canDiscardBy(sa, true)) { // hand being empty unlikely, just to be safe continue; } - CardCollection validCards = CardLists.getValidCards(dPHand, "Card", p, host, sa); - int amt = Math.min(validCards.size(), num); CardCollectionView toBeDiscarded = amt == 0 ? CardCollection.EMPTY : p.getController().chooseCardsToDiscardFrom(p, sa, validCards, amt, amt);