Change EnchantAbility parameter from String to Target (#9588)

This commit is contained in:
Alex W. Jackson 2022-09-29 10:29:48 -04:00 committed by GitHub
parent 57efc02710
commit c9a7aedfb2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
1082 changed files with 1152 additions and 1152 deletions

View file

@ -100,7 +100,7 @@ class AnimateDeadReplaceAbilityEffect extends ContinuousEffectImpl implements So
FilterCreaturePermanent filter = new FilterCreaturePermanent("creature put onto the battlefield with {this}");
filter.add(new AnimateDeadPredicate(source.getSourceId()));
newTarget = new TargetCreaturePermanent(filter);
newAbility = new EnchantAbility(newTarget.getTargetName());
newAbility = new EnchantAbility(newTarget);
}
@Override

View file

@ -124,12 +124,11 @@ class LicidContinuousEffect extends ContinuousEffectImpl {
}
licid.removeAbilities(toRemove, source.getSourceId(), game);
Ability ability = new EnchantAbility("creature");
Target target = new TargetCreaturePermanent();
Ability ability = new EnchantAbility(target);
ability.setRuleAtTheTop(true);
licid.addAbility(ability, source.getSourceId(), game);
licid.getSpellAbility().getTargets().clear();
Target target = new TargetCreaturePermanent();
target.addTarget(this.getTargetPointer().getFirst(game, source), source, game);
licid.getSpellAbility().getTargets().add(target);
}
return true;

View file

@ -21,7 +21,7 @@ public class BecomesAuraSourceEffect extends ContinuousEffectImpl implements Sou
public BecomesAuraSourceEffect(Target target) {
super(Duration.Custom, Outcome.AddAbility);
this.target = target;
newAbility = new EnchantAbility(target.getTargetName());
newAbility = new EnchantAbility(target);
newAbility.setRuleAtTheTop(true);
staticText = "it becomes an Aura with enchant " + target.getTargetName();
dependencyTypes.add(DependencyType.AuraAddingRemoving);

View file

@ -3,6 +3,7 @@ package mage.abilities.keyword;
import mage.constants.Zone;
import mage.abilities.StaticAbility;
import mage.target.Target;
/**
*
@ -13,9 +14,9 @@ public class EnchantAbility extends StaticAbility {
protected String targetName;
public EnchantAbility(String targetName) {
public EnchantAbility(Target target) {
super(Zone.BATTLEFIELD, null);
this.targetName = targetName;
this.targetName = target.getTargetName();
}
public EnchantAbility(final EnchantAbility ability) {

View file

@ -25,7 +25,7 @@ public final class MaskToken extends TokenImpl {
subtype.add(SubType.AURA);
TargetPermanent auraTarget = new TargetPermanent();
Ability ability = new EnchantAbility(auraTarget.getTargetName());
Ability ability = new EnchantAbility(auraTarget);
ability.addTarget(auraTarget);
ability.addEffect(new AttachEffect(Outcome.BoostCreature));
this.addAbility(ability);

View file

@ -31,7 +31,7 @@ public final class SmokeBlessingToken extends TokenImpl {
subtype.add(SubType.AURA);
TargetPermanent auraTarget = new TargetPermanent();
Ability ability = new EnchantAbility(auraTarget.getTargetName());
Ability ability = new EnchantAbility(auraTarget);
ability.addTarget(auraTarget);
ability.addEffect(new AttachEffect(Outcome.BoostCreature));
this.addAbility(ability);