diff --git a/Mage/src/mage/game/command/Commander.java b/Mage/src/mage/game/command/Commander.java index 8bbede3a1bd..db5ca941a2f 100644 --- a/Mage/src/mage/game/command/Commander.java +++ b/Mage/src/mage/game/command/Commander.java @@ -51,7 +51,7 @@ import mage.game.Game; public class Commander implements CommandObject{ private final Card card; - private final Abilities abilites = new AbilitiesImpl(); + private final Abilities abilites = new AbilitiesImpl<>(); public Commander(Card card){ @@ -128,6 +128,15 @@ public class Commander implements CommandObject{ return abilites; } + @Override + public boolean hasAbility(UUID abilityId, Game game) { + if (this.getAbilities().containsKey(abilityId)) { + return true; + } + Abilities otherAbilities = game.getState().getAllOtherAbilities(getId()); + return otherAbilities != null && otherAbilities.containsKey(abilityId); + } + @Override public ObjectColor getColor() { return card.getColor(); diff --git a/Mage/src/mage/game/command/Emblem.java b/Mage/src/mage/game/command/Emblem.java index e80e3a544f1..b87aedf9085 100644 --- a/Mage/src/mage/game/command/Emblem.java +++ b/Mage/src/mage/game/command/Emblem.java @@ -132,6 +132,11 @@ public class Emblem implements CommandObject { return abilites; } + @Override + public boolean hasAbility(UUID abilityId, Game game) { + return abilites.containsKey(abilityId); + } + @Override public ObjectColor getColor() { return emptyColor; diff --git a/Mage/src/mage/game/stack/Spell.java b/Mage/src/mage/game/stack/Spell.java index af56e853196..83cef4d736e 100644 --- a/Mage/src/mage/game/stack/Spell.java +++ b/Mage/src/mage/game/stack/Spell.java @@ -565,6 +565,11 @@ public class Spell> implements StackObject, Card { return card.getAbilities(); } + @Override + public boolean hasAbility(UUID abilityId, Game game) { + return card.hasAbility(abilityId, game); + } + @Override public ObjectColor getColor() { return card.getColor(); diff --git a/Mage/src/mage/game/stack/StackAbility.java b/Mage/src/mage/game/stack/StackAbility.java index 17a73f75de4..9f735ea4928 100644 --- a/Mage/src/mage/game/stack/StackAbility.java +++ b/Mage/src/mage/game/stack/StackAbility.java @@ -146,6 +146,11 @@ public class StackAbility implements StackObject, Ability { return emptyAbilites; } + @Override + public boolean hasAbility(UUID abilityId, Game game) { + return false; + } + @Override public ObjectColor getColor() { return emptyColor;