From 86d306429ca8ac60e3a07f6ee9d2ccaf9bd3df9c Mon Sep 17 00:00:00 2001 From: magenoxx Date: Wed, 10 Aug 2011 22:38:09 +0400 Subject: [PATCH] Fixed Beastmaster Ascension not working. Try not to use names for counters, use CounterType instead. --- Mage.Sets/src/mage/sets/zendikar/BeastmasterAscension.java | 3 ++- Mage/src/mage/abilities/dynamicvalue/common/CountersCount.java | 2 +- Mage/src/mage/game/permanent/PermanentCard.java | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Mage.Sets/src/mage/sets/zendikar/BeastmasterAscension.java b/Mage.Sets/src/mage/sets/zendikar/BeastmasterAscension.java index faa9b79244..fe0f7577fc 100644 --- a/Mage.Sets/src/mage/sets/zendikar/BeastmasterAscension.java +++ b/Mage.Sets/src/mage/sets/zendikar/BeastmasterAscension.java @@ -39,6 +39,7 @@ import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.common.continious.BoostControlledEffect; import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.cards.CardImpl; +import mage.counters.CounterType; import mage.counters.common.QuestCounter; import mage.game.Game; import mage.game.events.GameEvent; @@ -118,7 +119,7 @@ class BeastmasterAscensionEffect extends BoostControlledEffect { @Override public boolean apply(Game game, Ability source) { Permanent permanent = game.getPermanent(source.getSourceId()); - if (permanent != null && permanent.getCounters().getCount("quest") > 6) { + if (permanent != null && permanent.getCounters().getCount(CounterType.QUEST) > 6) { super.apply(game, source); } return false; diff --git a/Mage/src/mage/abilities/dynamicvalue/common/CountersCount.java b/Mage/src/mage/abilities/dynamicvalue/common/CountersCount.java index 1f7243eeb9..061ca5bd2b 100644 --- a/Mage/src/mage/abilities/dynamicvalue/common/CountersCount.java +++ b/Mage/src/mage/abilities/dynamicvalue/common/CountersCount.java @@ -26,7 +26,7 @@ public class CountersCount implements DynamicValue { p = (Permanent) game.getLastKnownInformation(sourceAbility.getSourceId(), Constants.Zone.BATTLEFIELD); } if (p != null) { - return p.getCounters().getCount(counter.getName()); + return p.getCounters().getCount(counter); } return 0; } diff --git a/Mage/src/mage/game/permanent/PermanentCard.java b/Mage/src/mage/game/permanent/PermanentCard.java index 681cc50e3d..50f65e7289 100644 --- a/Mage/src/mage/game/permanent/PermanentCard.java +++ b/Mage/src/mage/game/permanent/PermanentCard.java @@ -40,6 +40,7 @@ import mage.abilities.common.ZoneChangeTriggeredAbility; import mage.abilities.keyword.LevelAbility; import mage.cards.Card; import mage.cards.LevelerCard; +import mage.counters.CounterType; import mage.game.Game; import mage.game.events.GameEvent; import mage.game.events.ZoneChangeEvent; @@ -100,7 +101,7 @@ public class PermanentCard extends PermanentImpl { this.power = card.getPower(); this.toughness = card.getToughness(); if (card instanceof LevelerCard) { - LevelAbility level = ((LevelerCard)card).getLevel(this.getCounters().getCount("Level")); + LevelAbility level = ((LevelerCard)card).getLevel(this.getCounters().getCount(CounterType.LEVEL)); if (level != null) { this.power.setValue(level.getPower()); this.toughness.setValue(level.getToughness());