Fiddling with effects.

This commit is contained in:
marcins78@gmail.com
2011-10-14 12:50:47 +00:00
parent 49771c10be
commit e2c5391d49
3 changed files with 9 additions and 6 deletions

View File

@@ -25,7 +25,7 @@ public class AddTokenEffect extends AbstractEffect {
@Override
public boolean isPlayableInFull(LotroGame game) {
return true;
return _target.getZone().isInPlay();
}
@Override
@@ -40,8 +40,11 @@ public class AddTokenEffect extends AbstractEffect {
@Override
protected FullEffectResult playEffectReturningResult(LotroGame game) {
game.getGameState().addTokens(_target, _token, _count);
if (isPlayableInFull(game)) {
game.getGameState().addTokens(_target, _token, _count);
return new FullEffectResult(null, true, true);
return new FullEffectResult(null, true, true);
}
return new FullEffectResult(null, false, false);
}
}

View File

@@ -1,6 +1,5 @@
package com.gempukku.lotro.cards.effects;
import com.gempukku.lotro.cards.PlayConditions;
import com.gempukku.lotro.game.PhysicalCard;
import com.gempukku.lotro.game.state.GameState;
import com.gempukku.lotro.game.state.LotroGame;
@@ -18,7 +17,7 @@ public class AttachCardEffect extends AbstractEffect {
@Override
public boolean isPlayableInFull(LotroGame game) {
return !PlayConditions.nonPlayZone(_targetCard.getZone())
return _targetCard.getZone().isInPlay()
&& game.getModifiersQuerying().canHavePlayedOn(game.getGameState(), _physicalCard, _targetCard);
}

View File

@@ -42,7 +42,8 @@ public class Card4_155 extends AbstractResponseEvent {
&& PlayConditions.canExert(self, game, Filters.name("Grima"))) {
ActivateCardEffect activateEffect = (ActivateCardEffect) effect;
final PhysicalCard source = activateEffect.getSource();
if (Filters.or(Filters.unboundCompanion(), Filters.type(CardType.ALLY)).accepts(game.getGameState(), game.getModifiersQuerying(), source)) {
if (!activateEffect.isCancelled()
&& Filters.or(Filters.unboundCompanion(), Filters.type(CardType.ALLY)).accepts(game.getGameState(), game.getModifiersQuerying(), source)) {
PlayEventAction action = new PlayEventAction(self);
action.appendCost(
new ChooseAndExertCharactersEffect(action, playerId, 1, 1, Filters.name("Grima")));