From 4d8e5677e57074b2203c5a05ac459f53324a175d Mon Sep 17 00:00:00 2001 From: marcins78 Date: Wed, 2 Apr 2014 10:42:09 +0000 Subject: [PATCH] - "Barliman Butterbur, Red-Faced Landlord" now should correctly discards the non-Gandalf cards. - Possessions and artifacts should now be attachable to allies, companions or minions only (not Followers). --- .../src/main/web/includes/changeLog.html | 4 +++ .../lotro/cards/AbstractAttachable.java | 26 +++++++++++++++++-- .../lotro/cards/set17/gandalf/Card17_016.java | 17 +++++++++--- 3 files changed, 41 insertions(+), 6 deletions(-) diff --git a/gemp-lotr/gemp-lotr-async/src/main/web/includes/changeLog.html b/gemp-lotr/gemp-lotr-async/src/main/web/includes/changeLog.html index 18fe2e922..ea7ff7965 100644 --- a/gemp-lotr/gemp-lotr-async/src/main/web/includes/changeLog.html +++ b/gemp-lotr/gemp-lotr-async/src/main/web/includes/changeLog.html @@ -1,4 +1,8 @@
+2 Apr. 2014
+- "Barliman Butterbur, Red-Faced Landlord" now should correctly discards the non-Gandalf cards.
+- Possessions and artifacts should now be attachable to allies, companions or minions only (not Followers).
+
 4 Mar. 2014
 - "Windows in a Stone Wall" can now be correctly played on an Ent (rather than an Elf).
 - The "Multipath" format now has following changes: "We ban now 1C354 Anduin Wilderland and 8R3 Blood Runs Chill.
diff --git a/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/AbstractAttachable.java b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/AbstractAttachable.java
index 2f502e849..68e1833ce 100644
--- a/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/AbstractAttachable.java
+++ b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/AbstractAttachable.java
@@ -1,7 +1,12 @@
 package com.gempukku.lotro.cards;
 
 import com.gempukku.lotro.cards.actions.AttachPermanentAction;
-import com.gempukku.lotro.common.*;
+import com.gempukku.lotro.common.CardType;
+import com.gempukku.lotro.common.Culture;
+import com.gempukku.lotro.common.Filterable;
+import com.gempukku.lotro.common.Phase;
+import com.gempukku.lotro.common.PossessionClass;
+import com.gempukku.lotro.common.Side;
 import com.gempukku.lotro.filters.Filter;
 import com.gempukku.lotro.filters.Filters;
 import com.gempukku.lotro.game.PhysicalCard;
@@ -12,7 +17,12 @@ import com.gempukku.lotro.logic.timing.Action;
 import com.gempukku.lotro.logic.timing.Effect;
 import com.gempukku.lotro.logic.timing.EffectResult;
 
-import java.util.*;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
 
 public abstract class AbstractAttachable extends AbstractLotroCardBlueprint {
     private int _twilight;
@@ -38,6 +48,18 @@ public abstract class AbstractAttachable extends AbstractLotroCardBlueprint {
 
     public final Filter getFullValidTargetFilter(String playerId, final LotroGame game, final PhysicalCard self) {
         return Filters.and(getValidTargetFilter(playerId, game, self),
+                new Filter() {
+                    @Override
+                    public boolean accepts(GameState gameState, ModifiersQuerying modifiersQuerying, PhysicalCard physicalCard) {
+                        final CardType thisType = getCardType();
+                        if (thisType == CardType.POSSESSION || thisType == CardType.ARTIFACT) {
+                            final CardType targetType = physicalCard.getBlueprint().getCardType();
+                            return targetType == CardType.COMPANION || targetType == CardType.ALLY
+                                    || targetType == CardType.MINION;
+                        }
+                        return true;
+                    }
+                },
                 new Filter() {
                     @Override
                     public boolean accepts(GameState gameState, ModifiersQuerying modifiersQuerying, PhysicalCard physicalCard) {
diff --git a/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set17/gandalf/Card17_016.java b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set17/gandalf/Card17_016.java
index 62cabe44f..efc803dda 100644
--- a/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set17/gandalf/Card17_016.java
+++ b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set17/gandalf/Card17_016.java
@@ -2,11 +2,16 @@ package com.gempukku.lotro.cards.set17.gandalf;
 
 import com.gempukku.lotro.cards.AbstractCompanion;
 import com.gempukku.lotro.cards.PlayConditions;
-import com.gempukku.lotro.cards.effects.PutCardFromDeckIntoHandEffect;
+import com.gempukku.lotro.cards.effects.DiscardCardFromDeckEffect;
+import com.gempukku.lotro.cards.effects.PutCardFromDeckIntoHandOrDiscardEffect;
 import com.gempukku.lotro.cards.effects.RevealTopCardsOfDrawDeckEffect;
 import com.gempukku.lotro.cards.effects.SelfExertEffect;
 import com.gempukku.lotro.cards.modifiers.evaluator.CountActiveEvaluator;
-import com.gempukku.lotro.common.*;
+import com.gempukku.lotro.common.CardType;
+import com.gempukku.lotro.common.Culture;
+import com.gempukku.lotro.common.Phase;
+import com.gempukku.lotro.common.Race;
+import com.gempukku.lotro.common.Zone;
 import com.gempukku.lotro.game.PhysicalCard;
 import com.gempukku.lotro.game.state.LotroGame;
 import com.gempukku.lotro.logic.actions.ActivateCardAction;
@@ -50,9 +55,13 @@ public class Card17_016 extends AbstractCompanion {
                         @Override
                         protected void cardsRevealed(List revealedCards) {
                             for (PhysicalCard card : revealedCards) {
-                                if (card.getBlueprint().getCulture() == Culture.GANDALF)
+                                if (card.getBlueprint().getCulture() == Culture.GANDALF) {
                                     action.appendEffect(
-                                            new PutCardFromDeckIntoHandEffect(card));
+                                            new PutCardFromDeckIntoHandOrDiscardEffect(card));
+                                } else {
+                                    action.appendEffect(
+                                            new DiscardCardFromDeckEffect(card));
+                                }
                             }
                         }
                     });