- "Dunlending Patriarch" playing discount now is optional.
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
package com.gempukku.lotro.cards.set13.men;
|
||||
|
||||
import com.gempukku.lotro.cards.AbstractMinion;
|
||||
import com.gempukku.lotro.cards.actions.PlayPermanentAction;
|
||||
import com.gempukku.lotro.cards.effects.DiscountEffect;
|
||||
import com.gempukku.lotro.cards.modifiers.conditions.NotCondition;
|
||||
import com.gempukku.lotro.common.CardType;
|
||||
import com.gempukku.lotro.common.Culture;
|
||||
@@ -9,9 +11,9 @@ import com.gempukku.lotro.common.Race;
|
||||
import com.gempukku.lotro.filters.Filters;
|
||||
import com.gempukku.lotro.game.PhysicalCard;
|
||||
import com.gempukku.lotro.game.state.GameState;
|
||||
import com.gempukku.lotro.game.state.LotroGame;
|
||||
import com.gempukku.lotro.logic.modifiers.KeywordModifier;
|
||||
import com.gempukku.lotro.logic.modifiers.Modifier;
|
||||
import com.gempukku.lotro.logic.modifiers.ModifiersQuerying;
|
||||
import com.gempukku.lotro.logic.modifiers.SpotCondition;
|
||||
|
||||
/**
|
||||
@@ -32,12 +34,24 @@ public class Card13_088 extends AbstractMinion {
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTwilightCostModifier(GameState gameState, ModifiersQuerying modifiersQuerying, PhysicalCard self) {
|
||||
if (Filters.canSpot(gameState, modifiersQuerying, Filters.not(self), Culture.MEN, CardType.MINION))
|
||||
protected int getPotentialExtraPaymentDiscount(String playerId, LotroGame game, PhysicalCard self) {
|
||||
GameState gameState = game.getGameState();
|
||||
if (Filters.canSpot(gameState, game.getModifiersQuerying(), Filters.not(self), Culture.MEN, CardType.MINION))
|
||||
return -gameState.getWounds(gameState.getRingBearer(gameState.getCurrentPlayerId()));
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected DiscountEffect getDiscountEffect(PlayPermanentAction action, String playerId, LotroGame game, PhysicalCard self) {
|
||||
GameState gameState = game.getGameState();
|
||||
if (Filters.canSpot(gameState, game.getModifiersQuerying(), Filters.not(self), Culture.MEN, CardType.MINION)) {
|
||||
int wounds = gameState.getWounds(gameState.getRingBearer(gameState.getCurrentPlayerId()));
|
||||
if (wounds > 0)
|
||||
return new DiscountChoiceEffect(playerId, wounds);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Modifier getAlwaysOnModifier(PhysicalCard self) {
|
||||
return new KeywordModifier(self, self, new NotCondition(new SpotCondition(CardType.COMPANION, Filters.unwounded)), Keyword.FIERCE, 1);
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
package com.gempukku.lotro.cards.set13.men;
|
||||
|
||||
import com.gempukku.lotro.cards.effects.DiscountEffect;
|
||||
import com.gempukku.lotro.game.state.LotroGame;
|
||||
import com.gempukku.lotro.logic.decisions.YesNoDecision;
|
||||
import com.gempukku.lotro.logic.timing.AbstractSuccessfulEffect;
|
||||
|
||||
public class DiscountChoiceEffect extends AbstractSuccessfulEffect implements DiscountEffect {
|
||||
private String _playerId;
|
||||
private int _discountOffer;
|
||||
|
||||
private int _minimalRequiredDiscount;
|
||||
private int _discountedBy = 0;
|
||||
|
||||
public DiscountChoiceEffect(String playerId, int discountOffer) {
|
||||
_playerId = playerId;
|
||||
_discountOffer = discountOffer;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setMinimalRequiredDiscount(int minimalDiscount) {
|
||||
_minimalRequiredDiscount = minimalDiscount;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDiscountPaidFor() {
|
||||
return _discountedBy;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getText(LotroGame game) {
|
||||
return "Play card at a discount";
|
||||
}
|
||||
|
||||
@Override
|
||||
public Type getType() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void playEffect(LotroGame game) {
|
||||
if (_minimalRequiredDiscount > 0)
|
||||
_discountedBy = _discountOffer;
|
||||
else {
|
||||
game.getUserFeedback().sendAwaitingDecision(_playerId,
|
||||
new YesNoDecision("Do you want to play the card at -" + _discountOffer) {
|
||||
@Override
|
||||
protected void yes() {
|
||||
_discountedBy = _discountOffer;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,6 +2,7 @@
|
||||
<b>11 Jul. 2012</b>
|
||||
- Added player statistics (visible only to the user himself). displaying the number of wins/losses for each format and
|
||||
deck played, split into casual and competitive groups.
|
||||
- "Dunlending Patriarch" playing discount now is optional.
|
||||
|
||||
<b>10 Jul. 2012</b>
|
||||
- Added server statistics. displaying the number of active players, games played and split of casual games by format
|
||||
|
||||
Reference in New Issue
Block a user