"Lightfootedness|

This commit is contained in:
marcins78@gmail.com
2011-08-29 14:22:06 +00:00
parent e68127044b
commit 287c763002
5 changed files with 63 additions and 4 deletions

View File

@@ -10,8 +10,8 @@ public class ArcheryTotalModifier extends AbstractModifier {
private Side _side; private Side _side;
private int _modifier; private int _modifier;
public ArcheryTotalModifier(PhysicalCard source, String text, Side side, int modifier) { public ArcheryTotalModifier(PhysicalCard source, Side side, int modifier) {
super(source, text, null); super(source, ((side == Side.FREE_PEOPLE) ? "Fellowship" : "Minion") + " archery total " + ((modifier < 0) ? modifier : ("+" + modifier)), null);
_side = side; _side = side;
_modifier = modifier; _modifier = modifier;
} }

View File

@@ -41,7 +41,7 @@ public class Card1_038 extends AbstractLotroCardBlueprint {
PlayEventFromHandAction action = new PlayEventFromHandAction(self); PlayEventFromHandAction action = new PlayEventFromHandAction(self);
action.addCost(new SpotEffect(Filters.and(Filters.keyword(Keyword.ELF), Filters.keyword(Keyword.ARCHERY), Filters.type(CardType.COMPANION)))); action.addCost(new SpotEffect(Filters.and(Filters.keyword(Keyword.ELF), Filters.keyword(Keyword.ARCHERY), Filters.type(CardType.COMPANION))));
action.addEffect(new AddUntilEndOfPhaseModifierEffect( action.addEffect(new AddUntilEndOfPhaseModifierEffect(
new ArcheryTotalModifier(self, "Fellowship archery total +1", Side.FREE_PEOPLE, 1), Phase.ARCHERY)); new ArcheryTotalModifier(self, Side.FREE_PEOPLE, 1), Phase.ARCHERY));
return Collections.singletonList(action); return Collections.singletonList(action);
} }

View File

@@ -46,6 +46,6 @@ public class Card1_042 extends AbstractAttachableFPPossession {
@Override @Override
public Modifier getAlwaysOnEffect(PhysicalCard self) { public Modifier getAlwaysOnEffect(PhysicalCard self) {
return new ArcheryTotalModifier(self, "Minion archery total is -1", Side.SHADOW, -1); return new ArcheryTotalModifier(self, Side.SHADOW, -1);
} }
} }

View File

@@ -0,0 +1,51 @@
package com.gempukku.lotro.cards.set1.elven;
import com.gempukku.lotro.cards.AbstractLotroCardBlueprint;
import com.gempukku.lotro.cards.PlayConditions;
import com.gempukku.lotro.cards.effects.AddUntilEndOfPhaseModifierEffect;
import com.gempukku.lotro.cards.effects.SpotEffect;
import com.gempukku.lotro.cards.modifiers.ArcheryTotalModifier;
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.logic.actions.CostToEffectAction;
import com.gempukku.lotro.logic.timing.Action;
import java.util.Collections;
import java.util.List;
/**
* Set: The Fellowship of the Ring
* Side: Free
* Culture: Elven
* Twilight Cost: 0
* Type: Event
* Game Text: Archery: Spot an Elf companion to make the minion archery total -1.
*/
public class Card1_052 extends AbstractLotroCardBlueprint {
public Card1_052() {
super(Side.FREE_PEOPLE, CardType.EVENT, Culture.ELVEN, "Lightfootedness", "1_52");
addKeyword(Keyword.ARCHERY);
}
@Override
public int getTwilightCost() {
return 0;
}
@Override
public List<? extends Action> getPlayablePhaseActions(String playerId, LotroGame game, PhysicalCard self) {
if (PlayConditions.canPlayFromHandDuringPhase(game.getGameState(), Phase.ARCHERY, self)
&& Filters.canSpot(game.getGameState(), game.getModifiersQuerying(), Filters.keyword(Keyword.ELF), Filters.type(CardType.COMPANION))) {
CostToEffectAction action = new CostToEffectAction(self, "Make the minion archery total -1");
action.addCost(new SpotEffect(Filters.and(Filters.keyword(Keyword.ELF), Filters.type(CardType.COMPANION))));
action.addEffect(
new AddUntilEndOfPhaseModifierEffect(
new ArcheryTotalModifier(self, Side.SHADOW, -1), Phase.ARCHERY));
return Collections.singletonList(action);
}
return null;
}
}

View File

@@ -130,4 +130,12 @@ public class CompositeModifier implements Modifier {
return result; return result;
} }
@Override
public boolean addsToArcheryTotal(GameState gameState, ModifiersQuerying modifiersQuerying, PhysicalCard card, boolean result) {
for (Modifier modifier : _modifiers)
result = modifier.addsToArcheryTotal(gameState, modifiersQuerying, card, result);
return result;
}
} }