"Hope is Kindled"

This commit is contained in:
marcins78@gmail.com
2011-12-13 18:01:09 +00:00
parent e6d590d78e
commit 7ca1598e70

View File

@@ -0,0 +1,67 @@
package com.gempukku.lotro.cards.set12.shire;
import com.gempukku.lotro.cards.AbstractEvent;
import com.gempukku.lotro.cards.TriggerConditions;
import com.gempukku.lotro.cards.actions.PlayEventAction;
import com.gempukku.lotro.cards.effects.AddUntilEndOfPhaseActionProxyEffect;
import com.gempukku.lotro.cards.effects.AddUntilEndOfPhaseModifierEffect;
import com.gempukku.lotro.cards.effects.RemoveBurdenEffect;
import com.gempukku.lotro.common.Culture;
import com.gempukku.lotro.common.Phase;
import com.gempukku.lotro.common.Race;
import com.gempukku.lotro.common.Side;
import com.gempukku.lotro.game.AbstractActionProxy;
import com.gempukku.lotro.game.PhysicalCard;
import com.gempukku.lotro.game.state.LotroGame;
import com.gempukku.lotro.logic.actions.OptionalTriggerAction;
import com.gempukku.lotro.logic.effects.ChooseActiveCardEffect;
import com.gempukku.lotro.logic.modifiers.StrengthModifier;
import com.gempukku.lotro.logic.timing.EffectResult;
import java.util.Collections;
import java.util.List;
/**
* Set: Black Rider
* Side: Free
* Culture: Shire
* Twilight Cost: 2
* Type: Event • Skirmish
* Game Text: Make a Hobbit strength +2. If that Hobbit wins this skirmish, you may remove a burden.
*/
public class Card12_123 extends AbstractEvent {
public Card12_123() {
super(Side.FREE_PEOPLE, 2, Culture.SHIRE, "Hope is Kindled", Phase.SKIRMISH);
}
@Override
public PlayEventAction getPlayCardAction(String playerId, LotroGame game, final PhysicalCard self, int twilightModifier, boolean ignoreRoamingPenalty) {
final PlayEventAction action = new PlayEventAction(self);
action.appendEffect(
new ChooseActiveCardEffect(self, playerId, "Choose a Hobbit", Race.HOBBIT) {
@Override
protected void cardSelected(LotroGame game, final PhysicalCard hobbit) {
action.appendEffect(
new AddUntilEndOfPhaseModifierEffect(
new StrengthModifier(self, hobbit, 2), Phase.SKIRMISH));
action.appendEffect(
new AddUntilEndOfPhaseActionProxyEffect(
new AbstractActionProxy() {
@Override
public List<? extends OptionalTriggerAction> getOptionalAfterTriggers(String playerId, LotroGame game, EffectResult effectResult) {
if (TriggerConditions.winsSkirmish(game, effectResult, hobbit)
&& playerId.equals(self.getOwner())) {
OptionalTriggerAction action = new OptionalTriggerAction(self);
action.setVirtualCardAction(true);
action.appendEffect(
new RemoveBurdenEffect(playerId, self, 1));
return Collections.singletonList(action);
}
return null;
}
}, Phase.SKIRMISH));
}
});
return action;
}
}