Fixing assignment effects.

This commit is contained in:
marcins78@gmail.com
2011-10-12 18:32:30 +00:00
parent 8d473a28ca
commit db68907414
12 changed files with 35 additions and 41 deletions

View File

@@ -9,8 +9,6 @@ import com.gempukku.lotro.game.state.LotroGame;
import com.gempukku.lotro.logic.effects.AssignmentEffect;
import com.gempukku.lotro.logic.effects.ChooseActiveCardEffect;
import java.util.Collections;
/**
* Set: The Fellowship of the Ring
* Side: Shadow
@@ -35,13 +33,13 @@ public class Card1_169 extends AbstractEvent {
final PlayEventAction action = new PlayEventAction(self);
final PhysicalCard ringBearer = game.getGameState().getRingBearer(game.getGameState().getCurrentPlayerId());
if (Filters.filterActive(game.getGameState(), game.getModifiersQuerying(), Filters.keyword(Keyword.RING_BEARER), Filters.notAssignedToSkirmish(), Filters.canBeAssignedToSkirmish(Side.SHADOW)).size() > 0) {
if (Filters.filterActive(game.getGameState(), game.getModifiersQuerying(), Filters.keyword(Keyword.RING_BEARER), Filters.canBeAssignedToSkirmishByEffect(Side.SHADOW)).size() > 0) {
action.appendEffect(
new ChooseActiveCardEffect(self, game.getGameState().getCurrentPlayerId(), "Choose minion to assign Ring-Bearer to", Filters.type(CardType.MINION), Filters.canBeAssignedToSkirmish(Side.SHADOW)) {
new ChooseActiveCardEffect(self, game.getGameState().getCurrentPlayerId(), "Choose minion to assign Ring-Bearer to", Filters.type(CardType.MINION), Filters.canBeAssignedToSkirmishByEffect(Side.SHADOW)) {
@Override
protected void cardSelected(PhysicalCard minion) {
action.appendEffect(
new AssignmentEffect(playerId, ringBearer, Collections.singletonList(minion)));
new AssignmentEffect(playerId, ringBearer, minion));
}
});
}

View File

@@ -9,8 +9,6 @@ import com.gempukku.lotro.game.state.LotroGame;
import com.gempukku.lotro.logic.effects.AssignmentEffect;
import com.gempukku.lotro.logic.effects.ChooseActiveCardEffect;
import java.util.Collections;
/**
* Set: The Fellowship of the Ring
* Side: Shadow
@@ -28,15 +26,15 @@ public class Card1_171 extends AbstractEvent {
public PlayEventAction getPlayCardAction(final String playerId, final LotroGame game, final PhysicalCard self, int twilightModifier) {
final PlayEventAction action = new PlayEventAction(self);
action.appendEffect(
new ChooseActiveCardEffect(self, playerId, "Choose exhausted companion", Filters.type(CardType.COMPANION), Filters.exhausted(), Filters.notAssignedToSkirmish(), Filters.canBeAssignedToSkirmish(Side.SHADOW)) {
new ChooseActiveCardEffect(self, playerId, "Choose exhausted companion", Filters.type(CardType.COMPANION), Filters.exhausted(), Filters.canBeAssignedToSkirmishByEffect(Side.SHADOW)) {
@Override
protected void cardSelected(final PhysicalCard companion) {
action.appendEffect(
new ChooseActiveCardEffect(self, playerId, "Choose MORIA Orc", Filters.culture(Culture.MORIA), Filters.race(Race.ORC), Filters.notAssignedToSkirmish(), Filters.canBeAssignedToSkirmish(Side.SHADOW)) {
new ChooseActiveCardEffect(self, playerId, "Choose MORIA Orc", Filters.culture(Culture.MORIA), Filters.race(Race.ORC), Filters.canBeAssignedToSkirmishByEffect(Side.SHADOW)) {
@Override
protected void cardSelected(PhysicalCard moriaOrc) {
action.appendEffect(
new AssignmentEffect(playerId, companion, Collections.singletonList(moriaOrc)));
new AssignmentEffect(playerId, companion, moriaOrc));
}
});
}

View File

@@ -46,10 +46,10 @@ public class Card1_262 extends AbstractMinion {
&& Filters.canSpot(game.getGameState(), game.getModifiersQuerying(), Filters.sameCard(self), Filters.notAssignedToSkirmish(), Filters.canBeAssignedToSkirmish(Side.SHADOW))) {
final ActivateCardAction action = new ActivateCardAction(self);
action.appendEffect(
new ChooseActiveCardEffect(self, game.getGameState().getCurrentPlayerId(), "Choose a Hobbit", Filters.race(Race.HOBBIT), Filters.notAssignedToSkirmish(), Filters.type(CardType.COMPANION), Filters.canBeAssignedToSkirmish(Side.SHADOW)) {
new ChooseActiveCardEffect(self, game.getGameState().getCurrentPlayerId(), "Choose a Hobbit", Filters.race(Race.HOBBIT), Filters.type(CardType.COMPANION), Filters.canBeAssignedToSkirmishByEffect(Side.SHADOW)) {
@Override
protected void cardSelected(PhysicalCard hobbit) {
action.appendEffect(new AssignmentEffect(hobbit.getOwner(), hobbit, Collections.singletonList(self)));
action.appendEffect(new AssignmentEffect(hobbit.getOwner(), hobbit, self));
}
});
return Collections.singletonList(action);

View File

@@ -49,13 +49,13 @@ public class Card1_224 extends AbstractResponseEvent {
for (Skirmish assignment : assignments)
game.getGameState().removeAssignment(assignment);
if (Filters.countActive(game.getGameState(), game.getModifiersQuerying(), Filters.keyword(Keyword.RING_BEARER), Filters.canBeAssignedToSkirmish(Side.SHADOW)) > 0) {
if (Filters.countActive(game.getGameState(), game.getModifiersQuerying(), Filters.keyword(Keyword.RING_BEARER), Filters.canBeAssignedToSkirmishByEffect(Side.SHADOW)) > 0) {
action.appendEffect(
new ChooseActiveCardEffect(self, playerId, "Choose a Nazgul to skirmish the Ring-Bearer", Filters.race(Race.NAZGUL)) {
new ChooseActiveCardEffect(self, playerId, "Choose a Nazgul to skirmish the Ring-Bearer", Filters.race(Race.NAZGUL), Filters.canBeAssignedToSkirmishByEffect(Side.SHADOW)) {
@Override
protected void cardSelected(PhysicalCard nazgul) {
PhysicalCard ringBearer = game.getGameState().getRingBearer(game.getGameState().getCurrentPlayerId());
action.appendEffect(new AssignmentEffect(playerId, ringBearer, Collections.singletonList(nazgul)));
action.appendEffect(new AssignmentEffect(playerId, ringBearer, nazgul));
action.appendEffect(
new AddUntilEndOfPhaseModifierEffect(
new SpecialFlagModifier(self, ModifierFlag.RING_TEXT_INACTIVE), Phase.SKIRMISH));

View File

@@ -37,13 +37,13 @@ public class Card1_236 extends AbstractMinion {
if (PlayConditions.canUseShadowCardDuringPhase(game.getGameState(), Phase.ASSIGNMENT, self, 0)
&& game.getGameState().getBurdens() >= 4) {
final ActivateCardAction action = new ActivateCardAction(self);
if (Filters.canSpot(game.getGameState(), game.getModifiersQuerying(), Filters.sameCard(self), Filters.notAssignedToSkirmish(), Filters.canBeAssignedToSkirmish(Side.SHADOW))) {
if (Filters.canSpot(game.getGameState(), game.getModifiersQuerying(), Filters.sameCard(self), Filters.canBeAssignedToSkirmishByEffect(Side.SHADOW))) {
action.appendEffect(
new ChooseActiveCardEffect(self, playerId, "Choose a companion (except the Ring-Bearer", Filters.type(CardType.COMPANION), Filters.notAssignedToSkirmish(), Filters.not(Filters.keyword(Keyword.RING_BEARER)), Filters.canBeAssignedToSkirmish(Side.SHADOW)) {
new ChooseActiveCardEffect(self, playerId, "Choose a companion (except the Ring-Bearer)", Filters.type(CardType.COMPANION), Filters.not(Filters.keyword(Keyword.RING_BEARER)), Filters.canBeAssignedToSkirmishByEffect(Side.SHADOW)) {
@Override
protected void cardSelected(PhysicalCard companion) {
action.appendEffect(
new AssignmentEffect(playerId, companion, Collections.singletonList(self)));
new AssignmentEffect(playerId, companion, self));
}
});
}

View File

@@ -82,17 +82,17 @@ public class Card3_069 extends AbstractMinion {
action.appendCost(
new ExertCharactersEffect(self, self));
action.appendEffect(
new ChooseActiveCardEffect(self, playerId, "Choose ISENGARD minion", Filters.culture(Culture.ISENGARD), Filters.type(CardType.MINION), Filters.notAssignedToSkirmish(), Filters.canBeAssignedToSkirmish(Side.SHADOW)) {
new ChooseActiveCardEffect(self, playerId, "Choose ISENGARD minion", Filters.culture(Culture.ISENGARD), Filters.type(CardType.MINION), Filters.canBeAssignedToSkirmishByEffect(Side.SHADOW)) {
@Override
protected void cardSelected(final PhysicalCard minion) {
action.appendEffect(
new ChooseActiveCardEffect(self, playerId, "Choose non Ring-bearer companion", Filters.type(CardType.COMPANION), Filters.notAssignedToSkirmish(), Filters.not(Filters.keyword(Keyword.RING_BEARER)), Filters.canBeAssignedToSkirmish(Side.SHADOW)) {
new ChooseActiveCardEffect(self, playerId, "Choose non Ring-bearer companion", Filters.type(CardType.COMPANION), Filters.not(Filters.keyword(Keyword.RING_BEARER)), Filters.canBeAssignedToSkirmishByEffect(Side.SHADOW)) {
@Override
protected void cardSelected(PhysicalCard companion) {
action.appendEffect(
new PreventableEffect(
action,
new AssignmentEffect(playerId, companion, Collections.singletonList(minion)),
new AssignmentEffect(playerId, companion, minion),
Collections.singletonList(game.getGameState().getCurrentPlayerId()),
new ExertCharactersEffect(self, companion)));
}

View File

@@ -48,14 +48,14 @@ public class Card4_015 extends AbstractMinion {
@Override
protected List<? extends Action> getExtraPhaseActions(final String playerId, LotroGame game, final PhysicalCard self) {
if (PlayConditions.canUseShadowCardDuringPhase(game.getGameState(), Phase.ASSIGNMENT, self, 0)
&& Filters.canSpot(game.getGameState(), game.getModifiersQuerying(), Filters.type(CardType.ALLY), Filters.notAssignedToSkirmish(), Filters.canBeAssignedToSkirmish(Side.SHADOW))) {
&& Filters.canSpot(game.getGameState(), game.getModifiersQuerying(), Filters.type(CardType.ALLY), Filters.canBeAssignedToSkirmishByEffect(Side.SHADOW))) {
final ActivateCardAction action = new ActivateCardAction(self);
action.appendEffect(
new ChooseActiveCardEffect(self, playerId, "Choose an ally", Filters.type(CardType.ALLY), Filters.notAssignedToSkirmish(), Filters.canBeAssignedToSkirmish(Side.SHADOW)) {
new ChooseActiveCardEffect(self, playerId, "Choose an ally", Filters.type(CardType.ALLY), Filters.canBeAssignedToSkirmishByEffect(Side.SHADOW)) {
@Override
protected void cardSelected(PhysicalCard ally) {
action.appendEffect(
new AssignmentEffect(playerId, ally, Collections.singletonList(self)));
new AssignmentEffect(playerId, ally, self));
}
});
return Collections.singletonList(action);

View File

@@ -34,14 +34,14 @@ public class Card4_018 extends AbstractMinion {
@Override
protected List<? extends Action> getExtraPhaseActions(final String playerId, LotroGame game, final PhysicalCard self) {
if (PlayConditions.canUseShadowCardDuringPhase(game.getGameState(), Phase.ASSIGNMENT, self, 0)
&& Filters.canSpot(game.getGameState(), game.getModifiersQuerying(), Filters.type(CardType.ALLY), Filters.notAssignedToSkirmish(), Filters.canBeAssignedToSkirmish(Side.SHADOW))) {
&& Filters.canSpot(game.getGameState(), game.getModifiersQuerying(), Filters.type(CardType.ALLY), Filters.canBeAssignedToSkirmishByEffect(Side.SHADOW))) {
final ActivateCardAction action = new ActivateCardAction(self);
action.appendEffect(
new ChooseActiveCardEffect(self, playerId, "Choose an ally", Filters.type(CardType.ALLY), Filters.notAssignedToSkirmish(), Filters.canBeAssignedToSkirmish(Side.SHADOW)) {
new ChooseActiveCardEffect(self, playerId, "Choose an ally", Filters.type(CardType.ALLY), Filters.canBeAssignedToSkirmishByEffect(Side.SHADOW)) {
@Override
protected void cardSelected(PhysicalCard ally) {
action.appendEffect(
new AssignmentEffect(playerId, ally, Collections.singletonList(self)));
new AssignmentEffect(playerId, ally, self));
}
});
return Collections.singletonList(action);

View File

@@ -37,15 +37,15 @@ public class Card4_031 extends AbstractPermanent {
action.appendCost(
new RemoveTwilightEffect(2));
action.appendEffect(
new ChooseActiveCardEffect(self, playerId, "Choose DUNLAND Man", Filters.culture(Culture.DUNLAND), Filters.race(Race.MAN), Filters.notAssignedToSkirmish(), Filters.canBeAssignedToSkirmish(Side.SHADOW)) {
new ChooseActiveCardEffect(self, playerId, "Choose DUNLAND Man", Filters.culture(Culture.DUNLAND), Filters.race(Race.MAN), Filters.canBeAssignedToSkirmishByEffect(Side.SHADOW)) {
@Override
protected void cardSelected(final PhysicalCard dunlandMan) {
action.insertEffect(
new ChooseActiveCardEffect(self, playerId, "Choose unbound companion", Filters.unboundCompanion(), Filters.notAssignedToSkirmish(), Filters.canBeAssignedToSkirmish(Side.SHADOW)) {
new ChooseActiveCardEffect(self, playerId, "Choose unbound companion", Filters.unboundCompanion(), Filters.canBeAssignedToSkirmishByEffect(Side.SHADOW)) {
@Override
protected void cardSelected(PhysicalCard unboundCompanion) {
action.insertEffect(
new AssignmentEffect(playerId, unboundCompanion, Collections.singletonList(dunlandMan)));
new AssignmentEffect(playerId, unboundCompanion, dunlandMan));
}
});
}

View File

@@ -13,8 +13,6 @@ import com.gempukku.lotro.game.state.LotroGame;
import com.gempukku.lotro.logic.effects.AssignmentEffect;
import com.gempukku.lotro.logic.effects.ChooseActiveCardEffect;
import java.util.Collections;
/**
* Set: The Two Towers
* Side: Shadow
@@ -45,15 +43,15 @@ public class Card4_143 extends AbstractEvent {
public PlayEventAction getPlayCardAction(final String playerId, final LotroGame game, final PhysicalCard self, int twilightModifier) {
final PlayEventAction action = new PlayEventAction(self);
action.appendCost(
new ChooseAndExertCharactersEffect(action, playerId, 1, 1, Filters.culture(Culture.ISENGARD), Filters.keyword(Keyword.TRACKER), Filters.notAssignedToSkirmish(), Filters.canBeAssignedToSkirmish(Side.SHADOW)) {
new ChooseAndExertCharactersEffect(action, playerId, 1, 1, Filters.culture(Culture.ISENGARD), Filters.keyword(Keyword.TRACKER), Filters.canBeAssignedToSkirmishByEffect(Side.SHADOW)) {
@Override
protected void forEachCardExertedCallback(final PhysicalCard minion) {
action.appendEffect(
new ChooseActiveCardEffect(self, playerId, "Choose an unbound companion", Filters.unboundCompanion(), Filters.notAssignedToSkirmish(), Filters.canBeAssignedToSkirmish(Side.SHADOW)) {
new ChooseActiveCardEffect(self, playerId, "Choose an unbound companion", Filters.unboundCompanion(), Filters.canBeAssignedToSkirmishByEffect(Side.SHADOW)) {
@Override
protected void cardSelected(PhysicalCard companion) {
Race race = companion.getBlueprint().getRace();
AssignmentEffect assignmentEffect = new AssignmentEffect(playerId, companion, Collections.singletonList(minion));
AssignmentEffect assignmentEffect = new AssignmentEffect(playerId, companion, minion);
if (race == Race.HOBBIT) {
action.insertEffect(
assignmentEffect);

View File

@@ -66,15 +66,15 @@ public class Card4_159 extends AbstractAttachable {
@Override
protected List<? extends Action> getExtraPhaseActions(final String playerId, final LotroGame game, final PhysicalCard self) {
if (PlayConditions.canUseShadowCardDuringPhase(game.getGameState(), Phase.ASSIGNMENT, self, 2)
&& PlayConditions.canExert(self, game, Filters.culture(Culture.ISENGARD), Filters.keyword(Keyword.TRACKER), Filters.notAssignedToSkirmish(), Filters.canBeAssignedToSkirmish(Side.SHADOW))) {
&& PlayConditions.canExert(self, game, Filters.culture(Culture.ISENGARD), Filters.keyword(Keyword.TRACKER), Filters.canBeAssignedToSkirmishByEffect(Side.SHADOW))) {
final ActivateCardAction action = new ActivateCardAction(self);
action.appendCost(
new ChooseAndExertCharactersEffect(action, playerId, 1, 1, Filters.culture(Culture.ISENGARD), Filters.keyword(Keyword.TRACKER), Filters.notAssignedToSkirmish(), Filters.canBeAssignedToSkirmish(Side.SHADOW)) {
new ChooseAndExertCharactersEffect(action, playerId, 1, 1, Filters.culture(Culture.ISENGARD), Filters.keyword(Keyword.TRACKER), Filters.canBeAssignedToSkirmishByEffect(Side.SHADOW)) {
@Override
protected void forEachCardExertedCallback(PhysicalCard minion) {
action.appendEffect(
new PreventableEffect(action,
new AssignmentEffect(playerId, self.getAttachedTo(), Collections.singletonList(minion)),
new AssignmentEffect(playerId, self.getAttachedTo(), minion),
game.getGameState().getCurrentPlayerId(),
new ExertCharactersEffect(self, self.getAttachedTo())));
}

View File

@@ -38,17 +38,17 @@ public class Card4_164 extends AbstractMinion {
protected List<? extends Action> getExtraPhaseActions(final String playerId, final LotroGame game, final PhysicalCard self) {
if (PlayConditions.canUseShadowCardDuringPhase(game.getGameState(), Phase.ASSIGNMENT, self, 0)
&& PlayConditions.canExert(self, game, Filters.sameCard(self))
&& Filters.and(Filters.notAssignedToSkirmish(), Filters.canBeAssignedToSkirmish(Side.SHADOW)).accepts(game.getGameState(), game.getModifiersQuerying(), self)) {
&& Filters.canBeAssignedToSkirmishByEffect(Side.SHADOW).accepts(game.getGameState(), game.getModifiersQuerying(), self)) {
final ActivateCardAction action = new ActivateCardAction(self);
action.appendCost(
new ExertCharactersEffect(self, self));
action.appendEffect(
new ChooseActiveCardEffect(self, playerId, "Choose unbound companion", Filters.unboundCompanion(), Filters.notAssignedToSkirmish(), Filters.canBeAssignedToSkirmish(Side.SHADOW)) {
new ChooseActiveCardEffect(self, playerId, "Choose unbound companion", Filters.unboundCompanion(), Filters.canBeAssignedToSkirmishByEffect(Side.SHADOW)) {
@Override
protected void cardSelected(PhysicalCard companion) {
action.insertEffect(
new PreventableEffect(action,
new AssignmentEffect(playerId, companion, Collections.singletonList(self)),
new AssignmentEffect(playerId, companion, self),
game.getGameState().getCurrentPlayerId(),
new ExertCharactersEffect(self, companion)));
}