6 more cards

This commit is contained in:
marcin.sciesinski
2019-07-15 17:00:20 -07:00
parent 700c72f165
commit b5e9e5f94a
7 changed files with 386 additions and 0 deletions

View File

@@ -20,6 +20,7 @@ import com.gempukku.lotro.logic.modifiers.ModifiersQuerying;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Map;
public class PlayConditions {
@@ -223,6 +224,19 @@ public class PlayConditions {
});
}
public static boolean canStackCardFromHand(PhysicalCard source, LotroGame game, String playerId, int cardCount, Filterable onto, Filterable... card) {
Filter cardFilter = Filters.and(card);
List<? extends PhysicalCard> hand = game.getGameState().getHand(playerId);
int count = 0;
for (PhysicalCard cardInHand : hand) {
if (cardFilter.accepts(game.getGameState(), game.getModifiersQuerying(), cardInHand))
count++;
}
return count >= cardCount
&& canSpot(game, onto);
}
public static boolean canStackDeckTopCards(PhysicalCard source, LotroGame game, String playerId, int cardCount, Filterable... onto) {
return game.getGameState().getDeck(playerId).size() >= cardCount
&& canSpot(game, onto);

View File

@@ -0,0 +1,50 @@
package com.gempukku.lotro.cards.set40.dwarven;
import com.gempukku.lotro.cards.AbstractAttachable;
import com.gempukku.lotro.cards.AbstractCompanion;
import com.gempukku.lotro.cards.PlayConditions;
import com.gempukku.lotro.cards.effects.SelfDiscardEffect;
import com.gempukku.lotro.cards.effects.choose.ChooseAndAddUntilEOPStrengthBonusEffect;
import com.gempukku.lotro.common.*;
import com.gempukku.lotro.game.PhysicalCard;
import com.gempukku.lotro.game.state.LotroGame;
import com.gempukku.lotro.logic.actions.ActivateCardAction;
import com.gempukku.lotro.logic.timing.Action;
import java.util.Collections;
import java.util.List;
/**
* Title: Endurance of Dwarves
* Set: Second Edition
* Side: Free
* Culture: Dwarven
* Twilight Cost: 1
* Type: Condition - Companion
* Vitality: +1
* Card Number: 1U15
* Game Text: Bearer must be a Dwarf. Skirmish: Discard this condition to make bearer strength +1.
*/
public class Card40_015 extends AbstractAttachable{
public Card40_015(){
super(Side.FREE_PEOPLE, CardType.CONDITION, 1, Culture.DWARVEN, null, "Endurance of Dwarves");
}
@Override
protected Filterable getValidTargetFilter(String playerId, LotroGame game, PhysicalCard self) {
return Race.DWARF;
}
@Override
protected List<? extends Action> getExtraPhaseActions(String playerId, LotroGame game, PhysicalCard self) {
if (PlayConditions.canUseFPCardDuringPhase(game, Phase.SKIRMISH, self)
&& PlayConditions.canSelfDiscard(self, game)) {
ActivateCardAction action = new ActivateCardAction(self);
action.appendCost(new SelfDiscardEffect(self));
action.appendEffect(new ChooseAndAddUntilEOPStrengthBonusEffect(
action, self, playerId, 1, self.getAttachedTo()));
return Collections.singletonList(action);
}
return null;
}
}

View File

@@ -0,0 +1,47 @@
package com.gempukku.lotro.cards.set40.dwarven;
import com.gempukku.lotro.cards.AbstractEvent;
import com.gempukku.lotro.cards.PlayConditions;
import com.gempukku.lotro.cards.actions.PlayEventAction;
import com.gempukku.lotro.cards.effects.RemoveBurdenEffect;
import com.gempukku.lotro.cards.effects.choose.ChooseAndDiscardStackedCardsEffect;
import com.gempukku.lotro.cards.effects.choose.ChooseAndExertCharactersEffect;
import com.gempukku.lotro.common.*;
import com.gempukku.lotro.filters.Filters;
import com.gempukku.lotro.game.PhysicalCard;
import com.gempukku.lotro.game.state.LotroGame;
/**
* Title: Festive Folk
* Set: Second Edition
* Side: Free
* Culture: Dwarven
* Twilight Cost: 1
* Type: Event - Fellowship
* Card Number: 1C16
* Game Text: Exert a Dwarf and discard a card stacked on [DWARVEN] condition to remove a burden.
*/
public class Card40_016 extends AbstractEvent {
public Card40_016() {
super(Side.FREE_PEOPLE, 1, Culture.DWARVEN, "Festive Folk", Phase.FELLOWSHIP);
}
@Override
public boolean checkPlayRequirements(String playerId, LotroGame game, PhysicalCard self, int withTwilightRemoved, int twilightModifier, boolean ignoreRoamingPenalty, boolean ignoreCheckingDeadPile) {
return super.checkPlayRequirements(playerId, game, self, withTwilightRemoved, twilightModifier, ignoreRoamingPenalty, ignoreCheckingDeadPile)
&& PlayConditions.canExert(self, game, Race.DWARF)
&& PlayConditions.canDiscardFromStacked(self, game, playerId, 1, Filters.and(Culture.DWARVEN, CardType.CONDITION), Filters.any);
}
@Override
public PlayEventAction getPlayCardAction(String playerId, LotroGame game, PhysicalCard self, int twilightModifier, boolean ignoreRoamingPenalty) {
PlayEventAction action = new PlayEventAction(self);
action.appendCost(
new ChooseAndExertCharactersEffect(action, playerId, 1, 1, Race.DWARF));
action.appendCost(
new ChooseAndDiscardStackedCardsEffect(action ,playerId, 1, 1, Filters.and(Culture.DWARVEN, CardType.CONDITION), Filters.any));
action.appendEffect(
new RemoveBurdenEffect(playerId, self));
return action;
}
}

View File

@@ -0,0 +1,70 @@
package com.gempukku.lotro.cards.set40.dwarven;
import com.gempukku.lotro.cards.AbstractCompanion;
import com.gempukku.lotro.cards.PlayConditions;
import com.gempukku.lotro.cards.TriggerConditions;
import com.gempukku.lotro.cards.effects.StackCardFromHandEffect;
import com.gempukku.lotro.cards.effects.choose.ChooseAndPutCardFromDiscardIntoHandEffect;
import com.gempukku.lotro.cards.effects.choose.ChooseAndStackCardsFromHandEffect;
import com.gempukku.lotro.common.*;
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.actions.OptionalTriggerAction;
import com.gempukku.lotro.logic.effects.ChooseActiveCardEffect;
import com.gempukku.lotro.logic.modifiers.Modifier;
import com.gempukku.lotro.logic.modifiers.ModifiersQuerying;
import com.gempukku.lotro.logic.timing.EffectResult;
import java.util.Collections;
import java.util.List;
/**
* Title: *Gimli, Dwarven Emissary
* Set: Second Edition
* Side: Free
* Culture: Dwarven
* Twilight Cost: 3
* Type: Companion - Dwarf
* Strength: 6
* Vitality: 4
* Resistance: 7
* Card Number: 1R17
* Game Text: Damage +1. While in your starting fellowship, Gimli's twilight cost is -1.
* At the beginning of the fellowship phase, you may stack a Free Peoples card from hand on a [DWARVEN] support area
* condition to take a [DWARVEN] event from your discard pile into hand.
*/
public class Card40_017 extends AbstractCompanion{
public Card40_017() {
super(3, 6, 4, 7, Culture.DWARVEN, Race.DWARF, null, "Gimli", "Dwarven Emissary", true);
addKeyword(Keyword.DAMAGE, 1);
}
@Override
public int getTwilightCostModifier(GameState gameState, ModifiersQuerying modifiersQuerying, PhysicalCard self) {
if (gameState.getCurrentPhase() == Phase.PLAY_STARTING_FELLOWSHIP)
return -1;
return 0;
}
@Override
public List<OptionalTriggerAction> getOptionalAfterTriggers(final String playerId, LotroGame game, EffectResult effectResult, PhysicalCard self) {
if (TriggerConditions.startOfPhase(game, effectResult, Phase.FELLOWSHIP)
&& PlayConditions.canStackCardFromHand(self, game, playerId, 1, Filters.and(Culture.DWARVEN, CardType.CONDITION, Zone.SUPPORT), Side.FREE_PEOPLE)) {
final OptionalTriggerAction action = new OptionalTriggerAction(self);
action.appendCost(
new ChooseActiveCardEffect(self, playerId, "Choose condition to stack on", Culture.DWARVEN, CardType.CONDITION, Zone.SUPPORT) {
@Override
protected void cardSelected(LotroGame game, PhysicalCard card) {
action.appendCost(
new ChooseAndStackCardsFromHandEffect(action, playerId, 1, 1, card, Side.FREE_PEOPLE));
}
});
action.appendEffect(
new ChooseAndPutCardFromDiscardIntoHandEffect(action, playerId, 1, 1, Culture.DWARVEN, CardType.EVENT));
return Collections.singletonList(action);
}
return null;
}
}

View File

@@ -0,0 +1,59 @@
package com.gempukku.lotro.cards.set40.dwarven;
import com.gempukku.lotro.cards.AbstractCompanion;
import com.gempukku.lotro.cards.modifiers.CantTakeMoreThanXWoundsModifier;
import com.gempukku.lotro.cards.modifiers.conditions.LocationCondition;
import com.gempukku.lotro.common.Culture;
import com.gempukku.lotro.common.Keyword;
import com.gempukku.lotro.common.Phase;
import com.gempukku.lotro.common.Race;
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.Modifier;
import com.gempukku.lotro.logic.modifiers.ModifiersQuerying;
import com.gempukku.lotro.logic.modifiers.StrengthModifier;
import java.util.Arrays;
import java.util.List;
/**
* Title: *Gimli, Stalwart Protector
* Set: Second Edition
* Side: Free
* Culture: Dwarven
* Twilight Cost: 3
* Type: Companion - Dwarf
* Strength: 6
* Vitality: 4
* Resistance: 7
* Card Number: 1C18
* Game Text: Damage +1. While in your starting fellowship, Gimli's twilight cost is -1.
* While at a mountain or underground site, Gimli is strength +2 and takes no more than one wound in a skirmish.
*/
public class Card40_018 extends AbstractCompanion {
public Card40_018() {
super(3, 6, 4, 7, Culture.DWARVEN, Race.DWARF, null, "Gimli", "Stalwart Protector", true);
addKeyword(Keyword.DAMAGE, 1);
}
@Override
public int getTwilightCostModifier(GameState gameState, ModifiersQuerying modifiersQuerying, PhysicalCard self) {
if (gameState.getCurrentPhase() == Phase.PLAY_STARTING_FELLOWSHIP)
return -1;
return 0;
}
@Override
public List<? extends Modifier> getAlwaysOnModifiers(LotroGame game, PhysicalCard self) {
LocationCondition condition = new LocationCondition(Filters.or(Keyword.MOUNTAIN, Keyword.UNDERGROUND));
StrengthModifier modifier1 = new StrengthModifier(self, self,
condition, 2);
CantTakeMoreThanXWoundsModifier modifier2 = new CantTakeMoreThanXWoundsModifier(
self, Phase.SKIRMISH, 1, condition, self);
return Arrays.asList(modifier1, modifier2);
}
}

View File

@@ -0,0 +1,65 @@
package com.gempukku.lotro.cards.set40.dwarven;
import com.gempukku.lotro.cards.AbstractAttachableFPPossession;
import com.gempukku.lotro.cards.TriggerConditions;
import com.gempukku.lotro.cards.effects.choose.ChooseAndStackCardsFromDiscardEffect;
import com.gempukku.lotro.common.*;
import com.gempukku.lotro.filters.Filters;
import com.gempukku.lotro.game.PhysicalCard;
import com.gempukku.lotro.game.state.LotroGame;
import com.gempukku.lotro.logic.actions.OptionalTriggerAction;
import com.gempukku.lotro.logic.effects.ChooseActiveCardEffect;
import com.gempukku.lotro.logic.modifiers.KeywordModifier;
import com.gempukku.lotro.logic.modifiers.Modifier;
import com.gempukku.lotro.logic.timing.EffectResult;
import java.util.Collections;
import java.util.List;
/**
* Title: *Gimli's Battle Axe, Weapon of Erebor
* Set: Second Edition
* Side: Free
* Culture: Dwarven
* Twilight Cost: 2
* Type: Possession - Hand Weapon
* Card Number: 1R19
* Game Text: Bearer must be a Dwarf. If bearer is Gimli, he is damage +1.
* Each time bearer wins a skirmish, you may stack a [DWARVEN] event from your discard pile on a [DWARVEN] support area
* condition.
*/
public class Card40_019 extends AbstractAttachableFPPossession {
public Card40_019() {
super(2, 0, 0, Culture.DWARVEN, PossessionClass.HAND_WEAPON, "Gimli's Battle Axe", "Weapon of Erebor", true);
}
@Override
protected Filterable getValidTargetFilter(String playerId, LotroGame game, PhysicalCard self) {
return Race.DWARF;
}
@Override
protected List<? extends Modifier> getNonBasicStatsModifiers(PhysicalCard self) {
KeywordModifier modifier = new KeywordModifier(self, Filters.and(Filters.name("Gimli"), Filters.hasAttached(self)), Keyword.DAMAGE, 1);
return Collections.singletonList(modifier);
}
@Override
public List<OptionalTriggerAction> getOptionalAfterTriggers(final String playerId, LotroGame game, EffectResult effectResult, PhysicalCard self) {
if (TriggerConditions.winsSkirmish(game, effectResult, Filters.hasAttached(self))) {
final OptionalTriggerAction action = new OptionalTriggerAction(self);
action.appendEffect(
new ChooseActiveCardEffect(self, playerId, "Choose condition to stack on", Culture.DWARVEN, CardType.CONDITION, Zone.SUPPORT) {
@Override
protected void cardSelected(LotroGame game, PhysicalCard card) {
action.appendEffect(
new ChooseAndStackCardsFromDiscardEffect(
action, playerId, 1, 1, card,
Culture.DWARVEN, CardType.EVENT));
}
});
return Collections.singletonList(action);
}
return null;
}
}

View File

@@ -0,0 +1,81 @@
package com.gempukku.lotro.cards.set40.dwarven;
import com.gempukku.lotro.cards.AbstractCompanion;
import com.gempukku.lotro.cards.PlayConditions;
import com.gempukku.lotro.cards.effects.AddUntilEndOfPhaseModifierEffect;
import com.gempukku.lotro.cards.effects.SelfExertEffect;
import com.gempukku.lotro.common.Culture;
import com.gempukku.lotro.common.Keyword;
import com.gempukku.lotro.common.Phase;
import com.gempukku.lotro.common.Race;
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.actions.ActivateCardAction;
import com.gempukku.lotro.logic.effects.ChooseActiveCardEffect;
import com.gempukku.lotro.logic.modifiers.*;
import java.util.Collections;
import java.util.List;
/**
* Title: *Gloin, Venerable Dwarf
* Set: Second Edition
* Side: Free
* Culture: Dwarven
* Twilight Cost: 3
* Type: Companion - Dwarf
* Strength: 5
* Vitality: 4
* Resistance: 6
* Card Number: 1R20
* Game Text: Damage +1. While you can spot Gimli, Gloin is strength +1 and his twilight cost is -1.
* Skirmish: Exert Gloin to make a Dwarf strength +2 (and damage +1 if that Dwarf is Gimli).
*/
public class Card40_020 extends AbstractCompanion {
public Card40_020() {
super(3, 5, 4, 6, Culture.DWARVEN, Race.DWARF, null, "Gloin", "Venerable Dwarf", true);
addKeyword(Keyword.DAMAGE, 1);
}
@Override
public int getTwilightCostModifier(GameState gameState, ModifiersQuerying modifiersQuerying, PhysicalCard self) {
if (Filters.canSpot(gameState, modifiersQuerying, Filters.name("Gimli")))
return -1;
return 0;
}
@Override
public List<? extends Modifier> getAlwaysOnModifiers(LotroGame game, PhysicalCard self) {
StrengthModifier modifier = new StrengthModifier(self, self,
new SpotCondition(Filters.name("Gimli")), 1);
return Collections.singletonList(modifier);
}
@Override
protected List<ActivateCardAction> getExtraInPlayPhaseActions(String playerId, LotroGame game, final PhysicalCard self) {
if (PlayConditions.canUseFPCardDuringPhase(game, Phase.SKIRMISH, self)
&& PlayConditions.canSelfExert(self, game)) {
final ActivateCardAction action = new ActivateCardAction(self);
action.appendCost(
new SelfExertEffect(action, self));
action.appendEffect(
new ChooseActiveCardEffect(self, playerId, "Choose a Dwarf", Race.DWARF) {
@Override
protected void cardSelected(LotroGame game, PhysicalCard card) {
action.appendEffect(
new AddUntilEndOfPhaseModifierEffect(
new StrengthModifier(self, card, 2)));
if (Filters.name("Gimli").accepts(game.getGameState(), game.getModifiersQuerying(), card)) {
action.appendEffect(
new AddUntilEndOfPhaseModifierEffect(
new KeywordModifier(self, card, Keyword.DAMAGE, 1)));
}
}
});
return Collections.singletonList(action);
}
return null;
}
}