This commit is contained in:
marcins78@gmail.com
2011-11-20 03:35:02 +00:00
parent 7de8167d17
commit ea457f105c

View File

@@ -0,0 +1,78 @@
package com.gempukku.lotro.cards.set9.shire;
import com.gempukku.lotro.cards.AbstractCompanion;
import com.gempukku.lotro.cards.PlayConditions;
import com.gempukku.lotro.cards.effects.AddBurdenEffect;
import com.gempukku.lotro.cards.effects.ChoiceEffect;
import com.gempukku.lotro.cards.effects.choose.ChooseAndPlayCardFromHandEffect;
import com.gempukku.lotro.common.Culture;
import com.gempukku.lotro.common.Keyword;
import com.gempukku.lotro.common.Phase;
import com.gempukku.lotro.common.Race;
import com.gempukku.lotro.game.PhysicalCard;
import com.gempukku.lotro.game.state.LotroGame;
import com.gempukku.lotro.logic.actions.ActivateCardAction;
import com.gempukku.lotro.logic.actions.RequiredTriggerAction;
import com.gempukku.lotro.logic.effects.AddTwilightEffect;
import com.gempukku.lotro.logic.timing.Effect;
import com.gempukku.lotro.logic.timing.EffectResult;
import java.util.Collections;
import java.util.LinkedList;
import java.util.List;
/**
* Set: Reflections
* Side: Free
* Culture: Shire
* Twilight Cost: 2
* Type: Companion • Hobbit
* Strength: 3
* Vitality: 4
* Resistance: 8
* Game Text: Ring-bound. Each time the fellowship moves, if the twilight pool has 2 or fewer twilight tokens, add
* 2 burdens or add (3). Regroup: Add a burden to play a [SHIRE] tale.
*/
public class Card9_049 extends AbstractCompanion {
public Card9_049() {
super(2, 3, 4, Culture.SHIRE, Race.HOBBIT, null, "Bilbo", true);
addKeyword(Keyword.CAN_START_WITH_RING);
addKeyword(Keyword.RING_BOUND);
}
@Override
public int getResistance() {
return 8;
}
@Override
public List<RequiredTriggerAction> getRequiredAfterTriggers(LotroGame game, EffectResult effectResult, PhysicalCard self) {
if (effectResult.getType() == EffectResult.Type.WHEN_FELLOWSHIP_MOVES
&& game.getGameState().getTwilightPool() <= 2) {
RequiredTriggerAction action = new RequiredTriggerAction(self);
List<Effect> possibleEffects = new LinkedList<Effect>();
possibleEffects.add(
new AddBurdenEffect(self, 2));
possibleEffects.add(
new AddTwilightEffect(self, 3));
action.appendEffect(
new ChoiceEffect(action, self.getOwner(), possibleEffects));
return Collections.singletonList(action);
}
return null;
}
@Override
protected List<ActivateCardAction> getExtraInPlayPhaseActions(String playerId, LotroGame game, PhysicalCard self) {
if (PlayConditions.canUseFPCardDuringPhase(game, Phase.REGROUP, self)
&& PlayConditions.canPlayFromHand(playerId, game, Culture.SHIRE, Keyword.TALE)) {
ActivateCardAction action = new ActivateCardAction(self);
action.appendCost(
new AddBurdenEffect(self, 1));
action.appendEffect(
new ChooseAndPlayCardFromHandEffect(playerId, game, Culture.SHIRE, Keyword.TALE));
return Collections.singletonList(action);
}
return null;
}
}