Ability refactor: new code to search abilities in cards and permanents;

This commit is contained in:
Oleg Agafonov 2020-05-28 22:34:27 +04:00
parent 978118148b
commit 8af43dc13a
31 changed files with 85 additions and 47 deletions

View file

@ -51,7 +51,7 @@ public class GainAbilityControlledSpellsEffect extends ContinuousEffectImpl {
if ((stackObject instanceof Spell) && !stackObject.isCopy() && stackObject.isControlledBy(source.getControllerId())) {
Spell spell = (Spell) stackObject;
if (filter.match(spell, game)) {
if (!spell.getAbilities().contains(ability)) {
if (!spell.hasAbility(ability, game)) {
game.getState().addOtherAbility(spell.getCard(), ability);
}
}