diff --git a/Mage.Game.FreeForAll/build.xml b/Mage.Game.FreeForAll/build.xml new file mode 100644 index 00000000000..dfa6507b904 --- /dev/null +++ b/Mage.Game.FreeForAll/build.xml @@ -0,0 +1,74 @@ + + + + + + + + + + + Builds, tests, and runs the project Mage.Game.FreeForAll. + + + diff --git a/Mage.Game.FreeForAll/build/built-jar.properties b/Mage.Game.FreeForAll/build/built-jar.properties new file mode 100644 index 00000000000..193741dfdc2 --- /dev/null +++ b/Mage.Game.FreeForAll/build/built-jar.properties @@ -0,0 +1,3 @@ +#Sat May 15 15:46:16 EDT 2010 +C\:\\Projects\\Mage\\Mage= +C\:\\Projects\\Mage\\Mage.Game.FreeForAll= diff --git a/Mage.Game.FreeForAll/build/classes/mage/game/FreeForAll.class b/Mage.Game.FreeForAll/build/classes/mage/game/FreeForAll.class new file mode 100644 index 00000000000..7767d56a2b6 Binary files /dev/null and b/Mage.Game.FreeForAll/build/classes/mage/game/FreeForAll.class differ diff --git a/Mage.Game.FreeForAll/build/classes/mage/game/FreeForAllType.class b/Mage.Game.FreeForAll/build/classes/mage/game/FreeForAllType.class new file mode 100644 index 00000000000..f71c12961bb Binary files /dev/null and b/Mage.Game.FreeForAll/build/classes/mage/game/FreeForAllType.class differ diff --git a/Mage.Game.FreeForAll/dist/Mage.Game.FreeForAll.jar b/Mage.Game.FreeForAll/dist/Mage.Game.FreeForAll.jar new file mode 100644 index 00000000000..12b0257bce5 Binary files /dev/null and b/Mage.Game.FreeForAll/dist/Mage.Game.FreeForAll.jar differ diff --git a/Mage.Game.FreeForAll/dist/README.TXT b/Mage.Game.FreeForAll/dist/README.TXT new file mode 100644 index 00000000000..8cabd07b3a4 --- /dev/null +++ b/Mage.Game.FreeForAll/dist/README.TXT @@ -0,0 +1,33 @@ +======================== +BUILD OUTPUT DESCRIPTION +======================== + +When you build an Java application project that has a main class, the IDE +automatically copies all of the JAR +files on the projects classpath to your projects dist/lib folder. The IDE +also adds each of the JAR files to the Class-Path element in the application +JAR files manifest file (MANIFEST.MF). + +To run the project from the command line, go to the dist folder and +type the following: + +java -jar "Mage.Game.FreeForAll.jar" + +To distribute this project, zip up the dist folder (including the lib folder) +and distribute the ZIP file. + +Notes: + +* If two JAR files on the project classpath have the same name, only the first +JAR file is copied to the lib folder. +* Only JAR files are copied to the lib folder. +If the classpath contains other types of files or folders, none of the +classpath elements are copied to the lib folder. In such a case, +you need to copy the classpath elements to the lib folder manually after the build. +* If a library on the projects classpath also has a Class-Path element +specified in the manifest,the content of the Class-Path element has to be on +the projects runtime path. +* To set a main class in a standard Java project, right-click the project node +in the Projects window and choose Properties. Then click Run and enter the +class name in the Main Class field. Alternatively, you can manually type the +class name in the manifest Main-Class element. diff --git a/Mage.Game.FreeForAll/dist/lib/Mage.jar b/Mage.Game.FreeForAll/dist/lib/Mage.jar new file mode 100644 index 00000000000..57661e7a2ac Binary files /dev/null and b/Mage.Game.FreeForAll/dist/lib/Mage.jar differ diff --git a/Mage.Game.FreeForAll/nbproject/build-impl.xml b/Mage.Game.FreeForAll/nbproject/build-impl.xml new file mode 100644 index 00000000000..37391ca9c3d --- /dev/null +++ b/Mage.Game.FreeForAll/nbproject/build-impl.xml @@ -0,0 +1,819 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set src.dir + Must set test.src.dir + Must set build.dir + Must set dist.dir + Must set build.classes.dir + Must set dist.javadoc.dir + Must set build.test.classes.dir + Must set build.test.results.dir + Must set build.classes.excludes + Must set dist.jar + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set javac.includes + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select some files in the IDE or set javac.includes + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + To run this application from the command line without Ant, try: + + + + + + + java -cp "${run.classpath.with.dist.jar}" ${main.class} + + + + + + + + + + + + + + + + + + + + + + + To run this application from the command line without Ant, try: + + java -jar "${dist.jar.resolved}" + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select one file in the IDE or set run.class + + + + Must select one file in the IDE or set run.class + + + + + + + + + + + + + + + + + + + + + + + Must select one file in the IDE or set debug.class + + + + + Must select one file in the IDE or set debug.class + + + + + Must set fix.includes + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select some files in the IDE or set javac.includes + + + + + + + + + + + + + + + + + + + + Some tests failed; see details above. + + + + + + + + + Must select some files in the IDE or set test.includes + + + + Some tests failed; see details above. + + + + + Must select one file in the IDE or set test.class + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select one file in the IDE or set applet.url + + + + + + + + + Must select one file in the IDE or set applet.url + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Mage.Game.FreeForAll/nbproject/genfiles.properties b/Mage.Game.FreeForAll/nbproject/genfiles.properties new file mode 100644 index 00000000000..8bd309303a0 --- /dev/null +++ b/Mage.Game.FreeForAll/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=6f886882 +build.xml.script.CRC32=a48a8ca9 +build.xml.stylesheet.CRC32=958a1d3e@1.32.1.45 +# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. +# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. +nbproject/build-impl.xml.data.CRC32=6f886882 +nbproject/build-impl.xml.script.CRC32=12d9d337 +nbproject/build-impl.xml.stylesheet.CRC32=576378a2@1.32.1.45 diff --git a/Mage.Game.FreeForAll/nbproject/private/config.properties b/Mage.Game.FreeForAll/nbproject/private/config.properties new file mode 100644 index 00000000000..e69de29bb2d diff --git a/Mage.Game.FreeForAll/nbproject/private/private.properties b/Mage.Game.FreeForAll/nbproject/private/private.properties new file mode 100644 index 00000000000..2ba77fbb3dc --- /dev/null +++ b/Mage.Game.FreeForAll/nbproject/private/private.properties @@ -0,0 +1,6 @@ +compile.on.save=true +do.depend=false +do.jar=true +javac.debug=true +javadoc.preview=true +user.properties.file=C:\\Users\\Bill\\.netbeans\\6.8\\build.properties diff --git a/Mage.Game.FreeForAll/nbproject/private/private.xml b/Mage.Game.FreeForAll/nbproject/private/private.xml new file mode 100644 index 00000000000..cc2c0e57c4f --- /dev/null +++ b/Mage.Game.FreeForAll/nbproject/private/private.xml @@ -0,0 +1,4 @@ + + + + diff --git a/Mage.Game.FreeForAll/nbproject/project.properties b/Mage.Game.FreeForAll/nbproject/project.properties new file mode 100644 index 00000000000..6857c047d58 --- /dev/null +++ b/Mage.Game.FreeForAll/nbproject/project.properties @@ -0,0 +1,67 @@ +application.title=Mage.Game.FreeForAll +application.vendor=BetaSteward_at_googlemail.com +build.classes.dir=${build.dir}/classes +build.classes.excludes=**/*.java,**/*.form +# This directory is removed when the project is cleaned: +build.dir=build +build.generated.dir=${build.dir}/generated +build.generated.sources.dir=${build.dir}/generated-sources +# Only compile against the classpath explicitly listed here: +build.sysclasspath=ignore +build.test.classes.dir=${build.dir}/test/classes +build.test.results.dir=${build.dir}/test/results +# Uncomment to specify the preferred debugger connection transport: +#debug.transport=dt_socket +debug.classpath=\ + ${run.classpath} +debug.test.classpath=\ + ${run.test.classpath} +# This directory is removed when the project is cleaned: +dist.dir=dist +dist.jar=${dist.dir}/Mage.Game.FreeForAll.jar +dist.javadoc.dir=${dist.dir}/javadoc +endorsed.classpath= +excludes= +includes=** +jar.compress=false +javac.classpath=\ + ${reference.Mage.jar} +# Space-separated list of extra javac options +javac.compilerargs= +javac.deprecation=false +javac.source=1.6 +javac.target=1.6 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir}:\ + ${libs.junit.classpath}:\ + ${libs.junit_4.classpath} +javadoc.additionalparam= +javadoc.author=false +javadoc.encoding=${source.encoding} +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +meta.inf.dir=${src.dir}/META-INF +platform.active=default_platform +project.license=bsd +project.Mage=../Mage +reference.Mage.jar=${project.Mage}/dist/Mage.jar +run.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +# Space-separated list of JVM arguments used when running the project +# (you may also define separate properties like run-sys-prop.name=value instead of -Dname=value +# or test-sys-prop.name=value to set system properties for unit tests): +run.jvmargs= +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +source.encoding=UTF-8 +src.dir=src +test.src.dir=test diff --git a/Mage.Game.FreeForAll/nbproject/project.xml b/Mage.Game.FreeForAll/nbproject/project.xml new file mode 100644 index 00000000000..c7a2d5f71fb --- /dev/null +++ b/Mage.Game.FreeForAll/nbproject/project.xml @@ -0,0 +1,25 @@ + + + org.netbeans.modules.java.j2seproject + + + Mage.Game.FreeForAll + + + + + + + + + + Mage + jar + + jar + clean + jar + + + + diff --git a/Mage.Game.FreeForAll/src/mage/game/FreeForAll.java b/Mage.Game.FreeForAll/src/mage/game/FreeForAll.java new file mode 100644 index 00000000000..2c7d423ec8e --- /dev/null +++ b/Mage.Game.FreeForAll/src/mage/game/FreeForAll.java @@ -0,0 +1,98 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ + +package mage.game; + +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Set; +import java.util.UUID; +import mage.Constants.MultiplayerAttackOption; +import mage.Constants.RangeOfInfluence; +import mage.players.Player; + +/** + * + * @author BetaSteward_at_googlemail.com + */ +public class FreeForAll extends GameImpl { + + private int numPlayers; + private List mulliganed = new ArrayList(); + + public FreeForAll(MultiplayerAttackOption attackOption, RangeOfInfluence range) { + super(attackOption, range); + } + + @Override + public GameType getGameType() { + return new FreeForAllType(); + } + + @Override + public int getNumPlayers() { + return numPlayers; + } + + public void setNumPlayers(int numPlayers) { + this.numPlayers = numPlayers; + } + + @Override + public int getLife() { + return 20; + } + + @Override + public Set getOpponents(UUID playerId) { + Set opponents = new HashSet(); + for (UUID opponentId: this.getPlayer(playerId).getInRange()) { + if (!opponentId.equals(playerId)) + opponents.add(opponentId); + } + return opponents; + } + + @Override + public void mulligan(UUID playerId) { + Player player = getPlayer(playerId); + int numCards = player.getHand().size(); + //record first mulligan and increment card count + if (!mulliganed.contains(playerId)) { + numCards += 1; + mulliganed.add(playerId); + } + player.getLibrary().addAll(player.getHand()); + player.getHand().clear(); + player.shuffleLibrary(this); + player.drawCards(numCards - 1, this); + fireInformEvent(player.getName() + " mulligans down to " + Integer.toString(numCards - 1) + " cards"); + } + +} diff --git a/Mage.Game.FreeForAll/src/mage/game/FreeForAllType.java b/Mage.Game.FreeForAll/src/mage/game/FreeForAllType.java new file mode 100644 index 00000000000..ee24d0675a2 --- /dev/null +++ b/Mage.Game.FreeForAll/src/mage/game/FreeForAllType.java @@ -0,0 +1,45 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ + +package mage.game; + +/** + * + * @author BetaSteward_at_googlemail.com + */ +public class FreeForAllType extends GameType { + + public FreeForAllType() { + this.name = "Free For All"; + this.maxPlayers = 10; + this.minPlayers = 3; + this.numTeams = 0; + this.useAttackOption = true; + this.useRange = true; + } +}