diff --git a/Mage.Sets/src/mage/cards/e/Excavator.java b/Mage.Sets/src/mage/cards/e/Excavator.java index 827f0d2c21..9516f6212c 100644 --- a/Mage.Sets/src/mage/cards/e/Excavator.java +++ b/Mage.Sets/src/mage/cards/e/Excavator.java @@ -112,7 +112,7 @@ class ExcavatorEffect extends ContinuousEffectImpl implements SourceEffect { if (permanent != null) { for(Ability ability : abilities) { - permanent.addAbility(ability, source.getSourceId(), game, false); + permanent.addAbility(ability, source.getSourceId(), game); } } } diff --git a/Mage.Sets/src/mage/cards/m/Martyrdom.java b/Mage.Sets/src/mage/cards/m/Martyrdom.java index 067ad07278..a693c43277 100644 --- a/Mage.Sets/src/mage/cards/m/Martyrdom.java +++ b/Mage.Sets/src/mage/cards/m/Martyrdom.java @@ -66,7 +66,7 @@ class MartyrdomGainAbilityTargetEffect extends ContinuousEffectImpl { if (permanent != null) { ActivatedAbilityImpl ability = new MartyrdomActivatedAbility(source.getControllerId()); ability.setMayActivate(TargetController.ANY); - permanent.addAbility(ability, source.getSourceId(), game, false); + permanent.addAbility(ability, source.getSourceId(), game); return true; } return false; diff --git a/Mage.Sets/src/mage/cards/s/ShieldsOfVelisVel.java b/Mage.Sets/src/mage/cards/s/ShieldsOfVelisVel.java index 5afe8b026c..edc7d925e2 100644 --- a/Mage.Sets/src/mage/cards/s/ShieldsOfVelisVel.java +++ b/Mage.Sets/src/mage/cards/s/ShieldsOfVelisVel.java @@ -78,7 +78,7 @@ class ShieldsOfVelisVelGainEffect extends ContinuousEffectImpl { for (Iterator it = affectedObjectList.iterator(); it.hasNext();) { Permanent permanent = it.next().getPermanent(game); if (permanent != null) { - permanent.addAbility(ChangelingAbility.getInstance(), source.getSourceId(), game, false); + permanent.addAbility(ChangelingAbility.getInstance(), source.getSourceId(), game); } else { it.remove(); } diff --git a/Mage.Sets/src/mage/cards/t/TestamentOfFaith.java b/Mage.Sets/src/mage/cards/t/TestamentOfFaith.java index 0e99542953..a0980c9bec 100644 --- a/Mage.Sets/src/mage/cards/t/TestamentOfFaith.java +++ b/Mage.Sets/src/mage/cards/t/TestamentOfFaith.java @@ -111,7 +111,7 @@ class TestamentOfFaithBecomesCreatureSourceEffect extends ContinuousEffectImpl i if (sublayer == SubLayer.NA) { if (!token.getAbilities().isEmpty()) { for (Ability ability: token.getAbilities()) { - permanent.addAbility(ability, source.getSourceId(), game, false); + permanent.addAbility(ability, source.getSourceId(), game); } } } diff --git a/Mage/src/main/java/mage/abilities/effects/common/CopyEffect.java b/Mage/src/main/java/mage/abilities/effects/common/CopyEffect.java index d75fda572e..ae3f6c5e86 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/CopyEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/CopyEffect.java @@ -115,11 +115,11 @@ public class CopyEffect extends ContinuousEffectImpl { permanent.removeAllAbilities(source.getSourceId(), game); if (copyFromObject instanceof Permanent) { for (Ability ability : ((Permanent) copyFromObject).getAbilities(game)) { - permanent.addAbility(ability, getSourceId(), game, false); // no new Id so consumed replacement effects are known while new continuousEffects.apply happen. + permanent.addAbility(ability, getSourceId(), game); } } else { for (Ability ability : copyFromObject.getAbilities()) { - permanent.addAbility(ability, getSourceId(), game, false); // no new Id so consumed replacement effects are known while new continuousEffects.apply happen. + permanent.addAbility(ability, getSourceId(), game); } } diff --git a/Mage/src/main/java/mage/abilities/effects/common/continuous/GainAbilityAllEffect.java b/Mage/src/main/java/mage/abilities/effects/common/continuous/GainAbilityAllEffect.java index fca600ed88..36d96f04b6 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/continuous/GainAbilityAllEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/continuous/GainAbilityAllEffect.java @@ -87,7 +87,7 @@ public class GainAbilityAllEffect extends ContinuousEffectImpl { for (Iterator it = affectedObjectList.iterator(); it.hasNext(); ) { // filter may not be used again, because object can have changed filter relevant attributes but still geets boost Permanent permanent = it.next().getPermanentOrLKIBattlefield(game); //LKI is neccessary for "dies triggered abilities" to work given to permanets (e.g. Showstopper) if (permanent != null) { - permanent.addAbility(ability, source.getSourceId(), game, false); + permanent.addAbility(ability, source.getSourceId(), game); } else { it.remove(); // no longer on the battlefield, remove reference to object if (affectedObjectList.isEmpty()) { @@ -99,7 +99,7 @@ public class GainAbilityAllEffect extends ContinuousEffectImpl { setRuntimeData(source, game); for (Permanent perm : game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source.getSourceId(), game)) { if (!(excludeSource && perm.getId().equals(source.getSourceId())) && selectedByRuntimeData(perm, source, game)) { - perm.addAbility(ability, source.getSourceId(), game, false); + perm.addAbility(ability, source.getSourceId(), game); } } // still as long as the prev. permanent is known to the LKI (e.g. Mikaeus, the Unhallowed) so gained dies triggered ability will trigger @@ -109,7 +109,7 @@ public class GainAbilityAllEffect extends ContinuousEffectImpl { Permanent perm = (Permanent) mageObject; if (!(excludeSource && perm.getId().equals(source.getSourceId())) && selectedByRuntimeData(perm, source, game)) { if (filter.match(perm, source.getSourceId(), source.getControllerId(), game)) { - perm.addAbility(ability, source.getSourceId(), game, false); + perm.addAbility(ability, source.getSourceId(), game); } } } diff --git a/Mage/src/main/java/mage/abilities/effects/common/continuous/GainAbilityAttachedEffect.java b/Mage/src/main/java/mage/abilities/effects/common/continuous/GainAbilityAttachedEffect.java index b9fc862152..959f3cddd5 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/continuous/GainAbilityAttachedEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/continuous/GainAbilityAttachedEffect.java @@ -88,7 +88,7 @@ public class GainAbilityAttachedEffect extends ContinuousEffectImpl { } } if (permanent != null) { - permanent.addAbility(ability, source.getSourceId(), game, false); + permanent.addAbility(ability, source.getSourceId(), game); } return true; } diff --git a/Mage/src/main/java/mage/abilities/effects/common/continuous/GainAbilityControlledEffect.java b/Mage/src/main/java/mage/abilities/effects/common/continuous/GainAbilityControlledEffect.java index 2d96eaf08e..1dcc227e8d 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/continuous/GainAbilityControlledEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/continuous/GainAbilityControlledEffect.java @@ -87,7 +87,7 @@ public class GainAbilityControlledEffect extends ContinuousEffectImpl { Permanent perm = it.next().getPermanentOrLKIBattlefield(game); //LKI is neccessary for "dies triggered abilities" to work given to permanets (e.g. Showstopper) if (perm != null) { for (Ability abilityToAdd : ability) { - perm.addAbility(abilityToAdd, source.getSourceId(), game, false); + perm.addAbility(abilityToAdd, source.getSourceId(), game); } } else { it.remove(); @@ -100,7 +100,7 @@ public class GainAbilityControlledEffect extends ContinuousEffectImpl { for (Permanent perm : game.getBattlefield().getAllActivePermanents(filter, source.getControllerId(), game)) { if (!(excludeSource && perm.getId().equals(source.getSourceId()))) { for (Ability abilityToAdd : ability) { - perm.addAbility(abilityToAdd, source.getSourceId(), game, false); + perm.addAbility(abilityToAdd, source.getSourceId(), game); } } } @@ -112,7 +112,7 @@ public class GainAbilityControlledEffect extends ContinuousEffectImpl { if (!(excludeSource && perm.getId().equals(source.getSourceId()))) { if (filter.match(perm, source.getSourceId(), source.getControllerId(), game)) { for (Ability abilityToAdd : ability) { - perm.addAbility(abilityToAdd, source.getSourceId(), game, false); + perm.addAbility(abilityToAdd, source.getSourceId(), game); } } } diff --git a/Mage/src/main/java/mage/abilities/effects/common/continuous/GainAbilityPairedEffect.java b/Mage/src/main/java/mage/abilities/effects/common/continuous/GainAbilityPairedEffect.java index 6c8c4b0daa..a1c5554330 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/continuous/GainAbilityPairedEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/continuous/GainAbilityPairedEffect.java @@ -43,7 +43,7 @@ public class GainAbilityPairedEffect extends ContinuousEffectImpl { Permanent paired = permanent.getPairedCard().getPermanent(game); if (paired != null && paired.getPairedCard() != null && paired.getPairedCard().equals(new MageObjectReference(permanent, game))) { permanent.addAbility(ability, source.getSourceId(), game); - paired.addAbility(ability, source.getSourceId(), game, false); + paired.addAbility(ability, source.getSourceId(), game); return true; } else { diff --git a/Mage/src/main/java/mage/abilities/effects/common/continuous/GainAbilitySourceEffect.java b/Mage/src/main/java/mage/abilities/effects/common/continuous/GainAbilitySourceEffect.java index ddf5809187..c3a3507f5e 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/continuous/GainAbilitySourceEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/continuous/GainAbilitySourceEffect.java @@ -103,7 +103,7 @@ public class GainAbilitySourceEffect extends ContinuousEffectImpl implements Sou permanent = game.getPermanent(source.getSourceId()); } if (permanent != null) { - permanent.addAbility(ability, source.getSourceId(), game, false); + permanent.addAbility(ability, source.getSourceId(), game); return true; } } diff --git a/Mage/src/main/java/mage/abilities/effects/common/continuous/GainAbilityTargetEffect.java b/Mage/src/main/java/mage/abilities/effects/common/continuous/GainAbilityTargetEffect.java index 5647423c5d..adff4f92a4 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/continuous/GainAbilityTargetEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/continuous/GainAbilityTargetEffect.java @@ -112,7 +112,7 @@ public class GainAbilityTargetEffect extends ContinuousEffectImpl { for (UUID permanentId : targetPointer.getTargets(game, source)) { Permanent permanent = game.getPermanentOrLKIBattlefield(permanentId); if (permanent != null) { - permanent.addAbility(ability, source.getSourceId(), game, false); + permanent.addAbility(ability, source.getSourceId(), game); affectedTargets++; } } diff --git a/Mage/src/main/java/mage/abilities/keyword/TransformAbility.java b/Mage/src/main/java/mage/abilities/keyword/TransformAbility.java index 199560a103..8c1022e122 100644 --- a/Mage/src/main/java/mage/abilities/keyword/TransformAbility.java +++ b/Mage/src/main/java/mage/abilities/keyword/TransformAbility.java @@ -63,7 +63,7 @@ public class TransformAbility extends SimpleStaticAbility { permanent.setExpansionSetCode(sourceCard.getExpansionSetCode()); permanent.getAbilities().clear(); for (Ability ability : sourceCard.getAbilities()) { - permanent.addAbility(ability, source == null ? null : source.getSourceId(), game, false); + permanent.addAbility(ability, source == null ? null : source.getSourceId(), game); } permanent.getPower().modifyBaseValue(sourceCard.getPower().getValue()); permanent.getToughness().modifyBaseValue(sourceCard.getToughness().getValue()); diff --git a/Mage/src/main/java/mage/game/permanent/Permanent.java b/Mage/src/main/java/mage/game/permanent/Permanent.java index a8f040086e..7999673d27 100644 --- a/Mage/src/main/java/mage/game/permanent/Permanent.java +++ b/Mage/src/main/java/mage/game/permanent/Permanent.java @@ -156,9 +156,6 @@ public interface Permanent extends Card, Controllable { void addAbility(Ability ability, UUID sourceId, Game game); - @Deprecated // use addAbility(Ability ability, UUID sourceId, Game game) instead - void addAbility(Ability ability, UUID sourceId, Game game, boolean createNewId); - void removeAllAbilities(UUID sourceId, Game game); void removeAbility(Ability abilityToRemove, UUID sourceId, Game game); diff --git a/Mage/src/main/java/mage/game/permanent/PermanentImpl.java b/Mage/src/main/java/mage/game/permanent/PermanentImpl.java index 81208ef8e6..e093335625 100644 --- a/Mage/src/main/java/mage/game/permanent/PermanentImpl.java +++ b/Mage/src/main/java/mage/game/permanent/PermanentImpl.java @@ -361,14 +361,8 @@ public abstract class PermanentImpl extends CardImpl implements Permanent { @Override public void addAbility(Ability ability, UUID sourceId, Game game) { - addAbility(ability, sourceId, game, false); - } - - @Override - public void addAbility(Ability ability, UUID sourceId, Game game, boolean createNewId) { // singleton abilities -- only one instance // other abilities -- any amount of instances - // TODO: no needs in createNewId, so move code to addAbility(Ability ability, UUID sourceId, Game game) if (!abilities.containsKey(ability.getId())) { Ability copyAbility = ability.copy(); copyAbility.newId(); // needed so that source can get an ability multiple times (e.g. Raging Ravine) @@ -383,7 +377,6 @@ public abstract class PermanentImpl extends CardImpl implements Permanent { @Override public void removeAllAbilities(UUID sourceId, Game game) { - // can't use getAbilities() here -- cause it's can be auto-generated list potentially // TODO: what about triggered abilities? See addAbility above -- triggers adds to GameState abilities.clear(); } @@ -402,7 +395,6 @@ public abstract class PermanentImpl extends CardImpl implements Permanent { } }); - // can't use getAbilities() here -- cause it's can be auto-generated list potentially // TODO: what about triggered abilities? See addAbility above -- triggers adds to GameState toRemove.forEach(r -> abilities.remove(r)); }