- "Old Noakes" will now trigger only for discarding cards from free player hand.

This commit is contained in:
marcins78@gmail.com
2011-12-26 16:55:40 +00:00
parent 0525e80b41
commit ec112e1cdb
5 changed files with 11 additions and 4 deletions

View File

@@ -49,7 +49,7 @@ public class DiscardCardAtRandomFromHandEffect extends AbstractEffect {
gameState.sendMessage(_playerId + " randomly discards " + GameUtils.getCardLink(randomCard)); gameState.sendMessage(_playerId + " randomly discards " + GameUtils.getCardLink(randomCard));
gameState.removeCardsFromZone(_source.getOwner(), Collections.singleton(randomCard)); gameState.removeCardsFromZone(_source.getOwner(), Collections.singleton(randomCard));
gameState.addCardToZone(game, randomCard, Zone.DISCARD); gameState.addCardToZone(game, randomCard, Zone.DISCARD);
game.getActionsEnvironment().emitEffectResult(new DiscardCardFromHandResult(_source, randomCard, _forced)); game.getActionsEnvironment().emitEffectResult(new DiscardCardFromHandResult(_source, randomCard, _playerId, _forced));
return new FullEffectResult(true, true); return new FullEffectResult(true, true);
} }
return new FullEffectResult(false, false); return new FullEffectResult(false, false);

View File

@@ -34,7 +34,7 @@ public class Card3_111 extends AbstractAlly {
public List<OptionalTriggerAction> getOptionalAfterTriggers(String playerId, LotroGame game, EffectResult effectResult, PhysicalCard self) { public List<OptionalTriggerAction> getOptionalAfterTriggers(String playerId, LotroGame game, EffectResult effectResult, PhysicalCard self) {
if (effectResult.getType() == EffectResult.Type.FOR_EACH_DISCARDED_FROM_HAND) { if (effectResult.getType() == EffectResult.Type.FOR_EACH_DISCARDED_FROM_HAND) {
DiscardCardFromHandResult discardCardsResult = (DiscardCardFromHandResult) effectResult; DiscardCardFromHandResult discardCardsResult = (DiscardCardFromHandResult) effectResult;
if (discardCardsResult.isForced()) { if (discardCardsResult.isForced() && discardCardsResult.getHandPlayerId().equals(playerId)) {
OptionalTriggerAction action = new OptionalTriggerAction(self); OptionalTriggerAction action = new OptionalTriggerAction(self);
action.appendEffect( action.appendEffect(
new ChooseAndDiscardCardsFromPlayEffect(action, playerId, 1, 1, Filters.or(CardType.MINION, Filters.and(Side.SHADOW, CardType.CONDITION)))); new ChooseAndDiscardCardsFromPlayEffect(action, playerId, 1, 1, Filters.or(CardType.MINION, Filters.and(Side.SHADOW, CardType.CONDITION))));

View File

@@ -65,7 +65,7 @@ public class DiscardCardsFromHandEffect extends AbstractEffect {
gameState.removeCardsFromZone(sourcePlayer, discardedCards); gameState.removeCardsFromZone(sourcePlayer, discardedCards);
for (PhysicalCard card : discardedCards) { for (PhysicalCard card : discardedCards) {
gameState.addCardToZone(game, card, Zone.DISCARD); gameState.addCardToZone(game, card, Zone.DISCARD);
game.getActionsEnvironment().emitEffectResult(new DiscardCardFromHandResult(_source, card, _forced)); game.getActionsEnvironment().emitEffectResult(new DiscardCardFromHandResult(_source, card, _playerId, _forced));
} }
return new FullEffectResult(discardedCards.size() == _cards.size(), discardedCards.size() == _cards.size()); return new FullEffectResult(discardedCards.size() == _cards.size(), discardedCards.size() == _cards.size());

View File

@@ -6,12 +6,14 @@ import com.gempukku.lotro.logic.timing.EffectResult;
public class DiscardCardFromHandResult extends EffectResult { public class DiscardCardFromHandResult extends EffectResult {
private PhysicalCard _source; private PhysicalCard _source;
private PhysicalCard _card; private PhysicalCard _card;
private String _handPlayerId;
private boolean _forced; private boolean _forced;
public DiscardCardFromHandResult(PhysicalCard source, PhysicalCard card, boolean forced) { public DiscardCardFromHandResult(PhysicalCard source, PhysicalCard card, String handPlayerId, boolean forced) {
super(Type.FOR_EACH_DISCARDED_FROM_HAND); super(Type.FOR_EACH_DISCARDED_FROM_HAND);
_source = source; _source = source;
_card = card; _card = card;
_handPlayerId = handPlayerId;
_forced = forced; _forced = forced;
} }
@@ -22,4 +24,8 @@ public class DiscardCardFromHandResult extends EffectResult {
public boolean isForced() { public boolean isForced() {
return _forced; return _forced;
} }
public String getHandPlayerId() {
return _handPlayerId;
}
} }

View File

@@ -2,6 +2,7 @@
<b>26 Dec. 2011</b> <b>26 Dec. 2011</b>
- "Wizard Storm" should now work when fellowship moves from the site it's attached to. - "Wizard Storm" should now work when fellowship moves from the site it's attached to.
- "Courtesy of My Hall" should be able to discard a hard from it now to heal a dwarf. - "Courtesy of My Hall" should be able to discard a hard from it now to heal a dwarf.
- "Old Noakes" will now trigger only for discarding cards from free player hand.
<b>22 Dec. 2011</b> <b>22 Dec. 2011</b>
- "Valley of the Silverlode" should not correctly allow to heal every Hobbit companion. - "Valley of the Silverlode" should not correctly allow to heal every Hobbit companion.