mirror of
https://github.com/correl/mage.git
synced 2024-12-26 03:00:11 +00:00
Fixed Centaur Omenreader not reducing creature casting mana costs.
This commit is contained in:
parent
c8411395b7
commit
0d49ccb623
1 changed files with 19 additions and 16 deletions
|
@ -34,8 +34,6 @@ import mage.Constants.Zone;
|
|||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.condition.Condition;
|
||||
import mage.abilities.decorator.ConditionalContinousEffect;
|
||||
import mage.abilities.effects.common.cost.SpellsCostReductionEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.filter.common.FilterCreatureCard;
|
||||
|
@ -60,11 +58,7 @@ public class CentaurOmenreader extends CardImpl<CentaurOmenreader> {
|
|||
this.toughness = new MageInt(3);
|
||||
|
||||
// As long as Centaur Omenreader is tapped, creature spells you cast cost {2} less to cast.
|
||||
ConditionalContinousEffect effect = new ConditionalContinousEffect(
|
||||
new SpellsCostReductionEffect(new FilterCreatureCard("creature spells"), 2),
|
||||
TappedCondition.getInstance(),
|
||||
"As long as {this} is tapped, creature spells you cast cost {2} less to cast");
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect));
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CentaurOmenreaderSpellsCostReductionEffect()));
|
||||
}
|
||||
|
||||
public CentaurOmenreader(final CentaurOmenreader card) {
|
||||
|
@ -77,18 +71,27 @@ public class CentaurOmenreader extends CardImpl<CentaurOmenreader> {
|
|||
}
|
||||
}
|
||||
|
||||
class TappedCondition implements Condition {
|
||||
class CentaurOmenreaderSpellsCostReductionEffect extends SpellsCostReductionEffect {
|
||||
|
||||
private static TappedCondition fInstance = new TappedCondition();
|
||||
public CentaurOmenreaderSpellsCostReductionEffect() {
|
||||
super(new FilterCreatureCard("creature spells"), 2);
|
||||
}
|
||||
|
||||
public static Condition getInstance() {
|
||||
return fInstance;
|
||||
protected CentaurOmenreaderSpellsCostReductionEffect(SpellsCostReductionEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Permanent permanent = game.getBattlefield().getPermanent(source.getSourceId());
|
||||
|
||||
return permanent != null && permanent.isTapped();
|
||||
public boolean applies(Ability abilityToModify, Ability source, Game game) {
|
||||
Permanent sourcePermanent = game.getPermanent(source.getSourceId());
|
||||
if (sourcePermanent != null && sourcePermanent.isTapped()) {
|
||||
return super.applies(abilityToModify, source, game);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public CentaurOmenreaderSpellsCostReductionEffect copy() {
|
||||
return new CentaurOmenreaderSpellsCostReductionEffect(this);
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue