From 1727ec1fb512d9d911dcd844c74094a02b6e0f6a Mon Sep 17 00:00:00 2001 From: theelk801 Date: Sat, 1 Apr 2023 19:36:23 -0400 Subject: [PATCH] add battle card type to main branch --- Mage/src/main/java/mage/MageObject.java | 12 ++++++++++-- Mage/src/main/java/mage/constants/CardType.java | 1 + 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/Mage/src/main/java/mage/MageObject.java b/Mage/src/main/java/mage/MageObject.java index 1a668b8eab..7aed450b62 100644 --- a/Mage/src/main/java/mage/MageObject.java +++ b/Mage/src/main/java/mage/MageObject.java @@ -211,12 +211,20 @@ public interface MageObject extends MageItem, Serializable, Copyable return getCardType(game).contains(CardType.TRIBAL); } + default boolean isBattle() { + return isBattle(null); + } + + default boolean isBattle(Game game) { + return getCardType(game).contains(CardType.BATTLE); + } + default boolean isPermanent() { - return isCreature() || isArtifact() || isPlaneswalker() || isEnchantment() || isLand(); + return isCreature() || isArtifact() || isPlaneswalker() || isEnchantment() || isLand() || isBattle(); } default boolean isPermanent(Game game) { - return isCreature(game) || isArtifact(game) || isPlaneswalker(game) || isEnchantment(game) || isLand(game); + return isCreature(game) || isArtifact(game) || isPlaneswalker(game) || isEnchantment(game) || isLand(game) || isBattle(game); } default boolean isLegendary() { diff --git a/Mage/src/main/java/mage/constants/CardType.java b/Mage/src/main/java/mage/constants/CardType.java index 900e9e17cc..575528ae49 100644 --- a/Mage/src/main/java/mage/constants/CardType.java +++ b/Mage/src/main/java/mage/constants/CardType.java @@ -13,6 +13,7 @@ import java.util.List; */ public enum CardType { ARTIFACT("Artifact", true, true), + BATTLE("Battle", true, true), CONSPIRACY("Conspiracy", false, false), CREATURE("Creature", true, true), DUNGEON("Dungeon", false, false),