* Added tournament options for adjustable construction time and free mulligans

* Added duel options for free mulligans
This commit is contained in:
LevelX2 2013-06-14 23:45:30 +02:00
parent fa5ddb23a2
commit 84df0f2c43
27 changed files with 558 additions and 402 deletions

View file

@ -28,19 +28,19 @@
package mage.game;
import mage.game.match.MatchType;
import java.util.HashSet;
import java.util.Set;
import java.util.UUID;
import mage.Constants.MultiplayerAttackOption;
import mage.Constants.PhaseStep;
import mage.Constants.RangeOfInfluence;
import mage.game.match.MatchType;
import mage.game.turn.TurnMod;
public class TwoPlayerDuel extends GameImpl<TwoPlayerDuel> {
public TwoPlayerDuel(MultiplayerAttackOption attackOption, RangeOfInfluence range) {
super(attackOption, range);
public TwoPlayerDuel(MultiplayerAttackOption attackOption, RangeOfInfluence range, int freeMulligans) {
super(attackOption, range, freeMulligans);
}
public TwoPlayerDuel(final TwoPlayerDuel game) {
@ -78,8 +78,9 @@ public class TwoPlayerDuel extends GameImpl<TwoPlayerDuel> {
public Set<UUID> getOpponents(UUID playerId) {
Set<UUID> opponents = new HashSet<UUID>();
for (UUID opponentId: this.getPlayer(playerId).getInRange()) {
if (!opponentId.equals(playerId))
if (!opponentId.equals(playerId)) {
opponents.add(opponentId);
}
}
return opponents;
}

View file

@ -43,7 +43,7 @@ public class TwoPlayerMatch extends MatchImpl {
@Override
public void startGame() throws GameException {
TwoPlayerDuel game = new TwoPlayerDuel(options.getAttackOption(), options.getRange());
TwoPlayerDuel game = new TwoPlayerDuel(options.getAttackOption(), options.getRange(), options.getFreeMulligans());
// Sets a start message about the match score
game.setStartMessage(this.createGameStartMessage());
initGame(game);