mirror of
https://github.com/correl/mage.git
synced 2024-12-24 11:50:45 +00:00
* Added new game type: Freeform Commander Two Player Duel (#5771)
This commit is contained in:
parent
fc1fa70e0d
commit
060ebe655e
9 changed files with 159 additions and 3 deletions
|
@ -683,8 +683,9 @@ public class NewTableDialog extends MageDialog {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case "Freeform Commander Two Player Duel":
|
||||||
case "Freeform Commander Free For All":
|
case "Freeform Commander Free For All":
|
||||||
if (!options.getDeckType().equals("Variant Magic - Freeform Commander")){
|
if (!options.getDeckType().equals("Variant Magic - Freeform Commander")) {
|
||||||
JOptionPane.showMessageDialog(MageFrame.getDesktop(), "Deck type Freeform Commander needs also a Freeform Commander game type", "Error", JOptionPane.ERROR_MESSAGE);
|
JOptionPane.showMessageDialog(MageFrame.getDesktop(), "Deck type Freeform Commander needs also a Freeform Commander game type", "Error", JOptionPane.ERROR_MESSAGE);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
50
Mage.Server.Plugins/Mage.Game.FreeformCommanderDuel/pom.xml
Normal file
50
Mage.Server.Plugins/Mage.Game.FreeformCommanderDuel/pom.xml
Normal file
|
@ -0,0 +1,50 @@
|
||||||
|
|
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||||
|
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
<parent>
|
||||||
|
<groupId>org.mage</groupId>
|
||||||
|
<artifactId>mage-server-plugins</artifactId>
|
||||||
|
<version>1.4.35</version>
|
||||||
|
</parent>
|
||||||
|
|
||||||
|
<artifactId>mage-game-freeformcommanderduel</artifactId>
|
||||||
|
<packaging>jar</packaging>
|
||||||
|
<name>Mage Game Freeform Commander Two Player</name>
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>${project.groupId}</groupId>
|
||||||
|
<artifactId>mage</artifactId>
|
||||||
|
<version>${project.version}</version>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
|
||||||
|
<build>
|
||||||
|
<sourceDirectory>src</sourceDirectory>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
|
<configuration>
|
||||||
|
<source>1.8</source>
|
||||||
|
<target>1.8</target>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<artifactId>maven-resources-plugin</artifactId>
|
||||||
|
<configuration>
|
||||||
|
<encoding>UTF-8</encoding>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
|
||||||
|
</plugins>
|
||||||
|
|
||||||
|
<finalName>mage-game-freeformcommanderduel</finalName>
|
||||||
|
</build>
|
||||||
|
|
||||||
|
<properties/>
|
||||||
|
|
||||||
|
</project>
|
|
@ -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 FreeformCommanderDuel extends GameCommanderImpl {
|
||||||
|
|
||||||
|
public FreeformCommanderDuel(MultiplayerAttackOption attackOption, RangeOfInfluence range, Mulligan mulligan, int startLife) {
|
||||||
|
super(attackOption, range, mulligan, startLife);
|
||||||
|
}
|
||||||
|
|
||||||
|
public FreeformCommanderDuel(final FreeformCommanderDuel game) {
|
||||||
|
super(game);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public MatchType getGameType() {
|
||||||
|
return new FreeformCommanderDuelType();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getNumPlayers() {
|
||||||
|
return 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public FreeformCommanderDuel copy() {
|
||||||
|
return new FreeformCommanderDuel(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,31 @@
|
||||||
|
package mage.game;
|
||||||
|
|
||||||
|
import mage.game.match.MatchImpl;
|
||||||
|
import mage.game.match.MatchOptions;
|
||||||
|
import mage.game.mulligan.Mulligan;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author JayDi85
|
||||||
|
*/
|
||||||
|
public class FreeformCommanderDuelMatch extends MatchImpl {
|
||||||
|
|
||||||
|
public FreeformCommanderDuelMatch(MatchOptions options) {
|
||||||
|
super(options);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void startGame() throws GameException {
|
||||||
|
int startLife = 20;
|
||||||
|
boolean alsoHand = true;
|
||||||
|
boolean checkCommanderDamage = true;
|
||||||
|
|
||||||
|
Mulligan mulligan = options.getMulliganType().getMulligan(options.getFreeMulligans());
|
||||||
|
FreeformCommanderDuel game = new FreeformCommanderDuel(options.getAttackOption(), options.getRange(), mulligan, startLife);
|
||||||
|
game.setCheckCommanderDamage(checkCommanderDamage);
|
||||||
|
game.setStartMessage(this.createGameStartMessage());
|
||||||
|
game.setAlsoHand(alsoHand);
|
||||||
|
game.setAlsoLibrary(true);
|
||||||
|
initGame(game);
|
||||||
|
games.add(game);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,29 @@
|
||||||
|
package mage.game;
|
||||||
|
|
||||||
|
import mage.game.match.MatchType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author JayDi85
|
||||||
|
*/
|
||||||
|
public class FreeformCommanderDuelType extends MatchType {
|
||||||
|
|
||||||
|
public FreeformCommanderDuelType() {
|
||||||
|
this.name = "Freeform Commander Two Player Duel";
|
||||||
|
this.maxPlayers = 2;
|
||||||
|
this.minPlayers = 2;
|
||||||
|
this.numTeams = 0;
|
||||||
|
this.useAttackOption = false;
|
||||||
|
this.useRange = false;
|
||||||
|
this.sideboardingAllowed = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected FreeformCommanderDuelType(final FreeformCommanderDuelType matchType) {
|
||||||
|
super(matchType);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public FreeformCommanderDuelType copy() {
|
||||||
|
return new FreeformCommanderDuelType(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -25,8 +25,9 @@
|
||||||
<module>Mage.Game.TinyLeadersDuel</module>
|
<module>Mage.Game.TinyLeadersDuel</module>
|
||||||
<module>Mage.Game.CanadianHighlanderDuel</module>
|
<module>Mage.Game.CanadianHighlanderDuel</module>
|
||||||
<module>Mage.Game.PennyDreadfulCommanderFreeForAll</module>
|
<module>Mage.Game.PennyDreadfulCommanderFreeForAll</module>
|
||||||
<module>Mage.Game.FreeformCommanderFreeForAll</module>
|
<module>Mage.Game.FreeformCommanderDuel</module>
|
||||||
<module>Mage.Game.BrawlDuel</module>
|
<module>Mage.Game.FreeformCommanderFreeForAll</module>
|
||||||
|
<module>Mage.Game.BrawlDuel</module>
|
||||||
<module>Mage.Game.BrawlFreeForAll</module>
|
<module>Mage.Game.BrawlFreeForAll</module>
|
||||||
<module>Mage.Game.TwoPlayerDuel</module>
|
<module>Mage.Game.TwoPlayerDuel</module>
|
||||||
<module>Mage.Player.AI</module>
|
<module>Mage.Player.AI</module>
|
||||||
|
|
|
@ -79,6 +79,7 @@
|
||||||
<gameType name="Tiny Leaders Two Player Duel" jar="mage-game-tinyleadersduel.jar" className="mage.game.TinyLeadersDuelMatch" typeName="mage.game.TinyLeadersDuelType"/>
|
<gameType name="Tiny Leaders Two Player Duel" jar="mage-game-tinyleadersduel.jar" className="mage.game.TinyLeadersDuelMatch" typeName="mage.game.TinyLeadersDuelType"/>
|
||||||
<gameType name="Canadian Highlander Two Player Duel" jar="mage-game-canadianhighlanderduel.jar" className="mage.game.CanadianHighlanderDuelMatch" typeName="mage.game.CanadianHighlanderDuelType"/>
|
<gameType name="Canadian Highlander Two Player Duel" jar="mage-game-canadianhighlanderduel.jar" className="mage.game.CanadianHighlanderDuelMatch" typeName="mage.game.CanadianHighlanderDuelType"/>
|
||||||
<gameType name="Penny Dreadful Commander Free For All" jar="mage-game-pennydreadfulcommanderfreeforall.jar" className="mage.game.PennyDreadfulCommanderFreeForAllMatch" typeName="mage.game.PennyDreadfulCommanderFreeForAllType"/>
|
<gameType name="Penny Dreadful Commander Free For All" jar="mage-game-pennydreadfulcommanderfreeforall.jar" className="mage.game.PennyDreadfulCommanderFreeForAllMatch" typeName="mage.game.PennyDreadfulCommanderFreeForAllType"/>
|
||||||
|
<gameType name="Freeform Commander Two Player Duel" jar="mage-game-freeformcommanderduel.jar" className="mage.game.FreeformCommanderDuelMatch" typeName="mage.game.FreeformCommanderDuelType"/>
|
||||||
<gameType name="Freeform Commander Free For All" jar="mage-game-freeformcommanderfreeforall.jar" className="mage.game.FreeformCommanderFreeForAllMatch" typeName="mage.game.FreeformCommanderFreeForAllType"/>
|
<gameType name="Freeform Commander Free For All" jar="mage-game-freeformcommanderfreeforall.jar" className="mage.game.FreeformCommanderFreeForAllMatch" typeName="mage.game.FreeformCommanderFreeForAllType"/>
|
||||||
<gameType name="Brawl Two Player Duel" jar="mage-game-brawlduel.jar" className="mage.game.BrawlDuelMatch" typeName="mage.game.BrawlDuelType"/>
|
<gameType name="Brawl Two Player Duel" jar="mage-game-brawlduel.jar" className="mage.game.BrawlDuelMatch" typeName="mage.game.BrawlDuelType"/>
|
||||||
<gameType name="Brawl Free For All" jar="mage-game-brawlfreeforall.jar" className="mage.game.BrawlFreeForAllMatch" typeName="mage.game.BrawlFreeForAllType"/>
|
<gameType name="Brawl Free For All" jar="mage-game-brawlfreeforall.jar" className="mage.game.BrawlFreeForAllMatch" typeName="mage.game.BrawlFreeForAllType"/>
|
||||||
|
|
|
@ -184,6 +184,12 @@
|
||||||
<version>${project.version}</version>
|
<version>${project.version}</version>
|
||||||
<scope>runtime</scope>
|
<scope>runtime</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>${project.groupId}</groupId>
|
||||||
|
<artifactId>mage-game-freeformcommanderduel</artifactId>
|
||||||
|
<version>${project.version}</version>
|
||||||
|
<scope>runtime</scope>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>${project.groupId}</groupId>
|
<groupId>${project.groupId}</groupId>
|
||||||
|
|
|
@ -73,6 +73,7 @@
|
||||||
<gameType name="Tiny Leaders Two Player Duel" jar="mage-game-tinyleadersduel-${project.version}.jar" className="mage.game.TinyLeadersDuelMatch" typeName="mage.game.TinyLeadersDuelType"/>
|
<gameType name="Tiny Leaders Two Player Duel" jar="mage-game-tinyleadersduel-${project.version}.jar" className="mage.game.TinyLeadersDuelMatch" typeName="mage.game.TinyLeadersDuelType"/>
|
||||||
<gameType name="Canadian Highlander Two Player Duel" jar="mage-game-canadianhighlanderduel-${project.version}.jar" className="mage.game.CanadianHighlanderDuelMatch" typeName="mage.game.CanadianHighlanderDuelType"/>
|
<gameType name="Canadian Highlander Two Player Duel" jar="mage-game-canadianhighlanderduel-${project.version}.jar" className="mage.game.CanadianHighlanderDuelMatch" typeName="mage.game.CanadianHighlanderDuelType"/>
|
||||||
<gameType name="Penny Dreadful Commander Free For All" jar="mage-game-pennydreadfulcommanderfreeforall-${project.version}.jar" className="mage.game.PennyDreadfulCommanderFreeForAllMatch" typeName="mage.game.PennyDreadfulCommanderFreeForAllType"/>
|
<gameType name="Penny Dreadful Commander Free For All" jar="mage-game-pennydreadfulcommanderfreeforall-${project.version}.jar" className="mage.game.PennyDreadfulCommanderFreeForAllMatch" typeName="mage.game.PennyDreadfulCommanderFreeForAllType"/>
|
||||||
|
<gameType name="Freeform Commander Two Player Duel" jar="mage-game-freeformcommanderduel-${project.version}.jar" className="mage.game.FreeformCommanderDuelMatch" typeName="mage.game.FreeformCommanderDuelType"/>
|
||||||
<gameType name="Freeform Commander Free For All" jar="mage-game-freeformcommanderfreeforall-${project.version}.jar" className="mage.game.FreeformCommanderFreeForAllMatch" typeName="mage.game.FreeformCommanderFreeForAllType"/>
|
<gameType name="Freeform Commander Free For All" jar="mage-game-freeformcommanderfreeforall-${project.version}.jar" className="mage.game.FreeformCommanderFreeForAllMatch" typeName="mage.game.FreeformCommanderFreeForAllType"/>
|
||||||
<gameType name="Brawl Two Player Duel" jar="mage-game-brawlduel-${project.version}.jar" className="mage.game.BrawlDuelMatch" typeName="mage.game.BrawlDuelType"/>
|
<gameType name="Brawl Two Player Duel" jar="mage-game-brawlduel-${project.version}.jar" className="mage.game.BrawlDuelMatch" typeName="mage.game.BrawlDuelType"/>
|
||||||
<gameType name="Brawl Free For All" jar="mage-game-brawlfreeforall-${project.version}.jar" className="mage.game.BrawlFreeForAllMatch" typeName="mage.game.BrawlFreeForAllType"/>
|
<gameType name="Brawl Free For All" jar="mage-game-brawlfreeforall-${project.version}.jar" className="mage.game.BrawlFreeForAllMatch" typeName="mage.game.BrawlFreeForAllType"/>
|
||||||
|
|
Loading…
Reference in a new issue