mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 19:58:00 +00:00
add Maralen of the Mornsong (from Morningtide)
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user