Add custom options for starting life total and starting hand size (#11259)

* add startHandSize / startLife to the custom option panel

* use the custom startLife/startHandsize in all Game Modes
This commit is contained in:
Susucre 2023-10-07 05:22:48 +02:00 committed by GitHub
parent 3e6097b70e
commit f14479c53c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
76 changed files with 1230 additions and 929 deletions

View file

@ -11,8 +11,8 @@ import java.util.UUID;
public abstract class GameCanadianHighlanderImpl extends GameImpl {
public GameCanadianHighlanderImpl(MultiplayerAttackOption attackOption, RangeOfInfluence range, Mulligan mulligan, int startLife) {
super(attackOption, range, mulligan, startLife, 100, 7);
public GameCanadianHighlanderImpl(MultiplayerAttackOption attackOption, RangeOfInfluence range, Mulligan mulligan, int startLife, int startHandSize) {
super(attackOption, range, mulligan, 100, startLife, startHandSize);
}
protected GameCanadianHighlanderImpl(final GameCanadianHighlanderImpl game) {

View file

@ -33,8 +33,8 @@ public abstract class GameCommanderImpl extends GameImpl {
// (see rule 504, "Draw Step") of his or her first turn.
protected boolean startingPlayerSkipsDraw = true;
public GameCommanderImpl(MultiplayerAttackOption attackOption, RangeOfInfluence range, Mulligan mulligan, int startingLife, int minimumDeckSize) {
super(attackOption, range, mulligan, startingLife, minimumDeckSize, 7);
public GameCommanderImpl(MultiplayerAttackOption attackOption, RangeOfInfluence range, Mulligan mulligan, int minimumDeckSize, int startLife, int startHandSize) {
super(attackOption, range, mulligan, minimumDeckSize, startLife, startHandSize);
}
protected GameCommanderImpl(final GameCommanderImpl game) {

View file

@ -157,7 +157,7 @@ public abstract class GameImpl implements Game {
// temporary store for income concede commands, don't copy
private final LinkedList<UUID> concedingPlayers = new LinkedList<>();
public GameImpl(MultiplayerAttackOption attackOption, RangeOfInfluence range, Mulligan mulligan, int startingLife, int minimumDeckSize, int startingHandSize) {
public GameImpl(MultiplayerAttackOption attackOption, RangeOfInfluence range, Mulligan mulligan, int minimumDeckSize, int startingLife, int startingHandSize) {
this.id = UUID.randomUUID();
this.range = range;
this.mulligan = mulligan;

View file

@ -34,8 +34,8 @@ public abstract class GameTinyLeadersImpl extends GameImpl {
// (see rule 504, "Draw Step") of his or her first turn.
protected boolean startingPlayerSkipsDraw = true;
public GameTinyLeadersImpl(MultiplayerAttackOption attackOption, RangeOfInfluence range, Mulligan mulligan, int startLife) {
super(attackOption, range, mulligan, startLife, 50, 7);
public GameTinyLeadersImpl(MultiplayerAttackOption attackOption, RangeOfInfluence range, Mulligan mulligan, int startLife, int startHandSize) {
super(attackOption, range, mulligan, 50, startLife, startHandSize);
}
protected GameTinyLeadersImpl(final GameTinyLeadersImpl game) {

View file

@ -15,7 +15,6 @@ import java.io.Serializable;
import java.util.*;
/**
*
* @author BetaSteward_at_googlemail.com
*/
public class MatchOptions implements Serializable {
@ -25,6 +24,10 @@ public class MatchOptions implements Serializable {
protected RangeOfInfluence range;
protected int winsNeeded;
protected int freeMulligans;
protected boolean customStartLifeEnabled;
protected int customStartLife; // Only use if customStartLifeEnabled is True
protected boolean customStartHandSizeEnabled;
protected int customStartHandSize; // Only use if customStartHandSizeEnabled is True
protected String gameType;
protected String deckType;
protected boolean limited;
@ -53,13 +56,6 @@ public class MatchOptions implements Serializable {
protected Collection<DeckCardInfo> perPlayerEmblemCards;
protected Collection<DeckCardInfo> globalEmblemCards;
/*public MatchOptions(String name, String gameType) {
this.name = name;
this.gameType = gameType;
this.password = "";
this.multiPlayer = false;
this.numSeats = 2;
}*/
public MatchOptions(String name, String gameType, boolean multiPlayer, int numSeats) {
this.name = name;
this.gameType = gameType;
@ -70,11 +66,11 @@ public class MatchOptions implements Serializable {
this.globalEmblemCards = Collections.emptySet();
}
public void setNumSeats (int numSeats) {
public void setNumSeats(int numSeats) {
this.numSeats = numSeats;
}
public int getNumSeats () {
public int getNumSeats() {
return numSeats;
}
@ -122,6 +118,38 @@ public class MatchOptions implements Serializable {
this.freeMulligans = freeMulligans;
}
public boolean isCustomStartLifeEnabled() {
return customStartLifeEnabled;
}
public void setCustomStartLifeEnabled(boolean value) {
this.customStartLifeEnabled = value;
}
public int getCustomStartLife() {
return customStartLife;
}
public void setCustomStartLife(int startLife) {
this.customStartLife = startLife;
}
public boolean isCustomStartHandSizeEnabled() {
return customStartHandSizeEnabled;
}
public void setCustomStartHandSizeEnabled(boolean value) {
this.customStartHandSizeEnabled = value;
}
public int getCustomStartHandSize() {
return customStartHandSize;
}
public void setCustomStartHandSize(int startHandSize) {
this.customStartHandSize = startHandSize;
}
public String getGameType() {
return gameType;
}
@ -211,11 +239,11 @@ public class MatchOptions implements Serializable {
public void setSpectatorsAllowed(boolean spectatorsAllowed) {
this.spectatorsAllowed = spectatorsAllowed;
}
public boolean isPlaneChase() {
return planeChase;
}
public void setPlaneChase(boolean planeChase) {
this.planeChase = planeChase;
}
@ -228,9 +256,13 @@ public class MatchOptions implements Serializable {
this.quitRatio = quitRatio;
}
public int getMinimumRating() { return minimumRating; }
public int getMinimumRating() {
return minimumRating;
}
public void setMinimumRating(int minimumRating) { this.minimumRating = minimumRating; }
public void setMinimumRating(int minimumRating) {
this.minimumRating = minimumRating;
}
public int getEdhPowerLevel() {
return edhPowerLevel;