From 1465e505c0ef5471b87ca58222e771b791c9ade1 Mon Sep 17 00:00:00 2001 From: Oleg Agafonov Date: Mon, 27 May 2019 18:02:28 +0400 Subject: [PATCH] Added duel mode for oathbreaker --- .../Mage.Game.OathbreakerDuel/pom.xml | 55 +++ .../src/mage/game/OathbreakerDuel.java | 36 ++ .../src/mage/game/OathbreakerDuelMatch.java | 29 ++ .../src/mage/game/OathbreakerDuelType.java | 29 ++ .../src/mage/game/OathbreakerFreeForAll.java | 28 -- Mage.Server.Plugins/pom.xml | 1 + Mage.Server/config/config.xml | 298 +++++--------- Mage.Server/pom.xml | 6 + Mage.Server/release/config/config.xml | 364 ++++++------------ 9 files changed, 365 insertions(+), 481 deletions(-) create mode 100644 Mage.Server.Plugins/Mage.Game.OathbreakerDuel/pom.xml create mode 100644 Mage.Server.Plugins/Mage.Game.OathbreakerDuel/src/mage/game/OathbreakerDuel.java create mode 100644 Mage.Server.Plugins/Mage.Game.OathbreakerDuel/src/mage/game/OathbreakerDuelMatch.java create mode 100644 Mage.Server.Plugins/Mage.Game.OathbreakerDuel/src/mage/game/OathbreakerDuelType.java diff --git a/Mage.Server.Plugins/Mage.Game.OathbreakerDuel/pom.xml b/Mage.Server.Plugins/Mage.Game.OathbreakerDuel/pom.xml new file mode 100644 index 0000000000..717a09c791 --- /dev/null +++ b/Mage.Server.Plugins/Mage.Game.OathbreakerDuel/pom.xml @@ -0,0 +1,55 @@ + + + 4.0.0 + + + org.mage + mage-server-plugins + 1.4.35 + + + mage-game-oathbreakerduel + jar + Mage Game Oathbreaker Two Player + + + + ${project.groupId} + mage + ${project.version} + + + org.mage + mage-game-oathbreakerfreeforall + 1.4.35 + compile + + + + + src + + + org.apache.maven.plugins + maven-compiler-plugin + + 1.8 + 1.8 + + + + maven-resources-plugin + + UTF-8 + + + + + + mage-game-oathbreakerduel + + + + + diff --git a/Mage.Server.Plugins/Mage.Game.OathbreakerDuel/src/mage/game/OathbreakerDuel.java b/Mage.Server.Plugins/Mage.Game.OathbreakerDuel/src/mage/game/OathbreakerDuel.java new file mode 100644 index 0000000000..6979861ee8 --- /dev/null +++ b/Mage.Server.Plugins/Mage.Game.OathbreakerDuel/src/mage/game/OathbreakerDuel.java @@ -0,0 +1,36 @@ +package mage.game; + +import mage.constants.MultiplayerAttackOption; +import mage.constants.RangeOfInfluence; +import mage.game.match.MatchType; +import mage.game.mulligan.Mulligan; + +/** + * @author JayDi85 + */ +public class OathbreakerDuel extends OathbreakerFreeForAll { + + public OathbreakerDuel(MultiplayerAttackOption attackOption, RangeOfInfluence range, Mulligan mulligan, int startLife) { + super(attackOption, range, mulligan, startLife); + } + + public OathbreakerDuel(final OathbreakerDuel game) { + super(game); + } + + @Override + public MatchType getGameType() { + return new OathbreakerDuelType(); + } + + @Override + public int getNumPlayers() { + return 2; + } + + @Override + public OathbreakerDuel copy() { + return new OathbreakerDuel(this); + } + +} diff --git a/Mage.Server.Plugins/Mage.Game.OathbreakerDuel/src/mage/game/OathbreakerDuelMatch.java b/Mage.Server.Plugins/Mage.Game.OathbreakerDuel/src/mage/game/OathbreakerDuelMatch.java new file mode 100644 index 0000000000..2d2491e2a1 --- /dev/null +++ b/Mage.Server.Plugins/Mage.Game.OathbreakerDuel/src/mage/game/OathbreakerDuelMatch.java @@ -0,0 +1,29 @@ +package mage.game; + +import mage.game.match.MatchImpl; +import mage.game.match.MatchOptions; +import mage.game.mulligan.Mulligan; + +/** + * @author JayDi85 + */ +public class OathbreakerDuelMatch extends MatchImpl { + + public OathbreakerDuelMatch(MatchOptions options) { + super(options); + } + + @Override + public void startGame() throws GameException { + int startLife = 20; + boolean alsoHand = true; + Mulligan mulligan = options.getMulliganType().getMulligan(options.getFreeMulligans()); + OathbreakerDuel game = new OathbreakerDuel(options.getAttackOption(), options.getRange(), mulligan, startLife); + game.setCheckCommanderDamage(false); + game.setStartMessage(this.createGameStartMessage()); + game.setAlsoHand(alsoHand); + game.setAlsoLibrary(true); + initGame(game); + games.add(game); + } +} diff --git a/Mage.Server.Plugins/Mage.Game.OathbreakerDuel/src/mage/game/OathbreakerDuelType.java b/Mage.Server.Plugins/Mage.Game.OathbreakerDuel/src/mage/game/OathbreakerDuelType.java new file mode 100644 index 0000000000..ad52c5cce7 --- /dev/null +++ b/Mage.Server.Plugins/Mage.Game.OathbreakerDuel/src/mage/game/OathbreakerDuelType.java @@ -0,0 +1,29 @@ +package mage.game; + +import mage.game.match.MatchType; + +/** + * @author JayDi85 + */ +public class OathbreakerDuelType extends MatchType { + + public OathbreakerDuelType() { + this.name = "Oathbreaker Two Player Duel"; + this.maxPlayers = 2; + this.minPlayers = 2; + this.numTeams = 0; + this.useAttackOption = false; + this.useRange = false; + this.sideboardingAllowed = false; + } + + protected OathbreakerDuelType(final OathbreakerDuelType matchType) { + super(matchType); + } + + @Override + public OathbreakerDuelType copy() { + return new OathbreakerDuelType(this); + } + +} diff --git a/Mage.Server.Plugins/Mage.Game.OathbreakerFreeForAll/src/mage/game/OathbreakerFreeForAll.java b/Mage.Server.Plugins/Mage.Game.OathbreakerFreeForAll/src/mage/game/OathbreakerFreeForAll.java index 55066b6f6f..4add5af79e 100644 --- a/Mage.Server.Plugins/Mage.Game.OathbreakerFreeForAll/src/mage/game/OathbreakerFreeForAll.java +++ b/Mage.Server.Plugins/Mage.Game.OathbreakerFreeForAll/src/mage/game/OathbreakerFreeForAll.java @@ -40,34 +40,6 @@ public class OathbreakerFreeForAll extends GameCommanderImpl { @Override protected void init(UUID choosingPlayerId) { - /* - // prepare commanders and signature spells info - playerSignatureSpell.clear(); - playerCommanders.clear(); - for (UUID playerId : state.getPlayerList(startingPlayerId)) { - UUID signatureSpell = null; - List commanders = new ArrayList<>(); - - Player player = getPlayer(playerId); - List searchList = new ArrayList<>(); - searchList.addAll(player.getCommandersIds()); - searchList.addAll(new ArrayList<>(player.getSideboard())); - for (UUID id : searchList) { - Card commander = this.getCard(id); - if (commander != null) { - if (commander.isInstantOrSorcery()) { - signatureSpell = commander.getId(); - } else if (!commanders.contains(commander.getId())) { - commanders.add(commander.getId()); - } - } - } - - playerSignatureSpell.put(playerId, signatureSpell); - playerCommanders.put(playerId, commanders); - } - */ - // init base commander game startingPlayerSkipsDraw = false; super.init(choosingPlayerId); diff --git a/Mage.Server.Plugins/pom.xml b/Mage.Server.Plugins/pom.xml index 497e462c37..96c567750d 100644 --- a/Mage.Server.Plugins/pom.xml +++ b/Mage.Server.Plugins/pom.xml @@ -30,6 +30,7 @@ Mage.Game.FreeformCommanderFreeForAll Mage.Game.BrawlDuel Mage.Game.BrawlFreeForAll + Mage.Game.OathbreakerDuel Mage.Game.OathbreakerFreeForAll Mage.Game.TwoPlayerDuel Mage.Player.AI diff --git a/Mage.Server/config/config.xml b/Mage.Server/config/config.xml index 500b4c29b2..baac728b02 100644 --- a/Mage.Server/config/config.xml +++ b/Mage.Server/config/config.xml @@ -69,234 +69,126 @@ - + - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - - - - - - - - - - - - - - + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - - - - - - - + + + + + + + - - - + + + - - + + - - - + + + - - - + + + - - - - - + + + + + - - + + - + \ No newline at end of file diff --git a/Mage.Server/pom.xml b/Mage.Server/pom.xml index b835f3e7df..b66193422e 100644 --- a/Mage.Server/pom.xml +++ b/Mage.Server/pom.xml @@ -192,6 +192,12 @@ runtime + + ${project.groupId} + mage-game-oathbreakerduel + ${project.version} + runtime + ${project.groupId} mage-game-oathbreakerfreeforall diff --git a/Mage.Server/release/config/config.xml b/Mage.Server/release/config/config.xml index 37cdb35f4c..fcaffeb49a 100644 --- a/Mage.Server/release/config/config.xml +++ b/Mage.Server/release/config/config.xml @@ -61,264 +61,128 @@ mailFromAddress="" /> - - - + + + - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - - - - - - - - - - - - - - + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +