forked from External/mage
* Split cards - added spliced effects support for fused spells, no more double splice pays (#6493, #6549);
This commit is contained in:
parent
b38ac2f575
commit
a75d08283f
5 changed files with 144 additions and 5 deletions
|
|
@ -10,12 +10,14 @@ import mage.cards.Card;
|
|||
import mage.constants.ColoredManaSymbol;
|
||||
import mage.constants.EmptyNames;
|
||||
import mage.constants.ManaType;
|
||||
import mage.constants.SpellAbilityType;
|
||||
import mage.filter.Filter;
|
||||
import mage.filter.predicate.mageobject.NamePredicate;
|
||||
import mage.game.CardState;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.game.permanent.token.Token;
|
||||
import mage.game.stack.Spell;
|
||||
import mage.util.functions.CopyTokenFunction;
|
||||
|
||||
import java.io.UnsupportedEncodingException;
|
||||
|
|
@ -767,4 +769,26 @@ public final class CardUtil {
|
|||
|
||||
return signedP + "/" + signedT;
|
||||
}
|
||||
|
||||
public static boolean isSpliceAbility(Ability ability, Game game) {
|
||||
if (ability instanceof SpellAbility) {
|
||||
return ((SpellAbility) ability).getSpellAbilityType() == SpellAbilityType.SPLICE;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static boolean isFusedPartAbility(Ability ability, Game game) {
|
||||
// TODO: is works fine with copies of spells on stack?
|
||||
if (ability instanceof SpellAbility) {
|
||||
Spell mainSpell = game.getSpell(ability.getId());
|
||||
if (mainSpell == null) {
|
||||
return true;
|
||||
} else {
|
||||
SpellAbility mainSpellAbility = mainSpell.getSpellAbility();
|
||||
return mainSpellAbility.getSpellAbilityType() == SpellAbilityType.SPLIT_FUSED
|
||||
&& !ability.equals(mainSpellAbility);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue