From d8f445e03de38277baefd7eaa1283cedaa2b42a8 Mon Sep 17 00:00:00 2001 From: "marcins78@gmail.com" Date: Fri, 28 Oct 2011 10:41:55 +0000 Subject: [PATCH] "Gandalf" --- .../lotro/cards/set7/gandalf/Card7_036.java | 59 +++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set7/gandalf/Card7_036.java diff --git a/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set7/gandalf/Card7_036.java b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set7/gandalf/Card7_036.java new file mode 100644 index 000000000..47d802948 --- /dev/null +++ b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set7/gandalf/Card7_036.java @@ -0,0 +1,59 @@ +package com.gempukku.lotro.cards.set7.gandalf; + +import com.gempukku.lotro.cards.AbstractCompanion; +import com.gempukku.lotro.common.CardType; +import com.gempukku.lotro.common.Culture; +import com.gempukku.lotro.common.Race; +import com.gempukku.lotro.common.Signet; +import com.gempukku.lotro.filters.Filters; +import com.gempukku.lotro.game.PhysicalCard; +import com.gempukku.lotro.game.state.GameState; +import com.gempukku.lotro.game.state.LotroGame; +import com.gempukku.lotro.logic.modifiers.Condition; +import com.gempukku.lotro.logic.modifiers.Modifier; +import com.gempukku.lotro.logic.modifiers.ModifiersQuerying; +import com.gempukku.lotro.logic.modifiers.StrengthModifier; + +import java.util.Collections; +import java.util.HashSet; +import java.util.List; +import java.util.Set; + +/** + * Set: The Return of the King + * Side: Free + * Culture: Gandalf + * Twilight Cost: 4 + * Type: Companion • Wizard + * Strength: 9 + * Vitality: 4 + * Resistance: 6 + * Signet: Gandalf + * Game Text: While you cannot spot 3 companions of the same culture, Gandalf is strength -2. + */ +public class Card7_036 extends AbstractCompanion { + public Card7_036() { + super(4, 9, 4, Culture.GANDALF, Race.WIZARD, Signet.GANDALF, "Gandalf", true); + } + + @Override + public List getAlwaysOnModifiers(LotroGame game, PhysicalCard self) { + return Collections.singletonList( + new StrengthModifier(self, self, + new Condition() { + @Override + public boolean isFullfilled(GameState gameState, ModifiersQuerying modifiersQuerying) { + Set companionCultures = new HashSet(); + for (PhysicalCard companion : Filters.filterActive(gameState, modifiersQuerying, CardType.COMPANION)) + companionCultures.add(companion.getBlueprint().getCulture()); + + for (Culture companionCulture : companionCultures) { + if (Filters.countSpottable(gameState, modifiersQuerying, CardType.COMPANION, companionCulture) >= 3) + return false; + } + + return true; + } + }, -2)); + } +}