This commit is contained in:
marcins78@gmail.com
2011-10-13 15:52:23 +00:00
parent e90223a58d
commit bac009995a

View File

@@ -0,0 +1,67 @@
package com.gempukku.lotro.cards.set4.rohan;
import com.gempukku.lotro.cards.AbstractAttachableFPPossession;
import com.gempukku.lotro.cards.PlayConditions;
import com.gempukku.lotro.cards.effects.ExertCharactersEffect;
import com.gempukku.lotro.common.*;
import com.gempukku.lotro.filters.Filter;
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.OptionalTriggerAction;
import com.gempukku.lotro.logic.actions.RequiredTriggerAction;
import com.gempukku.lotro.logic.effects.HealCharactersEffect;
import com.gempukku.lotro.logic.timing.EffectResult;
import java.util.Collections;
import java.util.List;
/**
* Set: The Two Towers
* Side: Free
* Culture: Rohan
* Twilight Cost: 1
* Type: Possession • Mount
* Game Text: To play, spot a [ROHAN] Man. Bearer must be a Man, Elf, or Wizard. When you play Brego, you may
* heal bearer. At the start of each skirmish involving bearer, each minion skirmishing bearer must exert.
*/
public class Card4_263 extends AbstractAttachableFPPossession {
public Card4_263() {
super(1, 0, 0, Culture.ROHAN, Keyword.MOUNT, "Brego", true);
}
@Override
public boolean checkPlayRequirements(String playerId, LotroGame game, PhysicalCard self, Filter additionalAttachmentFilter, int twilightModifier) {
return super.checkPlayRequirements(playerId, game, self, additionalAttachmentFilter, twilightModifier)
&& PlayConditions.canSpot(game, Filters.culture(Culture.ROHAN), Filters.race(Race.MAN));
}
@Override
protected Filter getValidTargetFilter(String playerId, LotroGame game, PhysicalCard self) {
return Filters.or(Filters.race(Race.MAN), Filters.race(Race.ELF), Filters.race(Race.WIZARD));
}
@Override
public List<OptionalTriggerAction> getOptionalAfterTriggers(String playerId, LotroGame game, EffectResult effectResult, PhysicalCard self) {
if (PlayConditions.played(game, effectResult, Filters.sameCard(self))) {
OptionalTriggerAction action = new OptionalTriggerAction(self);
action.appendEffect(
new HealCharactersEffect(playerId, self.getAttachedTo()));
return Collections.singletonList(action);
}
return null;
}
@Override
public List<RequiredTriggerAction> getRequiredAfterTriggers(LotroGame game, EffectResult effectResult, PhysicalCard self) {
if (effectResult.getType() == EffectResult.Type.START_OF_PHASE
&& game.getGameState().getCurrentPhase() == Phase.SKIRMISH
&& Filters.inSkirmish().accepts(game.getGameState(), game.getModifiersQuerying(), self.getAttachedTo())) {
RequiredTriggerAction action = new RequiredTriggerAction(self);
action.appendEffect(
new ExertCharactersEffect(self, Filters.and(Filters.type(CardType.MINION), Filters.inSkirmishAgainst(Filters.hasAttached(self)))));
return Collections.singletonList(action);
}
return null;
}
}