From 4b985b322f74be4eaf6c5dee04bca84632a65bf3 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Tue, 24 Mar 2015 23:00:32 +0100 Subject: [PATCH] * Scroll of the Masters - Fixed activated ability (did add counter instaed of doing a boost until end of turn). --- .../mage/sets/fatereforged/ScrollOfTheMasters.java | 13 ++++++++----- .../dynamicvalue/common/CountersCount.java | 13 +++---------- 2 files changed, 11 insertions(+), 15 deletions(-) diff --git a/Mage.Sets/src/mage/sets/fatereforged/ScrollOfTheMasters.java b/Mage.Sets/src/mage/sets/fatereforged/ScrollOfTheMasters.java index 87b72be8d3..737a1f7ca5 100644 --- a/Mage.Sets/src/mage/sets/fatereforged/ScrollOfTheMasters.java +++ b/Mage.Sets/src/mage/sets/fatereforged/ScrollOfTheMasters.java @@ -33,11 +33,14 @@ import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.common.SpellCastControllerTriggeredAbility; import mage.abilities.costs.common.TapSourceCost; import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.dynamicvalue.common.CountersCount; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.continuous.BoostTargetEffect; import mage.abilities.effects.common.counter.AddCountersSourceEffect; -import mage.abilities.effects.common.counter.AddCountersTargetEffect; import mage.cards.CardImpl; import mage.constants.CardType; +import mage.constants.Duration; import mage.constants.Rarity; import mage.constants.Zone; import mage.counters.CounterType; @@ -66,14 +69,14 @@ public class ScrollOfTheMasters extends CardImpl { this.addAbility(new SpellCastControllerTriggeredAbility(new AddCountersSourceEffect(CounterType.LORE.createInstance()), filterNonCreature, false)); // {3}, {T}: Target creature you control gets +1/+1 until end of turn for each lore counter on Scroll of the Masters. + DynamicValue xValue = new CountersCount(CounterType.LORE); + Effect effect = new BoostTargetEffect(xValue, xValue, Duration.EndOfTurn); + effect.setText("Target creature you control gets +1/+1 until end of turn for each lore counter on {this}"); Ability ability = new SimpleActivatedAbility( - Zone.BATTLEFIELD, - new AddCountersTargetEffect(CounterType.P1P1.createInstance(0), new CountersCount(CounterType.LORE)), - new ManaCostsImpl("{3}")); + Zone.BATTLEFIELD, effect, new ManaCostsImpl("{3}")); ability.addTarget(new TargetControlledCreaturePermanent()); ability.addCost(new TapSourceCost()); this.addAbility(ability); - } public ScrollOfTheMasters(final ScrollOfTheMasters card) { diff --git a/Mage/src/mage/abilities/dynamicvalue/common/CountersCount.java b/Mage/src/mage/abilities/dynamicvalue/common/CountersCount.java index a4a8dc99cf..fd0e392619 100644 --- a/Mage/src/mage/abilities/dynamicvalue/common/CountersCount.java +++ b/Mage/src/mage/abilities/dynamicvalue/common/CountersCount.java @@ -22,16 +22,9 @@ public class CountersCount implements DynamicValue { @Override public int calculate(Game game, Ability sourceAbility, Effect effect) { - Permanent p = game.getPermanent(sourceAbility.getSourceId()); - // if permanent already leaves the battlefield, try to find counters count via last known information - if (p == null) { - MageObject o = game.getLastKnownInformation(sourceAbility.getSourceId(), Zone.BATTLEFIELD); - if (o instanceof Permanent) { - p = (Permanent) o; - } - } - if (p != null) { - return p.getCounters().getCount(counter); + Permanent permanent = game.getPermanentOrLKIBattlefield(sourceAbility.getSourceId()); + if (permanent != null) { + return permanent.getCounters().getCount(counter); } return 0; }