"Ulaire Enquea"
This commit is contained in:
@@ -19,6 +19,7 @@ public class ToilDiscountEffect extends AbstractSubActionEffect implements Disco
|
||||
private int _minimalDiscount;
|
||||
|
||||
private int _exertedCount;
|
||||
private int _paidToil;
|
||||
|
||||
public ToilDiscountEffect(Action action, PhysicalCard payingFor, String ownerId, Culture culture, int toilCount) {
|
||||
_action = action;
|
||||
@@ -33,9 +34,17 @@ public class ToilDiscountEffect extends AbstractSubActionEffect implements Disco
|
||||
return null;
|
||||
}
|
||||
|
||||
public void incrementToil() {
|
||||
_paidToil++;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Type getType() {
|
||||
return null;
|
||||
return Type.BEFORE_TOIL;
|
||||
}
|
||||
|
||||
public PhysicalCard getPayingFor() {
|
||||
return _payingFor;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -45,7 +54,7 @@ public class ToilDiscountEffect extends AbstractSubActionEffect implements Disco
|
||||
|
||||
@Override
|
||||
public boolean isPlayableInFull(LotroGame game) {
|
||||
return _minimalDiscount <= _toilCount * Filters.countActive(game.getGameState(), game.getModifiersQuerying(), Filters.owner(_ownerId), _culture, Filters.character, Filters.canExert(_payingFor));
|
||||
return _minimalDiscount <= _toilCount * (_paidToil + Filters.countActive(game.getGameState(), game.getModifiersQuerying(), Filters.owner(_ownerId), _culture, Filters.character, Filters.canExert(_payingFor)));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -72,7 +81,7 @@ public class ToilDiscountEffect extends AbstractSubActionEffect implements Disco
|
||||
|
||||
@Override
|
||||
public int getDiscountPaidFor() {
|
||||
return _exertedCount * _toilCount;
|
||||
return (_exertedCount + _paidToil) * _toilCount;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,63 @@
|
||||
package com.gempukku.lotro.cards.set12.wraith;
|
||||
|
||||
import com.gempukku.lotro.cards.AbstractMinion;
|
||||
import com.gempukku.lotro.cards.PlayConditions;
|
||||
import com.gempukku.lotro.cards.effects.SelfExertEffect;
|
||||
import com.gempukku.lotro.cards.effects.discount.ToilDiscountEffect;
|
||||
import com.gempukku.lotro.common.CardType;
|
||||
import com.gempukku.lotro.common.Culture;
|
||||
import com.gempukku.lotro.common.Keyword;
|
||||
import com.gempukku.lotro.common.Race;
|
||||
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.ActivateCardAction;
|
||||
import com.gempukku.lotro.logic.timing.Effect;
|
||||
import com.gempukku.lotro.logic.timing.UnrespondableEffect;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Set: Black Rider
|
||||
* Side: Shadow
|
||||
* Culture: Wraith
|
||||
* Twilight Cost: 6
|
||||
* Type: Minion • Nazgul
|
||||
* Strength: 11
|
||||
* Vitality: 4
|
||||
* Site: 3
|
||||
* Game Text: Fierce.Toil 1. (For each [WRAITH] character you exert when playing this, its twilight cost is -1)
|
||||
* Response: If you are playing a [WRAITH] event that has toil X, exert Ulaire Enquea to reduce that event's twilight
|
||||
* cost by X.
|
||||
*/
|
||||
public class Card12_175 extends AbstractMinion {
|
||||
public Card12_175() {
|
||||
super(6, 11, 4, 3, Race.NAZGUL, Culture.WRAITH, "Ulaire Enquea", true);
|
||||
addKeyword(Keyword.FIERCE);
|
||||
addKeyword(Keyword.TOIL, 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<? extends ActivateCardAction> getOptionalInPlayBeforeActions(String playerId, LotroGame game, Effect effect, PhysicalCard self) {
|
||||
if (effect.getType() == Effect.Type.BEFORE_TOIL
|
||||
&& PlayConditions.canSelfExert(self, game)) {
|
||||
final ToilDiscountEffect toilEffect = (ToilDiscountEffect) effect;
|
||||
PhysicalCard payingFor = toilEffect.getPayingFor();
|
||||
if (Filters.and(Filters.owner(playerId), Culture.WRAITH, CardType.EVENT).accepts(game.getGameState(), game.getModifiersQuerying(), payingFor)) {
|
||||
ActivateCardAction action = new ActivateCardAction(self);
|
||||
action.appendCost(
|
||||
new SelfExertEffect(self));
|
||||
action.appendEffect(
|
||||
new UnrespondableEffect() {
|
||||
@Override
|
||||
protected void doPlayEffect(LotroGame game) {
|
||||
toilEffect.incrementToil();
|
||||
}
|
||||
});
|
||||
return Collections.singletonList(action);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -8,7 +8,7 @@ public interface Effect {
|
||||
BEFORE_ADD_TWILIGHT, BEFORE_KILLED, BEFORE_HEALED,
|
||||
BEFORE_TAKE_CONTROL_OF_A_SITE,
|
||||
BEFORE_SKIRMISH_RESOLVED,
|
||||
BEFORE_THREAT_WOUNDS
|
||||
BEFORE_THREAT_WOUNDS, BEFORE_TOIL
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user