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,16 +11,9 @@ import java.util.UUID;
public class TwoPlayerDuel extends GameImpl {
public TwoPlayerDuel(MultiplayerAttackOption attackOption, RangeOfInfluence range, Mulligan mulligan, int startLife) {
this(attackOption, range, mulligan, startLife, 60);
}
public TwoPlayerDuel(MultiplayerAttackOption attackOption, RangeOfInfluence range, Mulligan mulligan, int startingLife, int minimumDeckSize) {
this(attackOption, range, mulligan, startingLife, minimumDeckSize, 7);
}
public TwoPlayerDuel(MultiplayerAttackOption attackOption, RangeOfInfluence range, Mulligan mulligan, int startingLife, int minimumDeckSize, int startingHandSize) {
super(attackOption, range, mulligan, startingLife, minimumDeckSize, startingHandSize);
public TwoPlayerDuel(MultiplayerAttackOption attackOption, RangeOfInfluence range, Mulligan mulligan,
int minimumDeckSize, int startLife, int startHandSize) {
super(attackOption, range, mulligan, minimumDeckSize, startLife, startHandSize);
}
public TwoPlayerDuel(final TwoPlayerDuel game) {

View file

@ -21,7 +21,12 @@ public class TwoPlayerMatch extends MatchImpl {
// see comments from https://github.com/magefree/mage/commit/4874ad31c199ea573187ea2790268be3a4d4c95a
boolean isLimitedDeck = options.isLimited() || "Limited".equals(options.getDeckType());
TwoPlayerDuel game = new TwoPlayerDuel(options.getAttackOption(), options.getRange(), mulligan, 20, isLimitedDeck ? 40 : 60);
int startLife = options.isCustomStartLifeEnabled() ? options.getCustomStartLife() : 20;
int startHandSize = options.isCustomStartHandSizeEnabled() ? options.getCustomStartHandSize() : 7;
TwoPlayerDuel game = new TwoPlayerDuel(
options.getAttackOption(), options.getRange(), mulligan,
isLimitedDeck ? 40 : 60, startLife, startHandSize
);
// Sets a start message about the match score
game.setStartMessage(this.createGameStartMessage());
initGame(game);