diff --git a/Mage/src/mage/abilities/AbilitiesImpl.java b/Mage/src/mage/abilities/AbilitiesImpl.java index 0d0b9d289d4..b6c23575d3a 100644 --- a/Mage/src/mage/abilities/AbilitiesImpl.java +++ b/Mage/src/mage/abilities/AbilitiesImpl.java @@ -74,7 +74,11 @@ public class AbilitiesImpl extends ArrayList implements Ab for (T ability:this) { if (!(ability instanceof SpellAbility || ability instanceof PlayLandAbility)) { - rules.add(ability.getRule()); + if (ability.getRuleAtTheTop()) { + rules.add(0, ability.getRule()); + } else { + rules.add(ability.getRule()); + } } if (ability instanceof SpellAbility) { String kickerRule = getKickerRule(ability); diff --git a/Mage/src/mage/abilities/Ability.java b/Mage/src/mage/abilities/Ability.java index f64742d2747..5e3817f547c 100644 --- a/Mage/src/mage/abilities/Ability.java +++ b/Mage/src/mage/abilities/Ability.java @@ -365,4 +365,18 @@ public interface Ability extends Controllable, Serializable { */ public boolean isInUseableZone(Game game, MageObject source, boolean checkLKI); + /** + * Returns true if this ability has to be shown on top of the card. + * + * @return + */ + public boolean getRuleAtTheTop(); + + /** + * Sets the value for the ruleAtTheTop attribute + * + * @param ruleAtTheTop + */ + public void setRuleAtTheTop(boolean ruleAtTheTop); + } diff --git a/Mage/src/mage/abilities/AbilityImpl.java b/Mage/src/mage/abilities/AbilityImpl.java index 340f78d403a..d5ee254eb0f 100644 --- a/Mage/src/mage/abilities/AbilityImpl.java +++ b/Mage/src/mage/abilities/AbilityImpl.java @@ -75,6 +75,7 @@ public abstract class AbilityImpl> implements Ability { protected Zone zone; protected String name; protected boolean usesStack = true; + protected boolean ruleAtTheTop = false; @Override public abstract T copy(); @@ -108,6 +109,7 @@ public abstract class AbilityImpl> implements Ability { this.alternativeCosts.add((AlternativeCost)cost.copy()); } this.modes = ability.modes.copy(); + this.ruleAtTheTop = ability.ruleAtTheTop; } @Override @@ -507,4 +509,15 @@ public abstract class AbilityImpl> implements Ability { public String toString() { return getRule(); } + + @Override + public boolean getRuleAtTheTop() { + return ruleAtTheTop; + } + + @Override + public void setRuleAtTheTop(boolean ruleAtTheTop) { + this.ruleAtTheTop = ruleAtTheTop; + } } + diff --git a/Mage/src/mage/game/stack/StackAbility.java b/Mage/src/mage/game/stack/StackAbility.java index 63f602e804e..45128fa8d90 100644 --- a/Mage/src/mage/game/stack/StackAbility.java +++ b/Mage/src/mage/game/stack/StackAbility.java @@ -362,4 +362,14 @@ public class StackAbility implements StackObject, Ability { public boolean isCopy() { return false; } + + @Override + public boolean getRuleAtTheTop() { + return this.ability.getRuleAtTheTop(); + } + + @Override + public void setRuleAtTheTop(boolean ruleAtTheTop) { + this.ability.setRuleAtTheTop(ruleAtTheTop); + } }