- "Rabbit Stew" can now be transferred to non-SHIRE companion.

This commit is contained in:
marcins78@gmail.com
2012-04-23 22:59:23 +00:00
parent fc14cf3c99
commit e9c91c3818
3 changed files with 30 additions and 11 deletions

View File

@@ -24,10 +24,16 @@ public class ChooseAndTransferAttachableEffect extends AbstractEffect {
private Filterable _attachedTo;
private Filterable _attachedCard;
private Filterable _transferTo;
private boolean _skipOriginalTargetCheck;
public ChooseAndTransferAttachableEffect(Action action, String playerId, Filterable attachedCard, Filterable attachedTo, Filterable transferTo) {
this(action, playerId, false, attachedCard, attachedTo, transferTo);
}
public ChooseAndTransferAttachableEffect(Action action, String playerId, boolean skipOriginalTargetCheck, Filterable attachedCard, Filterable attachedTo, Filterable transferTo) {
_action = action;
_playerId = playerId;
_skipOriginalTargetCheck = skipOriginalTargetCheck;
_attachedCard = attachedCard;
_attachedTo = attachedTo;
_transferTo = transferTo;
@@ -44,16 +50,28 @@ public class ChooseAndTransferAttachableEffect extends AbstractEffect {
}
protected Filterable getValidTargetFilter(LotroGame game, final PhysicalCard attachment, AbstractAttachable attachable) {
return Filters.and(
_transferTo,
attachable.getFullValidTargetFilter(attachment.getOwner(), game, attachment),
Filters.not(attachment.getAttachedTo()),
new Filter() {
@Override
public boolean accepts(GameState gameState, ModifiersQuerying modifiersQuerying, PhysicalCard target) {
return modifiersQuerying.canHaveTransferredOn(gameState, attachment, target);
}
});
if (_skipOriginalTargetCheck) {
return Filters.and(
_transferTo,
Filters.not(attachment.getAttachedTo()),
new Filter() {
@Override
public boolean accepts(GameState gameState, ModifiersQuerying modifiersQuerying, PhysicalCard target) {
return modifiersQuerying.canHaveTransferredOn(gameState, attachment, target);
}
});
} else {
return Filters.and(
_transferTo,
attachable.getFullValidTargetFilter(attachment.getOwner(), game, attachment),
Filters.not(attachment.getAttachedTo()),
new Filter() {
@Override
public boolean accepts(GameState gameState, ModifiersQuerying modifiersQuerying, PhysicalCard target) {
return modifiersQuerying.canHaveTransferredOn(gameState, attachment, target);
}
});
}
}
protected Collection<PhysicalCard> getPossibleAttachmentsToTransfer(final LotroGame game) {

View File

@@ -40,7 +40,7 @@ public class Card19_031 extends AbstractAttachable {
if (TriggerConditions.winsSkirmish(game, effectResult, self.getAttachedTo())) {
OptionalTriggerAction action = new OptionalTriggerAction(self);
action.appendEffect(
new ChooseAndTransferAttachableEffect(action, playerId, self, Filters.any, Filters.and(Keyword.FELLOWSHIP, CardType.COMPANION)));
new ChooseAndTransferAttachableEffect(action, playerId, true, self, Filters.any, Filters.and(Keyword.FELLOWSHIP, CardType.COMPANION)));
return Collections.singletonList(action);
}
return null;

View File

@@ -2,6 +2,7 @@
<b>23 Apr. 2012</b>
- Adding 0 threats is now possible and legal, hence playing "Plotting" will not fail now, if you can't add any threats
anymore (number of threats is equal to or greater than number of companions).
- "Rabbit Stew" can now be transferred to non-SHIRE companion.
<b>19 Apr. 2012</b>
- "Rope and Winch" now adds +2 Strength, instead of +1 for each extra card discarded.