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

@ -7,15 +7,15 @@ import mage.game.match.MatchType;
import mage.game.mulligan.Mulligan;
/**
*
* @author BetaSteward_at_googlemail.com
*/
public class FreeForAll extends GameImpl {
private int numPlayers;
public FreeForAll(MultiplayerAttackOption attackOption, RangeOfInfluence range, Mulligan mulligan, int startLife) {
super(attackOption, range, mulligan, startLife, 60, 7);
public FreeForAll(MultiplayerAttackOption attackOption, RangeOfInfluence range,
Mulligan mulligan, int startLife, int startHandSize) {
super(attackOption, range, mulligan, 60, startLife, startHandSize);
}
public FreeForAll(final FreeForAll game) {

View file

@ -7,7 +7,6 @@ import mage.game.match.MatchOptions;
import mage.game.mulligan.Mulligan;
/**
*
* @author BetaSteward_at_googlemail.com
*/
public class FreeForAllMatch extends MatchImpl {
@ -19,7 +18,12 @@ public class FreeForAllMatch extends MatchImpl {
@Override
public void startGame() throws GameException {
Mulligan mulligan = options.getMulliganType().getMulligan(options.getFreeMulligans());
FreeForAll game = new FreeForAll(options.getAttackOption(), options.getRange(), mulligan, 20);
int startLife = options.isCustomStartLifeEnabled() ? options.getCustomStartLife() : 20;
int startHandSize = options.isCustomStartHandSizeEnabled() ? options.getCustomStartHandSize() : 7;
FreeForAll game = new FreeForAll(
options.getAttackOption(), options.getRange(),
mulligan, startLife, startHandSize
);
game.setStartMessage(this.createGameStartMessage());
initGame(game);
games.add(game);