add Maralen of the Mornsong (from Morningtide)

This commit is contained in:
slapshot5
2011-08-28 03:43:28 +00:00
parent 60a23ab77f
commit 25bc109322
4 changed files with 28 additions and 3 deletions

View File

@@ -74,9 +74,7 @@ public class HumanPlayer extends Player {
/** {@inheritDoc} */
public CardList mayDrawCards(int n) {
String[] choices = {"Yes", "No"};
Object choice = GuiUtils.getChoice("Draw " + n + " cards?", choices);
if (choice.equals("Yes"))
if (canDraw() && GameActionUtil.showYesNoDialog(null, "Draw " + n + " cards?"))
return drawCards(n);
else return new CardList();
}

View File

@@ -809,6 +809,15 @@ public abstract class Player extends MyObservable {
/// replaces AllZone.getGameAction().draw* methods
///
////////////////////////////////
/**
* <p>canDraw</p>
*
* @return true if a player can draw a card, false otherwise
*/
public boolean canDraw() {
return !AllZoneUtil.isCardInPlay("Maralen of the Mornsong");
}
/**
* <p>mayDrawCard.</p>
@@ -869,6 +878,11 @@ public abstract class Player extends MyObservable {
*/
public CardList drawCards(int n, boolean firstFromDraw) {
CardList drawn = new CardList();
if(!canDraw()) {
return drawn;
}
for (int i = 0; i < n; i++) {
// TODO: multiple replacements need to be selected by the controller