mirror of
https://github.com/correl/mage.git
synced 2024-11-14 19:19:32 +00:00
[MRD] fixed Hum of the Radix applying to non-artifact spells (fixes #7775)
This commit is contained in:
parent
735e65b023
commit
05d5eeb941
1 changed files with 15 additions and 13 deletions
|
@ -4,15 +4,18 @@ import mage.abilities.Ability;
|
||||||
import mage.abilities.SpellAbility;
|
import mage.abilities.SpellAbility;
|
||||||
import mage.abilities.common.SimpleStaticAbility;
|
import mage.abilities.common.SimpleStaticAbility;
|
||||||
import mage.abilities.effects.common.cost.CostModificationEffectImpl;
|
import mage.abilities.effects.common.cost.CostModificationEffectImpl;
|
||||||
|
import mage.cards.Card;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
import mage.constants.*;
|
import mage.constants.CardType;
|
||||||
import mage.filter.common.FilterArtifactPermanent;
|
import mage.constants.CostModificationType;
|
||||||
|
import mage.constants.Duration;
|
||||||
|
import mage.constants.Outcome;
|
||||||
|
import mage.filter.StaticFilters;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.util.CardUtil;
|
import mage.util.CardUtil;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import mage.cards.Card;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Pete Rossi
|
* @author Pete Rossi
|
||||||
|
@ -23,8 +26,7 @@ public final class HumOfTheRadix extends CardImpl {
|
||||||
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{G}{G}");
|
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{G}{G}");
|
||||||
|
|
||||||
// Each artifact spell costs {1} more to cast for each artifact its controller controls.
|
// Each artifact spell costs {1} more to cast for each artifact its controller controls.
|
||||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new HumOfTheRadixCostIncreaseEffect()));
|
this.addAbility(new SimpleStaticAbility(new HumOfTheRadixCostIncreaseEffect()));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private HumOfTheRadix(final HumOfTheRadix card) {
|
private HumOfTheRadix(final HumOfTheRadix card) {
|
||||||
|
@ -50,20 +52,20 @@ class HumOfTheRadixCostIncreaseEffect extends CostModificationEffectImpl {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(Game game, Ability source, Ability abilityToModify) {
|
public boolean apply(Game game, Ability source, Ability abilityToModify) {
|
||||||
int additionalCost = game.getBattlefield().getAllActivePermanents(new FilterArtifactPermanent(), abilityToModify.getControllerId(), game).size();
|
CardUtil.increaseCost(abilityToModify, game.getBattlefield().getActivePermanents(
|
||||||
CardUtil.increaseCost(abilityToModify, additionalCost);
|
StaticFilters.FILTER_CONTROLLED_PERMANENT_ARTIFACT,
|
||||||
|
abilityToModify.getControllerId(), source.getSourceId(), game
|
||||||
|
).size());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean applies(Ability abilityToModify, Ability source, Game game) {
|
public boolean applies(Ability abilityToModify, Ability source, Game game) {
|
||||||
if (abilityToModify instanceof SpellAbility) {
|
if (!(abilityToModify instanceof SpellAbility)) {
|
||||||
Card spellCard = ((SpellAbility) abilityToModify).getCharacteristics(game);
|
return false;
|
||||||
if (spellCard != null) {
|
|
||||||
return !spellCard.isArtifact();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return false;
|
Card spellCard = ((SpellAbility) abilityToModify).getCharacteristics(game);
|
||||||
|
return spellCard != null && spellCard.isArtifact();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in a new issue