"Gorbag's Sword"

This commit is contained in:
marcins78@gmail.com
2011-11-17 15:53:18 +00:00
parent 4f3ab616cc
commit 873901fb04
2 changed files with 34 additions and 9 deletions

View File

@@ -9,7 +9,7 @@ import com.gempukku.lotro.game.PhysicalCard;
import com.gempukku.lotro.game.state.LotroGame;
import com.gempukku.lotro.logic.GameUtils;
import com.gempukku.lotro.logic.actions.OptionalTriggerAction;
import com.gempukku.lotro.logic.decisions.MultipleChoiceAwaitingDecision;
import com.gempukku.lotro.logic.decisions.YesNoDecision;
import com.gempukku.lotro.logic.effects.ChooseActiveCardEffect;
import com.gempukku.lotro.logic.effects.DiscardCardsFromPlayEffect;
import com.gempukku.lotro.logic.effects.PlayoutDecisionEffect;
@@ -62,15 +62,17 @@ public class Card10_060 extends AbstractAttachable {
protected void cardSelected(LotroGame game, final PhysicalCard card) {
action.appendEffect(
new PlayoutDecisionEffect(playerId,
new MultipleChoiceAwaitingDecision(1, "Do you want to put " + GameUtils.getCardLink(card) + " on top of deck instead?", new String[]{"Yes", "No"}) {
new YesNoDecision("Do you want to put " + GameUtils.getCardLink(card) + " on top of deck instead?") {
@Override
protected void validDecisionMade(int index, String result) {
if (index == 0)
action.appendEffect(
new PutCardFromPlayOnTopOfDeckEffect(card));
else
action.appendEffect(
new DiscardCardsFromPlayEffect(self, card));
protected void yes() {
action.appendEffect(
new PutCardFromPlayOnTopOfDeckEffect(card));
}
@Override
protected void no() {
action.appendEffect(
new DiscardCardsFromPlayEffect(self, card));
}
}));
}

View File

@@ -0,0 +1,23 @@
package com.gempukku.lotro.logic.decisions;
public class YesNoDecision extends MultipleChoiceAwaitingDecision {
public YesNoDecision(String text) {
super(1, text, new String[]{"Yes", "No"});
}
@Override
protected final void validDecisionMade(int index, String result) {
if (index == 0)
yes();
else
no();
}
protected void yes() {
}
protected void no() {
}
}