"Warrior of Rohan"
This commit is contained in:
@@ -105,7 +105,8 @@ public abstract class AbstractAttachableFPPossession extends AbstractAttachable
|
|||||||
@Override
|
@Override
|
||||||
protected final List<? extends Action> getExtraPhaseActions(String playerId, LotroGame game, PhysicalCard self) {
|
protected final List<? extends Action> getExtraPhaseActions(String playerId, LotroGame game, PhysicalCard self) {
|
||||||
List<Action> actions = new LinkedList<Action>();
|
List<Action> actions = new LinkedList<Action>();
|
||||||
appendTransferPossessionAction(actions, game, self, getFullValidTargetFilter(playerId, game, self));
|
if (game.getModifiersQuerying().canBeTransferred(game.getGameState(), self))
|
||||||
|
appendTransferPossessionAction(actions, game, self, getFullValidTargetFilter(playerId, game, self));
|
||||||
List<? extends Action> extraActions = getExtraInPlayPhaseActions(playerId, game, self);
|
List<? extends Action> extraActions = getExtraInPlayPhaseActions(playerId, game, self);
|
||||||
if (extraActions != null)
|
if (extraActions != null)
|
||||||
actions.addAll(extraActions);
|
actions.addAll(extraActions);
|
||||||
|
|||||||
@@ -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.ModifiersQuerying;
|
||||||
|
|
||||||
|
public class CantBeTransferredModifier extends AbstractModifier {
|
||||||
|
public CantBeTransferredModifier(PhysicalCard source, Filterable affectFilter) {
|
||||||
|
this(source, affectFilter, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
public CantBeTransferredModifier(PhysicalCard source, Filterable affectFilter, Condition condition) {
|
||||||
|
super(source, "Can't be transferred", affectFilter, condition, ModifierEffect.TRANSFER_MODIFIER);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canBeTransferred(GameState gameState, ModifiersQuerying modifiersQuerying, PhysicalCard attachment) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,68 @@
|
|||||||
|
package com.gempukku.lotro.cards.set17.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.LiberateASiteEffect;
|
||||||
|
import com.gempukku.lotro.cards.effects.choose.ChooseCardsFromHandEffect;
|
||||||
|
import com.gempukku.lotro.cards.modifiers.CantBeTransferredModifier;
|
||||||
|
import com.gempukku.lotro.common.CardType;
|
||||||
|
import com.gempukku.lotro.common.Culture;
|
||||||
|
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.LotroGame;
|
||||||
|
import com.gempukku.lotro.logic.actions.ActivateCardAction;
|
||||||
|
import com.gempukku.lotro.logic.modifiers.Modifier;
|
||||||
|
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set: Rise of Saruman
|
||||||
|
* Side: Free
|
||||||
|
* Culture: Rohan
|
||||||
|
* Twilight Cost: 3
|
||||||
|
* Type: Companion • Man
|
||||||
|
* Strength: 7
|
||||||
|
* Vitality: 3
|
||||||
|
* Resistance: 6
|
||||||
|
* Game Text: Possessions cannot be transferred from this companion to another character. Fellowship: Play a possession
|
||||||
|
* on this companion to liberate a site.
|
||||||
|
*/
|
||||||
|
public class Card17_104 extends AbstractCompanion {
|
||||||
|
public Card17_104() {
|
||||||
|
super(3, 7, 3, 6, Culture.ROHAN, Race.MAN, null, "Warrior of Rohan");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Modifier getAlwaysOnModifier(PhysicalCard self) {
|
||||||
|
return new CantBeTransferredModifier(self, Filters.and(CardType.POSSESSION, Filters.attachedTo(self)));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected List<ActivateCardAction> getExtraInPlayPhaseActions(final String playerId, LotroGame game, final PhysicalCard self) {
|
||||||
|
if (PlayConditions.canUseFPCardDuringPhase(game, Phase.FELLOWSHIP, self)
|
||||||
|
&& PlayConditions.canPlayFromHand(playerId, game, CardType.POSSESSION, ExtraFilters.attachableTo(game, self))) {
|
||||||
|
final ActivateCardAction action = new ActivateCardAction(self);
|
||||||
|
action.appendCost(
|
||||||
|
new ChooseCardsFromHandEffect(playerId, 1, 1, CardType.POSSESSION, ExtraFilters.attachableTo(game, self)) {
|
||||||
|
@Override
|
||||||
|
protected void cardsSelected(LotroGame game, Collection<PhysicalCard> selectedCards) {
|
||||||
|
for (PhysicalCard selectedCard : selectedCards) {
|
||||||
|
AttachPermanentAction attachPermanentAction = ((AbstractAttachable) selectedCard.getBlueprint()).getPlayCardAction(playerId, game, selectedCard, Filters.and(self), 0);
|
||||||
|
game.getActionsEnvironment().addActionToStack(attachPermanentAction);
|
||||||
|
action.appendEffect(
|
||||||
|
new LiberateASiteEffect(self));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return Collections.singletonList(action);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -227,6 +227,11 @@ public abstract class AbstractModifier implements Modifier {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canBeTransferred(GameState gameState, ModifiersQuerying modifiersQuerying, PhysicalCard attachment) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean shouldSkipPhase(GameState gameState, ModifiersQuerying modifiersQuerying, Phase phase, String playerId) {
|
public boolean shouldSkipPhase(GameState gameState, ModifiersQuerying modifiersQuerying, Phase phase, String playerId) {
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -93,6 +93,8 @@ public interface Modifier {
|
|||||||
|
|
||||||
public boolean canHaveTransferredOn(GameState gameState, ModifiersQuerying modifiersQuerying, PhysicalCard playedCard, PhysicalCard target);
|
public boolean canHaveTransferredOn(GameState gameState, ModifiersQuerying modifiersQuerying, PhysicalCard playedCard, PhysicalCard target);
|
||||||
|
|
||||||
|
public boolean canBeTransferred(GameState gameState, ModifiersQuerying modifiersQuerying, PhysicalCard attachment);
|
||||||
|
|
||||||
public boolean shouldSkipPhase(GameState gameState, ModifiersQuerying modifiersQuerying, Phase phase, String playerId);
|
public boolean shouldSkipPhase(GameState gameState, ModifiersQuerying modifiersQuerying, Phase phase, String playerId);
|
||||||
|
|
||||||
public boolean isValidAssignments(GameState gameState, Side Side, ModifiersQuerying modifiersQuerying, PhysicalCard companion, Set<PhysicalCard> minions);
|
public boolean isValidAssignments(GameState gameState, Side Side, ModifiersQuerying modifiersQuerying, PhysicalCard companion, Set<PhysicalCard> minions);
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ public enum ModifierEffect {
|
|||||||
VITALITY_MODIFIER, RESISTANCE_MODIFIER, SITE_NUMBER_MODIFIER, TWILIGHT_COST_MODIFIER, OVERWHELM_MODIFIER,
|
VITALITY_MODIFIER, RESISTANCE_MODIFIER, SITE_NUMBER_MODIFIER, TWILIGHT_COST_MODIFIER, OVERWHELM_MODIFIER,
|
||||||
WOUND_MODIFIER, BURDEN_MODIFIER, THREAT_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,
|
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, RETURN_TO_HAND_MODIFIER,
|
LOOK_OR_REVEAL_MODIFIER, SPOT_MODIFIER, TARGET_MODIFIER, RETURN_TO_HAND_MODIFIER, TRANSFER_MODIFIER,
|
||||||
|
|
||||||
EXTRA_ACTION_MODIFIER, EXTRA_COST_MODIFIER,
|
EXTRA_ACTION_MODIFIER, EXTRA_COST_MODIFIER,
|
||||||
INITIATIVE_MODIFIER, TEXT_MODIFIER,
|
INITIATIVE_MODIFIER, TEXT_MODIFIER,
|
||||||
|
|||||||
@@ -628,6 +628,14 @@ public class ModifiersLogic implements ModifiersEnvironment, ModifiersQuerying {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canBeTransferred(GameState gameState, PhysicalCard attachment) {
|
||||||
|
for (Modifier modifier : getModifiersAffectingCard(gameState, ModifierEffect.TRANSFER_MODIFIER, attachment))
|
||||||
|
if (!modifier.canBeTransferred(gameState, this, attachment))
|
||||||
|
return false;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean shouldSkipPhase(GameState gameState, Phase phase, String playerId) {
|
public boolean shouldSkipPhase(GameState gameState, Phase phase, String playerId) {
|
||||||
for (Modifier modifier : getModifiers(gameState, ModifierEffect.ACTION_MODIFIER))
|
for (Modifier modifier : getModifiers(gameState, ModifierEffect.ACTION_MODIFIER))
|
||||||
|
|||||||
@@ -90,6 +90,8 @@ public interface ModifiersQuerying {
|
|||||||
|
|
||||||
public boolean canHaveTransferredOn(GameState gameState, PhysicalCard playedCard, PhysicalCard target);
|
public boolean canHaveTransferredOn(GameState gameState, PhysicalCard playedCard, PhysicalCard target);
|
||||||
|
|
||||||
|
public boolean canBeTransferred(GameState gameState, PhysicalCard attachment);
|
||||||
|
|
||||||
public boolean shouldSkipPhase(GameState gameState, Phase phase, String playerId);
|
public boolean shouldSkipPhase(GameState gameState, Phase phase, String playerId);
|
||||||
|
|
||||||
public List<? extends ActivateCardAction> getExtraPhaseActions(GameState gameState, PhysicalCard target);
|
public List<? extends ActivateCardAction> getExtraPhaseActions(GameState gameState, PhysicalCard target);
|
||||||
|
|||||||
Reference in New Issue
Block a user