[LTR] Add Goldberry, River-Daughter (#10524)

* Added Goldberry

* Slight optimizaztion

* Happy Path Test

* More unhappy tests

* Sanity check for Goldberry's counter choices

* Updated player.getMultiAmount to support individual constraints

* Some cleanup

Also modified ResourcefulDefense to use new multi amount api

* Updated logging

* Added hint for number of counters

* Fixed issue with Resourceful Defense

* Improvements to defaults

Default list will properly make sure to stay within individual maximums
If a player is asked for a choice that isn't actually a choice because each choice's min and max are equal, instead the default response is immediately returned. This helps with situations like moving a counter off of Goldberry when she only has one counter on her.

* -1/-1 Counter test

* Fixed issue with -1/-1 counters

* Adjusted dialog to properly enforce constraints
This commit is contained in:
Alexander Novotny 2023-07-28 21:29:40 -04:00 committed by GitHub
parent fe1efef25b
commit a36a7d9b7f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
23 changed files with 678 additions and 180 deletions

View file

@ -13,6 +13,7 @@ import com.google.gson.GsonBuilder;
import com.google.gson.annotations.Expose;
import mage.choices.Choice;
import mage.util.MultiAmountMessage;
/**
*
@ -42,7 +43,7 @@ public class GameClientMessage implements Serializable {
@Expose
private Choice choice;
@Expose
private List<String> messages;
private List<MultiAmountMessage> messages;
public GameClientMessage(GameView gameView, Map<String, Serializable> options) {
this.gameView = gameView;
@ -80,7 +81,8 @@ public class GameClientMessage implements Serializable {
this.cardsView2 = pile2;
}
public GameClientMessage(GameView gameView, Map<String, Serializable> options, List<String> messages, int min, int max) {
public GameClientMessage(GameView gameView, Map<String, Serializable> options, List<MultiAmountMessage> messages,
int min, int max) {
this.gameView = gameView;
this.options = options;
this.messages = messages;
@ -134,7 +136,7 @@ public class GameClientMessage implements Serializable {
return choice;
}
public List<String> getMessages() {
public List<MultiAmountMessage> getMessages() {
return messages;
}