mirror of
https://github.com/magefree/mage.git
synced 2025-12-30 15:32:08 -08:00
Add Freeform Unlimited Commander game type
Currently there's no multiplayer format that allows players to cast spells from the command zone and also allows any deck size. This is a problem for players who want to test EDH Cube decks. These decks: - can have any size - often between 40 and 100 - with no standard - can have cards outside the commander's color identity - may break the singleton rule Create a game and deck type to accommodate these types of decks. Notable differences from Freeform Commander in addition to the above: - Decks can have any number of cards in the maindeck or sideboard - Sideboard cards can be any type - There are no illegal expansions - Games can have a minimum 2 players
This commit is contained in:
parent
217517feee
commit
c3cb54f371
15 changed files with 426 additions and 1 deletions
|
|
@ -0,0 +1,56 @@
|
|||
package org.mage.test.deck;
|
||||
|
||||
import mage.cards.decks.Deck;
|
||||
import mage.deck.FreeformUnlimitedCommander;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
import org.mage.test.serverside.base.MageTestPlayerBase;
|
||||
|
||||
public class FreeformUnlimitedCommanderTest extends MageTestPlayerBase {
|
||||
|
||||
@Test
|
||||
public void test_construct_returnsFreeformPlusCommander() {
|
||||
// Act
|
||||
FreeformUnlimitedCommander deck = new FreeformUnlimitedCommander();
|
||||
|
||||
// Assert
|
||||
Assert.assertEquals(FreeformUnlimitedCommander.class, deck.getClass());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test_getDeckMinSize_returns0() {
|
||||
// Arrange
|
||||
FreeformUnlimitedCommander deck = new FreeformUnlimitedCommander();
|
||||
|
||||
// Act
|
||||
int actual = deck.getDeckMinSize();
|
||||
|
||||
// Assert
|
||||
Assert.assertEquals(0, actual);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test_getSideboardMinSize_returns0() {
|
||||
// Arrange
|
||||
FreeformUnlimitedCommander deck = new FreeformUnlimitedCommander();
|
||||
|
||||
// Act
|
||||
int actual = deck.getSideboardMinSize();
|
||||
|
||||
// Assert
|
||||
Assert.assertEquals(0, actual);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test_validate_returnsTrue() {
|
||||
// Arrange
|
||||
FreeformUnlimitedCommander deck = new FreeformUnlimitedCommander();
|
||||
Deck example = new Deck();
|
||||
|
||||
// Act
|
||||
boolean actual = deck.validate(example);
|
||||
|
||||
// Assert
|
||||
Assert.assertTrue(actual);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,64 @@
|
|||
package org.mage.test.game.FreeformUnlimitedCommander;
|
||||
|
||||
import mage.game.FreeformUnlimitedCommanderMatch;
|
||||
import mage.game.match.Match;
|
||||
import mage.game.match.MatchOptions;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
import org.mage.test.serverside.base.MageTestPlayerBase;
|
||||
|
||||
public class FreeformUnlimitedCommanderMatchTest extends MageTestPlayerBase {
|
||||
|
||||
@Test
|
||||
public void test_construct_returnsFreeformPlusCommanderMatch() {
|
||||
// Arrange
|
||||
MatchOptions options = new MatchOptions(
|
||||
"test name",
|
||||
"test match name",
|
||||
false,
|
||||
2
|
||||
);
|
||||
|
||||
// Act
|
||||
Match match = new FreeformUnlimitedCommanderMatch(options);
|
||||
|
||||
// Assert
|
||||
Assert.assertEquals(FreeformUnlimitedCommanderMatch.class, match.getClass());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test_getName_returnsTestName() {
|
||||
// Arrange
|
||||
MatchOptions options = new MatchOptions(
|
||||
"test name",
|
||||
"test match name",
|
||||
false,
|
||||
2
|
||||
);
|
||||
Match match = new FreeformUnlimitedCommanderMatch(options);
|
||||
|
||||
// Act
|
||||
String actual = match.getName();
|
||||
|
||||
// Assert
|
||||
Assert.assertEquals("test name", actual);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test_getOptions_returnsOriginalOptions() {
|
||||
// Arrange
|
||||
MatchOptions options = new MatchOptions(
|
||||
"test name",
|
||||
"test match name",
|
||||
false,
|
||||
2
|
||||
);
|
||||
Match match = new FreeformUnlimitedCommanderMatch(options);
|
||||
|
||||
// Act
|
||||
MatchOptions actual = match.getOptions();
|
||||
|
||||
// Assert
|
||||
Assert.assertEquals(options, actual);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
package org.mage.test.game.FreeformUnlimitedCommander;
|
||||
|
||||
import mage.constants.MultiplayerAttackOption;
|
||||
import mage.constants.RangeOfInfluence;
|
||||
import mage.game.FreeformUnlimitedCommander;
|
||||
import mage.game.mulligan.LondonMulligan;
|
||||
import mage.game.mulligan.Mulligan;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
import org.mage.test.serverside.base.MageTestPlayerBase;
|
||||
|
||||
public class FreeformUnlimitedCommanderTest extends MageTestPlayerBase {
|
||||
|
||||
@Test
|
||||
public void test_construct_returnsFreeformPlusCommander() {
|
||||
// Arrange
|
||||
Mulligan mulligan = new LondonMulligan(1);
|
||||
int startLife = 40;
|
||||
|
||||
// Assert
|
||||
FreeformUnlimitedCommander game = new FreeformUnlimitedCommander(
|
||||
MultiplayerAttackOption.MULTIPLE,
|
||||
RangeOfInfluence.ALL,
|
||||
mulligan,
|
||||
startLife
|
||||
);
|
||||
|
||||
// Assert
|
||||
Assert.assertEquals(FreeformUnlimitedCommander.class, game.getClass());
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,100 @@
|
|||
package org.mage.test.game.FreeformUnlimitedCommander;
|
||||
|
||||
import mage.game.FreeformUnlimitedCommanderType;
|
||||
import mage.game.match.MatchType;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
import org.mage.test.serverside.base.MageTestPlayerBase;
|
||||
|
||||
public class FreeformUnlimitedCommanderTypeTest extends MageTestPlayerBase {
|
||||
|
||||
@Test
|
||||
public void test_construct_returnsFreeformPlusCommanderType() {
|
||||
// Act
|
||||
MatchType gameType = new FreeformUnlimitedCommanderType();
|
||||
|
||||
// Assert
|
||||
Assert.assertEquals(FreeformUnlimitedCommanderType.class, gameType.getClass());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test_toString_returnsFreeformPlusCommander() {
|
||||
// Arrange
|
||||
MatchType gametype = new FreeformUnlimitedCommanderType();
|
||||
|
||||
// Assert
|
||||
Assert.assertEquals("Freeform Unlimited Commander", gametype.toString());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test_getName_returnsFreeformPlusCommander() {
|
||||
// Arrange
|
||||
MatchType gametype = new FreeformUnlimitedCommanderType();
|
||||
|
||||
// Assert
|
||||
Assert.assertEquals("Freeform Unlimited Commander", gametype.getName());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test_getMinPlayers_returns3() {
|
||||
// Arrange
|
||||
MatchType gametype = new FreeformUnlimitedCommanderType();
|
||||
|
||||
// Assert
|
||||
Assert.assertEquals(2, gametype.getMinPlayers());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test_getMaxPlayers_returns10() {
|
||||
// Arrange
|
||||
MatchType gametype = new FreeformUnlimitedCommanderType();
|
||||
|
||||
// Assert
|
||||
Assert.assertEquals(10, gametype.getMaxPlayers());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test_getNumTeams_returns0() {
|
||||
// Arrange
|
||||
MatchType gametype = new FreeformUnlimitedCommanderType();
|
||||
|
||||
// Assert
|
||||
Assert.assertEquals(0, gametype.getNumTeams());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test_getPlayersPerTeam_returns0() {
|
||||
// Arrange
|
||||
MatchType gametype = new FreeformUnlimitedCommanderType();
|
||||
|
||||
// Assert
|
||||
Assert.assertEquals(0, gametype.getPlayersPerTeam());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test_isUseRange_returnsTrue() {
|
||||
// Arrange
|
||||
MatchType gametype = new FreeformUnlimitedCommanderType();
|
||||
|
||||
// Assert
|
||||
Assert.assertTrue(gametype.isUseRange());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test_isUseAttackOption_returnsTrue() {
|
||||
// Arrange
|
||||
MatchType gametype = new FreeformUnlimitedCommanderType();
|
||||
|
||||
// Assert
|
||||
Assert.assertTrue(gametype.isUseAttackOption());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test_isSideboardingAllowed_returnsFalse() {
|
||||
// Arrange
|
||||
MatchType gametype = new FreeformUnlimitedCommanderType();
|
||||
|
||||
// Assert
|
||||
Assert.assertFalse(gametype.isSideboardingAllowed());
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue