Add modeTag + hint of used modes for "choose one that hasn't been chosen" abilities. (#10860)

* Add modeTag + hint of used modes on Three Bowls of Porridge

* add ModesAlreadyUsedHint to all the cards.
This commit is contained in:
Susucre 2023-08-27 05:09:04 +02:00 committed by GitHub
parent dcca63b963
commit be4b568e88
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 168 additions and 15 deletions

View file

@ -17,6 +17,12 @@ public class Mode implements Serializable {
protected final Targets targets;
protected final Effects effects;
protected String flavorWord;
/**
* Optional Tag to distinguish this mode from others.
* In the case of modes that players can only choose once,
* the tag is directly what is displayed in ModesAlreadyUsedHint
*/
protected String modeTag;
public Mode(Effect effect) {
this.id = UUID.randomUUID();
@ -32,6 +38,7 @@ public class Mode implements Serializable {
this.targets = mode.targets.copy();
this.effects = mode.effects.copy();
this.flavorWord = mode.flavorWord;
this.modeTag = mode.modeTag;
}
public UUID setRandomId() {
@ -71,6 +78,21 @@ public class Mode implements Serializable {
return this;
}
/**
* Tag the mode to be retrieved elsewhere thanks to the tag.
*/
public Mode setModeTag(String tag) {
this.modeTag = tag;
return this;
}
/**
* @return the mode tag for this mode, if set
*/
public String getModeTag() {
return this.modeTag == null ? "" : this.modeTag;
}
public String getFlavorWord() {
return flavorWord;
}