This commit is contained in:
Alex W. Jackson 2022-09-20 21:05:01 -04:00 committed by GitHub
parent 39bf4bf0bc
commit 41fb3d14cb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 28 additions and 31 deletions

View file

@ -1,7 +1,6 @@
package mage.abilities.keyword;
import java.util.Iterator;
import mage.MageObject;
import mage.abilities.Ability;
import mage.abilities.SpellAbility;
import mage.abilities.common.SimpleStaticAbility;
@ -188,23 +187,13 @@ class SpliceCardEffectImpl extends ContinuousEffectImpl implements SpliceCardEff
@Override
public boolean applies(Ability abilityToModify, Ability source, Game game) {
MageObject object = game.getObject(abilityToModify.getSourceId());
if (object != null && filter.match(object, game)) {
return spliceSpellCanBeActivated(source, game);
if (!filter.match(game.getObject(abilityToModify.getSourceId()), game)) {
return false;
}
return false;
}
private boolean spliceSpellCanBeActivated(Ability source, Game game) {
// check if spell can be activated (protection problem not solved because effect will be used from the base spell?)
Card card = game.getCard(source.getSourceId());
if (card != null) {
if (card.getManaCost().isEmpty()) { // e.g. Evermind
return card.getSpellAbility().spellCanBeActivatedRegularlyNow(source.getControllerId(), game);
} else {
return card.getSpellAbility().canActivate(source.getControllerId(), game).canActivate();
}
if (card == null) {
return false;
}
return false;
return card.getSpellAbility().canSpliceOnto(abilityToModify, game);
}
}