Simplifying how multiple characters wounding works.

This commit is contained in:
marcins78@gmail.com
2011-09-20 14:53:06 +00:00
parent 8ce103ca33
commit 5db7562cde
7 changed files with 23 additions and 28 deletions

View File

@@ -49,8 +49,9 @@ public class Card1_019 extends AbstractEvent {
@Override
protected void cardsSelected(List<PhysicalCard> cards) {
if (cards.size() == 2) {
action.addEffect(new WoundCharacterEffect(playerId, cards.get(0)));
action.addEffect(new WoundCharacterEffect(playerId, cards.get(1)));
action.addEffect(
new WoundCharacterEffect(playerId,
Filters.or(Filters.sameCard(cards.get(0)), Filters.sameCard(cards.get(1)))));
} else {
action.addEffect(new WoundCharacterEffect(playerId, cards.get(0)));
action.addEffect(new WoundCharacterEffect(playerId, cards.get(0)));

View File

@@ -9,8 +9,6 @@ import com.gempukku.lotro.game.PhysicalCard;
import com.gempukku.lotro.game.state.LotroGame;
import com.gempukku.lotro.logic.effects.WoundCharacterEffect;
import java.util.List;
/**
* Set: The Fellowship of the Ring
* Side: Free
@@ -29,9 +27,8 @@ public class Card1_111 extends AbstractEvent {
PlayEventAction action = new PlayEventAction(self);
action.addCost(
new ChooseAndExertCharacterEffect(action, playerId, "Choose a ranger", true, Filters.keyword(Keyword.RANGER), Filters.canExert()));
List<PhysicalCard> minions = Filters.filterActive(game.getGameState(), game.getModifiersQuerying(), Filters.type(CardType.MINION));
for (PhysicalCard minion : minions)
action.addEffect(new WoundCharacterEffect(playerId, minion));
action.addEffect(
new WoundCharacterEffect(playerId, Filters.type(CardType.MINION)));
return action;
}

View File

@@ -3,10 +3,8 @@ package com.gempukku.lotro.cards.set1.shire;
import com.gempukku.lotro.cards.AbstractEvent;
import com.gempukku.lotro.cards.actions.PlayEventAction;
import com.gempukku.lotro.cards.effects.AddBurdenEffect;
import com.gempukku.lotro.common.Culture;
import com.gempukku.lotro.common.Keyword;
import com.gempukku.lotro.common.Phase;
import com.gempukku.lotro.common.Side;
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.game.state.Skirmish;
@@ -37,9 +35,8 @@ public class Card1_308 extends AbstractEvent {
Skirmish skirmish = game.getGameState().getSkirmish();
if (skirmish != null) {
if (game.getModifiersQuerying().hasKeyword(game.getGameState(), skirmish.getFellowshipCharacter(), Keyword.RING_BEARER)) {
for (PhysicalCard minion : skirmish.getShadowCharacters()) {
action.addEffect(new WoundCharacterEffect(playerId, minion));
}
action.addEffect(
new WoundCharacterEffect(playerId, Filters.and(Filters.type(CardType.MINION), Filters.inSkirmish())));
}
}
return action;

View File

@@ -9,8 +9,6 @@ import com.gempukku.lotro.game.PhysicalCard;
import com.gempukku.lotro.game.state.LotroGame;
import com.gempukku.lotro.logic.effects.WoundCharacterEffect;
import java.util.List;
/**
* Set: The Fellowship of the Ring
* Side: Shadow
@@ -35,9 +33,8 @@ public class Card1_223 extends AbstractEvent {
PlayEventAction action = new PlayEventAction(self);
action.addCost(
new ChooseAndExertCharacterEffect(action, playerId, "Choose a Nazgul", true, Filters.race(Race.NAZGUL), Filters.canExert()));
List<PhysicalCard> archers = Filters.filterActive(game.getGameState(), game.getModifiersQuerying(), Filters.type(CardType.COMPANION), Filters.keyword(Keyword.ARCHER));
for (PhysicalCard archer : archers)
action.addEffect(new WoundCharacterEffect(playerId, archer));
action.addEffect(
new WoundCharacterEffect(playerId, Filters.and(Filters.type(CardType.COMPANION), Filters.keyword(Keyword.ARCHER))));
return action;
}

View File

@@ -9,8 +9,6 @@ import com.gempukku.lotro.game.PhysicalCard;
import com.gempukku.lotro.game.state.LotroGame;
import com.gempukku.lotro.logic.effects.WoundCharacterEffect;
import java.util.List;
/**
* Set: The Fellowship of the Ring
* Side: Shadow
@@ -35,10 +33,8 @@ public class Card1_226 extends AbstractEvent {
PlayEventAction action = new PlayEventAction(self);
action.addCost(
new ChooseAndExertCharacterEffect(action, playerId, "Choose a Nazgul", true, Filters.race(Race.NAZGUL), Filters.canExert()));
List<PhysicalCard> allies = Filters.filterActive(game.getGameState(), game.getModifiersQuerying(), Filters.type(CardType.ALLY));
for (PhysicalCard ally : allies)
action.addEffect(
new WoundCharacterEffect(playerId, ally));
action.addEffect(
new WoundCharacterEffect(playerId, Filters.type(CardType.ALLY)));
return action;
}

View File

@@ -1,5 +1,6 @@
package com.gempukku.lotro.logic.actions;
import com.gempukku.lotro.filters.Filter;
import com.gempukku.lotro.game.PhysicalCard;
import com.gempukku.lotro.logic.effects.WoundCharacterEffect;
@@ -9,4 +10,10 @@ public class WoundAction extends DefaultCostToEffectAction {
for (int i = 0; i < wounds; i++)
addEffect(new WoundCharacterEffect(playerId, card));
}
public WoundAction(String playerId, Filter filter, int wounds) {
super(null, null, "Wound character(s)");
for (int i = 0; i < wounds; i++)
addEffect(new WoundCharacterEffect(playerId, filter));
}
}

View File

@@ -1,6 +1,7 @@
package com.gempukku.lotro.logic.timing.rules;
import com.gempukku.lotro.common.Keyword;
import com.gempukku.lotro.filters.Filters;
import com.gempukku.lotro.game.AbstractActionProxy;
import com.gempukku.lotro.game.PhysicalCard;
import com.gempukku.lotro.game.state.GameState;
@@ -43,9 +44,8 @@ public class ResolveSkirmishRule {
List<PhysicalCard> losers = skirmishResult.getLosers();
List<Action> actions = new LinkedList<Action>();
for (PhysicalCard loser : losers) {
actions.add(new WoundAction(loser.getOwner(), loser, dmg));
}
actions.add(new WoundAction(winners.get(0).getOwner(), Filters.in(losers), dmg));
return actions;
} else if (effectResult.getType() == EffectResult.Type.OVERWHELM_IN_SKIRMISH) {
OverwhelmSkirmishResult skirmishResult = (OverwhelmSkirmishResult) effectResult;