Fixed Beastmaster Ascension not working. Try not to use names for counters, use CounterType instead.

This commit is contained in:
magenoxx 2011-08-10 22:38:09 +04:00
parent 60a865ed19
commit 86d306429c
3 changed files with 5 additions and 3 deletions

View file

@ -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;

View file

@ -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;
}

View file

@ -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<PermanentCard> {
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());