Prevent backgrounds from being used as commanders no matter what (#10007)

This commit is contained in:
Alexander Novotny 2023-02-19 18:01:16 -08:00 committed by GitHub
parent f66644994f
commit 32002101ad
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 25 additions and 1 deletions

View file

@ -83,7 +83,7 @@ public abstract class AbstractCommander extends Constructed {
return false; return false;
} }
if (commander1.getAbilities().containsClass(ChooseABackgroundAbility.class) == commander2.hasSubTypeForDeckbuilding(SubType.BACKGROUND) if (commander1.getAbilities().containsClass(ChooseABackgroundAbility.class) == commander2.hasSubTypeForDeckbuilding(SubType.BACKGROUND)
|| commander2.getAbilities().containsClass(ChooseABackgroundAbility.class) == commander1.hasSubTypeForDeckbuilding(SubType.BACKGROUND)) { && commander2.getAbilities().containsClass(ChooseABackgroundAbility.class) == commander1.hasSubTypeForDeckbuilding(SubType.BACKGROUND)) {
return true; return true;
} }
if (commander1.hasSubTypeForDeckbuilding(SubType.BACKGROUND)) { if (commander1.hasSubTypeForDeckbuilding(SubType.BACKGROUND)) {

View file

@ -71,4 +71,28 @@ public class CommanderDeckValidationTest extends MageTestBase {
deckTester.validate(); deckTester.validate();
} }
@Test(expected = AssertionError.class)
public void testBackgrounds() {
DeckTester deckTester = new DeckTester(new Commander());
deckTester.addMaindeck("Forest", 98);
deckTester.addSideboard("Thrasios, Triton Hero", 1);
deckTester.addSideboard("Haunted One", 1);
deckTester.validate(
"Commanders without the 'Choose a Background' ability should not be able to have a background as an additional commander");
}
@Test()
public void testBackgrounds2() {
DeckTester deckTester = new DeckTester(new Commander());
deckTester.addMaindeck("Plains", 98);
deckTester.addSideboard("Abdel Adrian, Gorion's Ward", 1);
deckTester.addSideboard("Haunted One", 1);
deckTester.validate(
"Commanders with the 'Choose a Background' ability should be able to have a background as an additional commander");
}
} }