"Strength of Spirit"
This commit is contained in:
@@ -3,15 +3,23 @@ package com.gempukku.lotro.cards.effects;
|
|||||||
import com.gempukku.lotro.cards.PlayConditions;
|
import com.gempukku.lotro.cards.PlayConditions;
|
||||||
import com.gempukku.lotro.game.PhysicalCard;
|
import com.gempukku.lotro.game.PhysicalCard;
|
||||||
import com.gempukku.lotro.game.state.LotroGame;
|
import com.gempukku.lotro.game.state.LotroGame;
|
||||||
import com.gempukku.lotro.logic.timing.UnrespondableEffect;
|
import com.gempukku.lotro.logic.timing.AbstractEffect;
|
||||||
|
import com.gempukku.lotro.logic.timing.EffectResult;
|
||||||
|
import com.gempukku.lotro.logic.timing.results.ExertResult;
|
||||||
|
|
||||||
public class ExertCharacterEffect extends UnrespondableEffect {
|
public class ExertCharacterEffect extends AbstractEffect {
|
||||||
private PhysicalCard _physicalCard;
|
private PhysicalCard _physicalCard;
|
||||||
|
private boolean _prevented;
|
||||||
|
|
||||||
public ExertCharacterEffect(PhysicalCard physicalCard) {
|
public ExertCharacterEffect(PhysicalCard physicalCard) {
|
||||||
_physicalCard = physicalCard;
|
_physicalCard = physicalCard;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public EffectResult getRespondableResult() {
|
||||||
|
return new ExertResult(_physicalCard);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getText() {
|
public String getText() {
|
||||||
return "Exert " + _physicalCard.getBlueprint().getName();
|
return "Exert " + _physicalCard.getBlueprint().getName();
|
||||||
@@ -24,6 +32,11 @@ public class ExertCharacterEffect extends UnrespondableEffect {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void playEffect(LotroGame game) {
|
public void playEffect(LotroGame game) {
|
||||||
game.getGameState().addWound(_physicalCard);
|
if (!_prevented)
|
||||||
|
game.getGameState().addWound(_physicalCard);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void prevent() {
|
||||||
|
_prevented = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,60 @@
|
|||||||
|
package com.gempukku.lotro.cards.set1.gandalf;
|
||||||
|
|
||||||
|
import com.gempukku.lotro.cards.AbstractResponseEvent;
|
||||||
|
import com.gempukku.lotro.cards.actions.PlayEventAction;
|
||||||
|
import com.gempukku.lotro.cards.effects.ExertCharacterEffect;
|
||||||
|
import com.gempukku.lotro.common.CardType;
|
||||||
|
import com.gempukku.lotro.common.Culture;
|
||||||
|
import com.gempukku.lotro.common.Keyword;
|
||||||
|
import com.gempukku.lotro.common.Side;
|
||||||
|
import com.gempukku.lotro.filters.Filters;
|
||||||
|
import com.gempukku.lotro.game.PhysicalCard;
|
||||||
|
import com.gempukku.lotro.game.state.LotroGame;
|
||||||
|
import com.gempukku.lotro.logic.timing.Action;
|
||||||
|
import com.gempukku.lotro.logic.timing.Effect;
|
||||||
|
import com.gempukku.lotro.logic.timing.EffectResult;
|
||||||
|
import com.gempukku.lotro.logic.timing.UnrespondableEffect;
|
||||||
|
import com.gempukku.lotro.logic.timing.results.ExertResult;
|
||||||
|
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set: The Fellowship of the Ring
|
||||||
|
* Side: Free
|
||||||
|
* Culture: Gandalf
|
||||||
|
* Twilight Cost: 1
|
||||||
|
* Type: Event
|
||||||
|
* Game Text: Spell. Response: If a companion is about to exert, spot Gandalf to place no token for that exertion.
|
||||||
|
*/
|
||||||
|
public class Card1_085 extends AbstractResponseEvent {
|
||||||
|
public Card1_085() {
|
||||||
|
super(Side.FREE_PEOPLE, Culture.GANDALF, "Strength of Spirit");
|
||||||
|
addKeyword(Keyword.SPELL);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getTwilightCost() {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<? extends Action> getOptionalBeforeActions(String playerId, LotroGame game, final Effect effect, EffectResult effectResult, PhysicalCard self) {
|
||||||
|
if (effectResult.getType() == EffectResult.Type.EXERT
|
||||||
|
&& Filters.canSpot(game.getGameState(), game.getModifiersQuerying(), Filters.name("Gandalf"))) {
|
||||||
|
ExertResult exertResult = (ExertResult) effectResult;
|
||||||
|
if (exertResult.getExertedCard().getBlueprint().getCardType() == CardType.COMPANION) {
|
||||||
|
PlayEventAction action = new PlayEventAction(self);
|
||||||
|
action.addEffect(
|
||||||
|
new UnrespondableEffect() {
|
||||||
|
@Override
|
||||||
|
public void playEffect(LotroGame game) {
|
||||||
|
((ExertCharacterEffect) effect).prevent();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return Collections.singletonList(action);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -2,7 +2,7 @@ package com.gempukku.lotro.logic.timing;
|
|||||||
|
|
||||||
public abstract class EffectResult {
|
public abstract class EffectResult {
|
||||||
public enum Type {
|
public enum Type {
|
||||||
WOUND, KILL, HEAL,
|
WOUND, KILL, HEAL, EXERT,
|
||||||
|
|
||||||
OVERWHELM_IN_SKIRMISH, RESOLVE_SKIRMISH,
|
OVERWHELM_IN_SKIRMISH, RESOLVE_SKIRMISH,
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,17 @@
|
|||||||
|
package com.gempukku.lotro.logic.timing.results;
|
||||||
|
|
||||||
|
import com.gempukku.lotro.game.PhysicalCard;
|
||||||
|
import com.gempukku.lotro.logic.timing.EffectResult;
|
||||||
|
|
||||||
|
public class ExertResult extends EffectResult {
|
||||||
|
private PhysicalCard _card;
|
||||||
|
|
||||||
|
public ExertResult(PhysicalCard card) {
|
||||||
|
super(Type.EXERT);
|
||||||
|
_card = card;
|
||||||
|
}
|
||||||
|
|
||||||
|
public PhysicalCard getExertedCard() {
|
||||||
|
return _card;
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user