"Eowyn"
This commit is contained in:
@@ -34,7 +34,16 @@ public class ChooseAndAssignMinionToCompanionEffect extends ChooseActiveCardEffe
|
|||||||
protected void cardSelected(LotroGame game, PhysicalCard card) {
|
protected void cardSelected(LotroGame game, PhysicalCard card) {
|
||||||
SubAction subAction = new SubAction(_action);
|
SubAction subAction = new SubAction(_action);
|
||||||
subAction.appendEffect(
|
subAction.appendEffect(
|
||||||
new AssignmentEffect(_playerId, _companion, card));
|
new AssignmentEffect(_playerId, _companion, card) {
|
||||||
|
@Override
|
||||||
|
protected void assignmentMadeCallback(PhysicalCard fpChar, PhysicalCard minion) {
|
||||||
|
ChooseAndAssignMinionToCompanionEffect.this.assignmentMadeCallback(fpChar, minion);
|
||||||
|
}
|
||||||
|
});
|
||||||
game.getActionsEnvironment().addActionToStack(subAction);
|
game.getActionsEnvironment().addActionToStack(subAction);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected void assignmentMadeCallback(PhysicalCard fpChar, PhysicalCard minion) {
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,24 @@
|
|||||||
|
package com.gempukku.lotro.cards.modifiers;
|
||||||
|
|
||||||
|
import com.gempukku.lotro.common.Filterable;
|
||||||
|
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.ModifiersLogic;
|
||||||
|
|
||||||
|
public class LoseAllKeywordsModifier extends AbstractModifier {
|
||||||
|
public LoseAllKeywordsModifier(PhysicalCard source, Filterable affectFilter) {
|
||||||
|
this(source, affectFilter, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
public LoseAllKeywordsModifier(PhysicalCard source, Filterable affectFilter, Condition condition) {
|
||||||
|
super(source, "Loses all keywords", affectFilter, condition, ModifierEffect.LOSE_ALL_KEYWORDS_MODIFIER);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean lostAllKeywords(GameState gameState, ModifiersLogic modifiersLogic, PhysicalCard card) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,70 @@
|
|||||||
|
package com.gempukku.lotro.cards.set17.rohan;
|
||||||
|
|
||||||
|
import com.gempukku.lotro.cards.AbstractMinion;
|
||||||
|
import com.gempukku.lotro.cards.PlayConditions;
|
||||||
|
import com.gempukku.lotro.cards.effects.AddUntilStartOfPhaseModifierEffect;
|
||||||
|
import com.gempukku.lotro.cards.effects.SelfExertEffect;
|
||||||
|
import com.gempukku.lotro.cards.effects.choose.ChooseAndAssignMinionToCompanionEffect;
|
||||||
|
import com.gempukku.lotro.cards.modifiers.CantTakeWoundsModifier;
|
||||||
|
import com.gempukku.lotro.cards.modifiers.LoseAllKeywordsModifier;
|
||||||
|
import com.gempukku.lotro.cards.modifiers.conditions.AndCondition;
|
||||||
|
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.Modifier;
|
||||||
|
import com.gempukku.lotro.logic.modifiers.SpotCondition;
|
||||||
|
import com.gempukku.lotro.logic.timing.Action;
|
||||||
|
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set: Rise of Saruman
|
||||||
|
* Side: Free
|
||||||
|
* Culture: Rohan
|
||||||
|
* Twilight Cost: 2
|
||||||
|
* Type: Companion • Man
|
||||||
|
* Strength: 6
|
||||||
|
* Vitality: 3
|
||||||
|
* Resistance: 7
|
||||||
|
* Game Text: While the Ringbearer is assigned to a skirmish, Eowyn cannot take wounds while skirmishing.
|
||||||
|
* Assignment: Exert Eowyn and assign a minion to the Ringbearer to make that minion lose all game text keywords
|
||||||
|
* and unable to gain game text keywords until the regroup phase.
|
||||||
|
*/
|
||||||
|
public class Card17_096 extends AbstractMinion {
|
||||||
|
public Card17_096() {
|
||||||
|
super(2, 6, 3, 7, Race.MAN, Culture.ROHAN, "Eowyn", true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Modifier getAlwaysOnModifier(PhysicalCard self) {
|
||||||
|
return new CantTakeWoundsModifier(self,
|
||||||
|
new AndCondition(
|
||||||
|
new SpotCondition(Filters.ringBearer, Filters.assignedToSkirmish),
|
||||||
|
new SpotCondition(self, Filters.inSkirmish)), self);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected List<? extends Action> getExtraPhaseActions(String playerId, LotroGame game, final PhysicalCard self) {
|
||||||
|
if (PlayConditions.canUseFPCardDuringPhase(game, Phase.ASSIGNMENT, self)
|
||||||
|
&& PlayConditions.canSelfExert(self, game)
|
||||||
|
&& PlayConditions.canSpot(game, CardType.MINION, Filters.assignableToSkirmishAgainst(Side.FREE_PEOPLE, Filters.ringBearer))) {
|
||||||
|
final ActivateCardAction action = new ActivateCardAction(self);
|
||||||
|
action.appendCost(
|
||||||
|
new SelfExertEffect(self));
|
||||||
|
action.appendCost(
|
||||||
|
new ChooseAndAssignMinionToCompanionEffect(action, playerId, game.getGameState().getRingBearer(playerId), CardType.MINION) {
|
||||||
|
@Override
|
||||||
|
protected void assignmentMadeCallback(PhysicalCard fpChar, PhysicalCard minion) {
|
||||||
|
action.appendEffect(
|
||||||
|
new AddUntilStartOfPhaseModifierEffect(
|
||||||
|
new LoseAllKeywordsModifier(self, minion), Phase.REGROUP));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return Collections.singletonList(action);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -58,8 +58,14 @@ public class AssignmentEffect extends AbstractEffect {
|
|||||||
game.getActionsEnvironment().emitEffectResult(new AssignmentResult(_playerId, _fpChar, _minion));
|
game.getActionsEnvironment().emitEffectResult(new AssignmentResult(_playerId, _fpChar, _minion));
|
||||||
game.getActionsEnvironment().emitEffectResult(new AssignmentResult(_playerId, _minion, _fpChar));
|
game.getActionsEnvironment().emitEffectResult(new AssignmentResult(_playerId, _minion, _fpChar));
|
||||||
|
|
||||||
|
assignmentMadeCallback(_fpChar, _minion);
|
||||||
|
|
||||||
return new FullEffectResult(true, true);
|
return new FullEffectResult(true, true);
|
||||||
}
|
}
|
||||||
return new FullEffectResult(false, false);
|
return new FullEffectResult(false, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected void assignmentMadeCallback(PhysicalCard fpChar, PhysicalCard minion) {
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -321,4 +321,9 @@ public abstract class AbstractModifier implements Modifier {
|
|||||||
public int getInitiativeHandSizeModifier(GameState gameState, ModifiersQuerying modifiersQuerying) {
|
public int getInitiativeHandSizeModifier(GameState gameState, ModifiersQuerying modifiersQuerying) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean lostAllKeywords(GameState gameState, ModifiersLogic modifiersLogic, PhysicalCard card) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -128,4 +128,6 @@ public interface Modifier {
|
|||||||
public Side hasInitiative(GameState gameState, ModifiersQuerying modifiersQuerying);
|
public Side hasInitiative(GameState gameState, ModifiersQuerying modifiersQuerying);
|
||||||
|
|
||||||
public int getInitiativeHandSizeModifier(GameState gameState, ModifiersQuerying modifiersQuerying);
|
public int getInitiativeHandSizeModifier(GameState gameState, ModifiersQuerying modifiersQuerying);
|
||||||
|
|
||||||
|
public boolean lostAllKeywords(GameState gameState, ModifiersLogic modifiersLogic, PhysicalCard card);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,5 +16,5 @@ public enum ModifierEffect {
|
|||||||
|
|
||||||
ADDITIONAL_CARD_TYPE,
|
ADDITIONAL_CARD_TYPE,
|
||||||
|
|
||||||
REMOVE_KEYWORD_MODIFIER, GIVE_KEYWORD_MODIFIER, CANCEL_KEYWORD_BONUS_TARGET_MODIFIER
|
REMOVE_KEYWORD_MODIFIER, GIVE_KEYWORD_MODIFIER, CANCEL_KEYWORD_BONUS_TARGET_MODIFIER, LOSE_ALL_KEYWORDS_MODIFIER
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -201,11 +201,20 @@ public class ModifiersLogic implements ModifiersEnvironment, ModifiersQuerying {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private boolean hasAllKeywordsRemoved(GameState gameState, PhysicalCard card) {
|
||||||
|
for (Modifier modifier : getModifiersAffectingCard(gameState, ModifierEffect.LOSE_ALL_KEYWORDS_MODIFIER, card)) {
|
||||||
|
if (modifier.lostAllKeywords(gameState, this, card))
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean hasKeyword(GameState gameState, PhysicalCard physicalCard, Keyword keyword) {
|
public boolean hasKeyword(GameState gameState, PhysicalCard physicalCard, Keyword keyword) {
|
||||||
LoggingThreadLocal.logMethodStart(physicalCard, "hasKeyword " + keyword.getHumanReadable());
|
LoggingThreadLocal.logMethodStart(physicalCard, "hasKeyword " + keyword.getHumanReadable());
|
||||||
try {
|
try {
|
||||||
if (isCandidateForKeywordRemovalWithTextRemoval(gameState, physicalCard, keyword) && hasTextRemoved(gameState, physicalCard))
|
if (isCandidateForKeywordRemovalWithTextRemoval(gameState, physicalCard, keyword) &&
|
||||||
|
(hasTextRemoved(gameState, physicalCard) || hasAllKeywordsRemoved(gameState, physicalCard)))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
for (Modifier modifier : getKeywordModifiersAffectingCard(gameState, ModifierEffect.REMOVE_KEYWORD_MODIFIER, keyword, physicalCard)) {
|
for (Modifier modifier : getKeywordModifiersAffectingCard(gameState, ModifierEffect.REMOVE_KEYWORD_MODIFIER, keyword, physicalCard)) {
|
||||||
@@ -231,7 +240,8 @@ public class ModifiersLogic implements ModifiersEnvironment, ModifiersQuerying {
|
|||||||
public int getKeywordCount(GameState gameState, PhysicalCard physicalCard, Keyword keyword) {
|
public int getKeywordCount(GameState gameState, PhysicalCard physicalCard, Keyword keyword) {
|
||||||
LoggingThreadLocal.logMethodStart(physicalCard, "getKeywordCount " + keyword.getHumanReadable());
|
LoggingThreadLocal.logMethodStart(physicalCard, "getKeywordCount " + keyword.getHumanReadable());
|
||||||
try {
|
try {
|
||||||
if (isCandidateForKeywordRemovalWithTextRemoval(gameState, physicalCard, keyword) && hasTextRemoved(gameState, physicalCard))
|
if (isCandidateForKeywordRemovalWithTextRemoval(gameState, physicalCard, keyword)
|
||||||
|
&& (hasTextRemoved(gameState, physicalCard) || hasAllKeywordsRemoved(gameState, physicalCard)))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
for (Modifier modifier : getKeywordModifiersAffectingCard(gameState, ModifierEffect.REMOVE_KEYWORD_MODIFIER, keyword, physicalCard)) {
|
for (Modifier modifier : getKeywordModifiersAffectingCard(gameState, ModifierEffect.REMOVE_KEYWORD_MODIFIER, keyword, physicalCard)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user