- When instructed to choose a card to heal/wound X times, a card with vitality/wounds <X can be chosen, as long as

that character can be healed/wounded by the card at least once.
This commit is contained in:
marcins78@gmail.com
2011-11-30 20:11:53 +00:00
parent 92e897c7c6
commit 6d0a9b8ec0
9 changed files with 35 additions and 10 deletions

View File

@@ -25,7 +25,7 @@ public class ChooseAndAssignCharacterToMinionEffect extends ChooseActiveCardEffe
}
@Override
protected Filter getExtraFilter(final LotroGame game) {
protected Filter getExtraFilterForPlaying(final LotroGame game) {
final Side side = game.getGameState().getCurrentPlayerId().equals(_playerId) ? Side.FREE_PEOPLE : Side.SHADOW;
return Filters.canBeAssignedToSkirmishByEffectAgainst(side, _minion);
}

View File

@@ -26,7 +26,7 @@ public class ChooseAndAssignMinionToCompanionEffect extends ChooseActiveCardEffe
}
@Override
protected Filter getExtraFilter(final LotroGame game) {
protected Filter getExtraFilterForPlaying(final LotroGame game) {
final Side side = game.getGameState().getCurrentPlayerId().equals(_playerId) ? Side.FREE_PEOPLE : Side.SHADOW;
return Filters.and(
CardType.MINION,

View File

@@ -30,7 +30,7 @@ public class ChooseAndExertCharactersEffect extends ChooseActiveCardsEffect {
}
@Override
protected Filter getExtraFilter(LotroGame game) {
protected Filter getExtraFilterForPlaying(LotroGame game) {
return new Filter() {
@Override
public boolean accepts(GameState gameState, ModifiersQuerying modifiersQuerying, PhysicalCard physicalCard) {

View File

@@ -23,7 +23,7 @@ public class ChooseAndExhaustCharactersEffect extends ChooseActiveCardsEffect {
}
@Override
protected Filter getExtraFilter(LotroGame game) {
protected Filter getExtraFilterForPlaying(LotroGame game) {
return new Filter() {
@Override
public boolean accepts(GameState gameState, ModifiersQuerying modifiersQuerying, PhysicalCard physicalCard) {

View File

@@ -19,7 +19,7 @@ public class ChooseAndRemoveCultureTokensFromCardEffect extends ChooseActiveCard
}
@Override
protected Filter getExtraFilter(LotroGame game) {
protected Filter getExtraFilterForPlaying(LotroGame game) {
if (_token != null)
return Filters.hasToken(_token, _count);
else

View File

@@ -40,13 +40,17 @@ public abstract class ChooseActiveCardsEffect extends AbstractEffect {
_choiceText = choiceText;
}
protected Filter getExtraFilter(LotroGame game) {
protected Filter getExtraFilterForPlaying(LotroGame game) {
return Filters.any;
}
protected Filter getExtraFilterForPlayabilityCheck(LotroGame game) {
return getExtraFilterForPlaying(game);
}
@Override
public boolean isPlayableInFull(LotroGame game) {
return Filters.countActive(game.getGameState(), game.getModifiersQuerying(), Filters.and(_filters, getExtraFilter(game))) >= _minimum;
return Filters.countActive(game.getGameState(), game.getModifiersQuerying(), Filters.and(_filters, getExtraFilterForPlayabilityCheck(game))) >= _minimum;
}
@Override
@@ -61,7 +65,7 @@ public abstract class ChooseActiveCardsEffect extends AbstractEffect {
@Override
protected FullEffectResult playEffectReturningResult(final LotroGame game) {
final Collection<PhysicalCard> matchingCards = Filters.filterActive(game.getGameState(), game.getModifiersQuerying(), Filters.and(_filters, getExtraFilter(game)));
final Collection<PhysicalCard> matchingCards = Filters.filterActive(game.getGameState(), game.getModifiersQuerying(), Filters.and(_filters, getExtraFilterForPlaying(game)));
int minimum = _minimum;
if (matchingCards.size() < minimum)

View File

@@ -33,7 +33,19 @@ public class ChooseAndHealCharactersEffect extends ChooseActiveCardsEffect {
}
@Override
protected Filter getExtraFilter(LotroGame game) {
protected Filter getExtraFilterForPlayabilityCheck(LotroGame game) {
return Filters.and(
Filters.hasWounds(_count),
new Filter() {
@Override
public boolean accepts(GameState gameState, ModifiersQuerying modifiersQuerying, PhysicalCard physicalCard) {
return modifiersQuerying.canBeHealed(gameState, physicalCard);
}
});
}
@Override
protected Filter getExtraFilterForPlaying(LotroGame game) {
return Filters.and(
Filters.wounded,
new Filter() {

View File

@@ -31,7 +31,12 @@ public class ChooseAndWoundCharactersEffect extends ChooseActiveCardsEffect {
}
@Override
protected Filter getExtraFilter(LotroGame game) {
protected Filter getExtraFilterForPlaying(LotroGame game) {
return Filters.canTakeWound;
}
@Override
protected Filter getExtraFilterForPlayabilityCheck(LotroGame game) {
return Filters.canTakeWounds(_count);
}

View File

@@ -1,4 +1,8 @@
<pre style="font-size:80%">
<b>30 Nov. 2011</b>
- When instructed to choose a card to heal/wound X times, a card with vitality/wounds &lt;X can be chosen, as long as
that character can be healed/wounded by the card at least once.
<b>27 Nov. 2011</b>
- Characters should not die between turns.
- "Great Hill Troll" site number is 5 now.