"Gamling"
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
package com.gempukku.lotro.cards;
|
||||
|
||||
import com.gempukku.lotro.common.Filterable;
|
||||
import com.gempukku.lotro.filters.Filter;
|
||||
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.ModifiersQuerying;
|
||||
|
||||
public class ExtraFilters {
|
||||
public static Filter attachableTo(final LotroGame game, final Filterable... filters) {
|
||||
return new Filter() {
|
||||
@Override
|
||||
public boolean accepts(GameState gameState, ModifiersQuerying modifiersQuerying, PhysicalCard physicalCard) {
|
||||
if (!(physicalCard.getBlueprint() instanceof AbstractAttachable))
|
||||
return false;
|
||||
AbstractAttachable weapon = (AbstractAttachable) physicalCard.getBlueprint();
|
||||
return weapon.checkPlayRequirements(physicalCard.getOwner(), game, physicalCard, Filters.and(filters), 0);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
package com.gempukku.lotro.cards.set5.rohan;
|
||||
|
||||
import com.gempukku.lotro.cards.AbstractAttachable;
|
||||
import com.gempukku.lotro.cards.AbstractCompanion;
|
||||
import com.gempukku.lotro.cards.ExtraFilters;
|
||||
import com.gempukku.lotro.cards.PlayConditions;
|
||||
import com.gempukku.lotro.cards.actions.AttachPermanentAction;
|
||||
import com.gempukku.lotro.cards.effects.AddUntilEndOfPhaseModifierEffect;
|
||||
import com.gempukku.lotro.cards.effects.choose.ChooseArbitraryCardsEffect;
|
||||
import com.gempukku.lotro.cards.modifiers.StrengthModifier;
|
||||
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.ActivateCardAction;
|
||||
import com.gempukku.lotro.logic.modifiers.KeywordModifier;
|
||||
import com.gempukku.lotro.logic.timing.Action;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Set: Battle of Helm's Deep
|
||||
* Side: Free
|
||||
* Culture: Rohan
|
||||
* Twilight Cost: 2
|
||||
* Type: Companion • Man
|
||||
* Strength: 6
|
||||
* Vitality: 3
|
||||
* Resistance: 6
|
||||
* Game Text: Valiant. To play spot a [ROHAN] Man. Skirmish: Play a [ROHAN] possession on Gamling to make him
|
||||
* strength +2 and damage +1.
|
||||
*/
|
||||
public class Card5_082 extends AbstractCompanion {
|
||||
public Card5_082() {
|
||||
super(2, 6, 3, Culture.ROHAN, Race.MAN, null, "Gamling", true);
|
||||
addKeyword(Keyword.VALIANT);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkPlayRequirements(String playerId, LotroGame game, PhysicalCard self, int twilightModifier) {
|
||||
return super.checkPlayRequirements(playerId, game, self, twilightModifier)
|
||||
&& PlayConditions.canSpot(game, Culture.ROHAN, Race.MAN);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected List<? extends Action> getExtraInPlayPhaseActions(final String playerId, LotroGame game, final PhysicalCard self) {
|
||||
if (PlayConditions.canUseFPCardDuringPhase(game.getGameState(), Phase.SKIRMISH, self)
|
||||
&& PlayConditions.canPlayFromHand(playerId, game, Culture.ROHAN, CardType.POSSESSION, ExtraFilters.attachableTo(game, self))) {
|
||||
ActivateCardAction action = new ActivateCardAction(self);
|
||||
action.appendCost(
|
||||
new ChooseArbitraryCardsEffect(playerId, "Choose card to play", game.getGameState().getDiscard(playerId), Filters.and(Culture.ROHAN, CardType.POSSESSION, ExtraFilters.attachableTo(game, self)), 1, 1) {
|
||||
@Override
|
||||
protected void cardsSelected(LotroGame game, Collection<PhysicalCard> selectedCards) {
|
||||
if (selectedCards.size() > 0) {
|
||||
PhysicalCard selectedCard = selectedCards.iterator().next();
|
||||
AttachPermanentAction attachPermanentAction = ((AbstractAttachable) selectedCard.getBlueprint()).getPlayCardAction(playerId, game, selectedCard, Filters.and(self), 0);
|
||||
game.getActionsEnvironment().addActionToStack(attachPermanentAction);
|
||||
}
|
||||
}
|
||||
});
|
||||
action.appendEffect(
|
||||
new AddUntilEndOfPhaseModifierEffect(
|
||||
new StrengthModifier(self, Filters.sameCard(self), 2), Phase.SKIRMISH));
|
||||
action.appendEffect(
|
||||
new AddUntilEndOfPhaseModifierEffect(
|
||||
new KeywordModifier(self, Filters.sameCard(self), Keyword.DAMAGE), Phase.SKIRMISH));
|
||||
return Collections.singletonList(action);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -67,7 +67,11 @@ public class RuleUtils {
|
||||
if (game.getGameState().getSkirmish() == null)
|
||||
return 0;
|
||||
|
||||
return game.getModifiersQuerying().getStrength(game.getGameState(), game.getGameState().getSkirmish().getFellowshipCharacter());
|
||||
PhysicalCard fpChar = game.getGameState().getSkirmish().getFellowshipCharacter();
|
||||
if (fpChar == null)
|
||||
return 0;
|
||||
|
||||
return game.getModifiersQuerying().getStrength(game.getGameState(), fpChar);
|
||||
}
|
||||
|
||||
public static int getShadowSkirmishStrength(LotroGame game) {
|
||||
|
||||
Reference in New Issue
Block a user