From eb802431fa954a585959cbc800ed411d30503035 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Fri, 13 Jan 2017 23:36:22 +0100 Subject: [PATCH] * Duel Commander - Removed commander damage logic. --- .../src/mage/game/CommanderDuelMatch.java | 4 +++- .../java/mage/game/GameCommanderImpl.java | 21 ++++++++++++------- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/Mage.Server.Plugins/Mage.Game.CommanderDuel/src/mage/game/CommanderDuelMatch.java b/Mage.Server.Plugins/Mage.Game.CommanderDuel/src/mage/game/CommanderDuelMatch.java index 1090c4bd64..65a1edefa9 100644 --- a/Mage.Server.Plugins/Mage.Game.CommanderDuel/src/mage/game/CommanderDuelMatch.java +++ b/Mage.Server.Plugins/Mage.Game.CommanderDuel/src/mage/game/CommanderDuelMatch.java @@ -25,7 +25,6 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.game; import mage.game.match.MatchImpl; @@ -46,11 +45,14 @@ public class CommanderDuelMatch extends MatchImpl { int startLife = 40; boolean alsoHand = true; // Don't like it to compare but seems like it's complicated to do it in another way + boolean checkCommanderDamage = true; if (options.getDeckType().equals("Variant Magic - Duel Commander")) { startLife = 20; // Starting with the Commander 2016 update (on November 11th, 2016), Duel Commander will be played with 20 life points instead of 30. alsoHand = true; // commander going to hand allowed to go to command zone effective July 17, 2015 + checkCommanderDamage = false; // since nov 16 duel commander uses no longer commander damage rule } CommanderDuel game = new CommanderDuel(options.getAttackOption(), options.getRange(), options.getFreeMulligans(), startLife); + game.setCheckCommanderDamage(checkCommanderDamage); game.setStartMessage(this.createGameStartMessage()); game.setAlsoHand(alsoHand); game.setAlsoLibrary(true); diff --git a/Mage/src/main/java/mage/game/GameCommanderImpl.java b/Mage/src/main/java/mage/game/GameCommanderImpl.java index 45d23434ed..9ec1ab4b1e 100644 --- a/Mage/src/main/java/mage/game/GameCommanderImpl.java +++ b/Mage/src/main/java/mage/game/GameCommanderImpl.java @@ -27,7 +27,6 @@ */ package mage.game; -import java.util.HashMap; import java.util.HashSet; import java.util.Map; import java.util.Set; @@ -38,7 +37,6 @@ import mage.abilities.effects.common.InfoEffect; import mage.abilities.effects.common.continuous.CommanderReplacementEffect; import mage.abilities.effects.common.cost.CommanderCostModification; import mage.cards.Card; -import mage.cards.Cards; import mage.constants.MultiplayerAttackOption; import mage.constants.PhaseStep; import mage.constants.RangeOfInfluence; @@ -49,11 +47,8 @@ import mage.watchers.common.CommanderInfoWatcher; public abstract class GameCommanderImpl extends GameImpl { - static boolean CHECK_COMMANDER_DAMAGE = true; - - private final Map mulliganedCards = new HashMap<>(); - // private final Set commanderCombatWatcher = new HashSet<>(); - + // private final Map mulliganedCards = new HashMap<>(); + protected boolean checkCommanderDamage; protected boolean alsoHand; // replace commander going to hand protected boolean alsoLibrary; // replace commander going to library protected boolean startingPlayerSkipsDraw = true; @@ -67,6 +62,7 @@ public abstract class GameCommanderImpl extends GameImpl { this.alsoHand = game.alsoHand; this.alsoLibrary = game.alsoLibrary; this.startingPlayerSkipsDraw = game.startingPlayerSkipsDraw; + this.checkCommanderDamage = game.checkCommanderDamage; } @Override @@ -85,7 +81,7 @@ public abstract class GameCommanderImpl extends GameImpl { ability.addEffect(new CommanderReplacementEffect(commander.getId(), alsoHand, alsoLibrary)); ability.addEffect(new CommanderCostModification(commander.getId())); getState().setValue(commander.getId() + "_castCount", 0); - CommanderInfoWatcher watcher = new CommanderInfoWatcher(commander.getId(), CHECK_COMMANDER_DAMAGE); + CommanderInfoWatcher watcher = new CommanderInfoWatcher(commander.getId(), checkCommanderDamage); getState().getWatchers().add(watcher); watcher.addCardInfoToCommander(this); } @@ -227,4 +223,13 @@ public abstract class GameCommanderImpl extends GameImpl { public void setAlsoLibrary(boolean alsoLibrary) { this.alsoLibrary = alsoLibrary; } + + public boolean isCheckCommanderDamage() { + return checkCommanderDamage; + } + + public void setCheckCommanderDamage(boolean checkCommanderDamage) { + this.checkCommanderDamage = checkCommanderDamage; + } + }