mirror of
https://github.com/magefree/mage.git
synced 2026-01-09 12:22:10 -08:00
Change EnchantAbility parameter from String to Target (#9588)
This commit is contained in:
parent
57efc02710
commit
c9a7aedfb2
1082 changed files with 1152 additions and 1152 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue