"Rallying Call"
This commit is contained in:
@@ -187,11 +187,11 @@ public class PlayConditions {
|
||||
}
|
||||
|
||||
public static boolean canRemoveThreat(LotroGame game, PhysicalCard card, int count) {
|
||||
return game.getGameState().getThreats() >= count;
|
||||
return game.getGameState().getThreats() >= count && game.getModifiersQuerying().canRemoveThreat(game.getGameState(), card);
|
||||
}
|
||||
|
||||
public static boolean canRemoveBurdens(LotroGame game, PhysicalCard card, int count) {
|
||||
return game.getGameState().getBurdens() >= count;
|
||||
return game.getGameState().getBurdens() >= count && game.getModifiersQuerying().canRemoveBurden(game.getGameState(), card);
|
||||
}
|
||||
|
||||
public static boolean canExertMultiple(PhysicalCard source, LotroGame game, int times, int count, Filterable... filters) {
|
||||
|
||||
@@ -21,7 +21,7 @@ public class CantRemoveBurdensModifier extends AbstractModifier {
|
||||
|
||||
@Override
|
||||
public boolean canRemoveBurden(GameState gameState, ModifiersQuerying modifiersQuerying, PhysicalCard source) {
|
||||
if (_condition.isFullfilled(gameState, modifiersQuerying)
|
||||
if ((_condition == null || _condition.isFullfilled(gameState, modifiersQuerying))
|
||||
&& Filters.and(_sourceFilters).accepts(gameState, modifiersQuerying, source))
|
||||
return false;
|
||||
return true;
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.gempukku.lotro.cards.modifiers;
|
||||
|
||||
import com.gempukku.lotro.common.Filterable;
|
||||
import com.gempukku.lotro.filters.Filters;
|
||||
import com.gempukku.lotro.game.PhysicalCard;
|
||||
import com.gempukku.lotro.game.state.GameState;
|
||||
import com.gempukku.lotro.logic.modifiers.AbstractModifier;
|
||||
import com.gempukku.lotro.logic.modifiers.Condition;
|
||||
import com.gempukku.lotro.logic.modifiers.ModifierEffect;
|
||||
import com.gempukku.lotro.logic.modifiers.ModifiersQuerying;
|
||||
|
||||
public class CantRemoveThreatsModifier extends AbstractModifier {
|
||||
private Condition _condition;
|
||||
private Filterable[] _sourceFilters;
|
||||
|
||||
public CantRemoveThreatsModifier(PhysicalCard source, Condition condition, Filterable... sourceFilters) {
|
||||
super(source, "Can't remove threats", null, condition, ModifierEffect.BURDEN_MODIFIER);
|
||||
_condition = condition;
|
||||
_sourceFilters = sourceFilters;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canRemoveThreat(GameState gameState, ModifiersQuerying modifiersQuerying, PhysicalCard source) {
|
||||
if ((_condition == null || _condition.isFullfilled(gameState, modifiersQuerying))
|
||||
&& Filters.and(_sourceFilters).accepts(gameState, modifiersQuerying, source))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
package com.gempukku.lotro.cards.set10.raider;
|
||||
|
||||
import com.gempukku.lotro.cards.AbstractPermanent;
|
||||
import com.gempukku.lotro.cards.PlayConditions;
|
||||
import com.gempukku.lotro.cards.effects.choose.ChooseAndPlayCardFromHandEffect;
|
||||
import com.gempukku.lotro.cards.modifiers.CantRemoveThreatsModifier;
|
||||
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.effects.AddThreatsEffect;
|
||||
import com.gempukku.lotro.logic.modifiers.Modifier;
|
||||
import com.gempukku.lotro.logic.timing.Action;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Set: Mount Doom
|
||||
* Side: Shadow
|
||||
* Culture: Raider
|
||||
* Twilight Cost: 0
|
||||
* Type: Condition • Support Area
|
||||
* Game Text: To play, spot a [RAIDER] Man. Threats cannot be removed by Free Peoples cards. Shadow: Remove (1) and play
|
||||
* a Southron to add a threat.
|
||||
*/
|
||||
public class Card10_047 extends AbstractPermanent {
|
||||
public Card10_047() {
|
||||
super(Side.SHADOW, 0, CardType.CONDITION, Culture.RAIDER, Zone.SUPPORT, "Rallying Call");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkPlayRequirements(String playerId, LotroGame game, PhysicalCard self, int twilightModifier, boolean ignoreRoamingPenalty) {
|
||||
return super.checkPlayRequirements(playerId, game, self, twilightModifier, ignoreRoamingPenalty)
|
||||
&& PlayConditions.canSpot(game, Culture.RAIDER, Race.MAN);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<? extends Modifier> getAlwaysOnModifiers(LotroGame game, PhysicalCard self) {
|
||||
return Collections.singletonList(
|
||||
new CantRemoveThreatsModifier(self, null, Side.FREE_PEOPLE));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected List<? extends Action> getExtraPhaseActions(String playerId, LotroGame game, PhysicalCard self) {
|
||||
if (PlayConditions.canUseShadowCardDuringPhase(game, Phase.SHADOW, self, 1)
|
||||
&& PlayConditions.canPlayFromHand(playerId, game, 1, Keyword.SOUTHRON)) {
|
||||
ActivateCardAction action = new ActivateCardAction(self);
|
||||
action.appendCost(
|
||||
new ChooseAndPlayCardFromHandEffect(playerId, game.getGameState().getHand(playerId), Keyword.SOUTHRON));
|
||||
action.appendEffect(
|
||||
new AddThreatsEffect(playerId, self, 1));
|
||||
return Collections.singletonList(action);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -26,18 +26,21 @@ public class RemoveThreatsEffect extends AbstractEffect {
|
||||
|
||||
@Override
|
||||
public boolean isPlayableInFull(LotroGame game) {
|
||||
return game.getGameState().getThreats() >= _count;
|
||||
return game.getGameState().getThreats() >= _count && game.getModifiersQuerying().canRemoveThreat(game.getGameState(), _source);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected FullEffectResult playEffectReturningResult(LotroGame game) {
|
||||
int toRemove = Math.min(game.getGameState().getThreats(), _count);
|
||||
if (game.getModifiersQuerying().canRemoveThreat(game.getGameState(), _source)) {
|
||||
int toRemove = Math.min(game.getGameState().getThreats(), _count);
|
||||
|
||||
if (_source != null)
|
||||
game.getGameState().sendMessage(GameUtils.getCardLink(_source) + " removed " + toRemove + " threat" + ((toRemove > 1) ? "s" : ""));
|
||||
if (_source != null)
|
||||
game.getGameState().sendMessage(GameUtils.getCardLink(_source) + " removed " + toRemove + " threat" + ((toRemove > 1) ? "s" : ""));
|
||||
|
||||
game.getGameState().removeThreats(game.getGameState().getCurrentPlayerId(), toRemove);
|
||||
game.getGameState().removeThreats(game.getGameState().getCurrentPlayerId(), toRemove);
|
||||
|
||||
return new FullEffectResult(null, _count == toRemove, _count == toRemove);
|
||||
return new FullEffectResult(null, _count == toRemove, _count == toRemove);
|
||||
}
|
||||
return new FullEffectResult(null, false, false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -223,6 +223,11 @@ public abstract class AbstractModifier implements Modifier {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canRemoveThreat(GameState gameState, ModifiersQuerying modifiersQuerying, PhysicalCard source) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRoamingPenaltyModifier(GameState gameState, ModifiersQuerying modifiersQuerying, PhysicalCard physicalCard) {
|
||||
return 0;
|
||||
|
||||
@@ -91,6 +91,8 @@ public interface Modifier {
|
||||
|
||||
public boolean canRemoveBurden(GameState gameState, ModifiersQuerying modifiersQuerying, PhysicalCard source);
|
||||
|
||||
public boolean canRemoveThreat(GameState gameState, ModifiersQuerying modifiersQuerying, PhysicalCard source);
|
||||
|
||||
public boolean canLookOrRevealCardsInHand(GameState gameState, ModifiersQuerying modifiersQuerying, String playerId);
|
||||
|
||||
public boolean canDiscardCardsFromHand(GameState gameState, ModifiersQuerying modifiersQuerying, String playerId, PhysicalCard source);
|
||||
|
||||
@@ -2,7 +2,7 @@ package com.gempukku.lotro.logic.modifiers;
|
||||
|
||||
public enum ModifierEffect {
|
||||
KEYWORD_MODIFIER, STRENGTH_MODIFIER, VITALITY_MODIFIER, RESISTANCE_MODIFIER, SITE_NUMBER_MODIFIER, TWILIGHT_COST_MODIFIER, OVERWHELM_MODIFIER,
|
||||
WOUND_MODIFIER, BURDEN_MODIFIER,
|
||||
WOUND_MODIFIER, BURDEN_MODIFIER, THREAT_MODIFIER,
|
||||
PRESENCE_MODIFIER, ARCHERY_MODIFIER, MOVE_LIMIT_MODIFIER, ACTION_MODIFIER, ASSIGNMENT_MODIFIER, DISCARD_FROM_PLAY_MODIFIER, DISCARD_NOT_FROM_PLAY,
|
||||
LOOK_OR_REVEAL_MODIFIER, SPOT_MODIFIER, TARGET_MODIFIER,
|
||||
|
||||
|
||||
@@ -638,6 +638,15 @@ public class ModifiersLogic implements ModifiersEnvironment, ModifiersQuerying {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canRemoveThreat(GameState gameState, PhysicalCard source) {
|
||||
for (Modifier modifier : getModifiers(gameState, ModifierEffect.THREAT_MODIFIER)) {
|
||||
if (!modifier.canRemoveThreat(gameState, this, source))
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Rule of 4. "You cannot draw (or take into hand) more than 4 cards during your fellowship phase."
|
||||
*
|
||||
|
||||
@@ -60,6 +60,8 @@ public interface ModifiersQuerying {
|
||||
|
||||
public boolean canRemoveBurden(GameState gameState, PhysicalCard source);
|
||||
|
||||
public boolean canRemoveThreat(GameState gameState, PhysicalCard source);
|
||||
|
||||
// Assignments
|
||||
public boolean canBeAssignedToSkirmish(GameState gameState, Side playerSide, PhysicalCard card);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user