mirror of
https://github.com/magefree/mage.git
synced 2025-12-30 07:22:03 -08:00
finish removing all filter constructors from TargetCreaturePermanent
This commit is contained in:
parent
3e65021150
commit
9744819551
823 changed files with 2427 additions and 1690 deletions
|
|
@ -16,16 +16,12 @@ import mage.game.events.GameEvent;
|
|||
import mage.game.events.ZoneChangeEvent;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.players.Player;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
import mage.target.TargetPermanent;
|
||||
import mage.target.targetpointer.FixedTarget;
|
||||
import mage.util.CardUtil;
|
||||
import mage.watchers.Watcher;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* @author LevelX2, awjackson
|
||||
|
|
@ -66,13 +62,13 @@ class AnimateDeadReplaceAbilityEffect extends ContinuousEffectImpl {
|
|||
|
||||
private final boolean becomesAura;
|
||||
private Ability newAbility;
|
||||
private TargetCreaturePermanent newTarget;
|
||||
private TargetPermanent newTarget;
|
||||
|
||||
public AnimateDeadReplaceAbilityEffect(boolean becomesAura) {
|
||||
super(Duration.Custom, Outcome.AddAbility);
|
||||
this.becomesAura = becomesAura;
|
||||
staticText = (becomesAura ? "it becomes an Aura with" :
|
||||
"it loses \"enchant creature card in a graveyard\" and gains"
|
||||
"it loses \"enchant creature card in a graveyard\" and gains"
|
||||
) + " \"enchant creature put onto the battlefield with {this}.\"";
|
||||
if (becomesAura) {
|
||||
dependencyTypes.add(DependencyType.AuraAddingRemoving);
|
||||
|
|
@ -98,7 +94,7 @@ class AnimateDeadReplaceAbilityEffect extends ContinuousEffectImpl {
|
|||
|
||||
FilterCreaturePermanent filter = new FilterCreaturePermanent("creature put onto the battlefield with {this}");
|
||||
filter.add(new AnimateDeadPredicate(source.getSourceId()));
|
||||
newTarget = new TargetCreaturePermanent(filter);
|
||||
newTarget = new TargetPermanent(filter);
|
||||
newAbility = new EnchantAbility(newTarget);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ import mage.game.Game;
|
|||
import mage.game.permanent.Permanent;
|
||||
import mage.players.Player;
|
||||
import mage.target.Target;
|
||||
import mage.target.TargetPermanent;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
import mage.util.CardUtil;
|
||||
|
||||
|
|
@ -47,7 +48,7 @@ public class BecomesAuraAttachToManifestSourceEffect extends OneShotEffect {
|
|||
if (enchantedCreature != null) {
|
||||
enchantedCreature.addAttachment(enchantment.getId(), source, game);
|
||||
FilterCreaturePermanent filter = new FilterCreaturePermanent();
|
||||
Target target = new TargetCreaturePermanent(filter);
|
||||
Target target = new TargetPermanent(filter);
|
||||
target.addTarget(enchantedCreature.getId(), source, game);
|
||||
game.addEffect(new BecomesAuraSourceEffect(target), source);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ import mage.filter.predicate.permanent.AttackingPredicate;
|
|||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.target.TargetPermanent;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
|
||||
/**
|
||||
|
|
@ -29,7 +30,7 @@ public class MentorAbility extends AttacksTriggeredAbility {
|
|||
|
||||
public MentorAbility() {
|
||||
super(new MentorEffect(), false);
|
||||
this.addTarget(new TargetCreaturePermanent(filter));
|
||||
this.addTarget(new TargetPermanent(filter));
|
||||
}
|
||||
|
||||
protected MentorAbility(final MentorAbility ability) {
|
||||
|
|
|
|||
|
|
@ -1,8 +1,6 @@
|
|||
|
||||
package mage.abilities.keyword;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.AttacksTriggeredAbility;
|
||||
import mage.abilities.effects.RequirementEffect;
|
||||
|
|
@ -13,7 +11,9 @@ import mage.filter.predicate.permanent.ControllerIdPredicate;
|
|||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
import mage.target.TargetPermanent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* 702.38. Provoke 702.38a Provoke is a triggered ability. “Provoke” means
|
||||
|
|
@ -46,8 +46,7 @@ public class ProvokeAbility extends AttacksTriggeredAbility {
|
|||
UUID defendingPlayerId = game.getCombat().getDefendingPlayerId(sourceId, game);
|
||||
filter.add(new ControllerIdPredicate(defendingPlayerId));
|
||||
this.getTargets().clear();
|
||||
TargetCreaturePermanent target = new TargetCreaturePermanent(filter);
|
||||
this.addTarget(target);
|
||||
this.addTarget(new TargetPermanent(filter));
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ import mage.filter.predicate.Predicates;
|
|||
import mage.filter.predicate.permanent.EnchantedPredicate;
|
||||
import mage.game.command.Plane;
|
||||
import mage.target.Target;
|
||||
import mage.target.TargetPermanent;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
import mage.watchers.common.PlanarRollWatcher;
|
||||
|
||||
|
|
@ -44,7 +45,7 @@ public class AkoumPlane extends Plane {
|
|||
|
||||
// Active player can roll the planar die: Whenever you roll {CHAOS}, destroy target creature that isn't enchanted
|
||||
Effect chaosEffect = new DestroyTargetEffect("destroy target creature that isn't enchanted");
|
||||
Target chaosTarget = new TargetCreaturePermanent(filter);
|
||||
Target chaosTarget = new TargetPermanent(filter);
|
||||
|
||||
List<Effect> chaosEffects = new ArrayList<Effect>();
|
||||
chaosEffects.add(chaosEffect);
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ import mage.constants.Zone;
|
|||
import mage.filter.common.FilterAttackingCreature;
|
||||
import mage.filter.predicate.Predicates;
|
||||
import mage.filter.predicate.mageobject.AbilityPredicate;
|
||||
import mage.target.TargetPermanent;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
|
||||
/**
|
||||
|
|
@ -29,7 +30,7 @@ public final class LandMineToken extends TokenImpl {
|
|||
cardType.add(CardType.ARTIFACT);
|
||||
Ability ability = new SimpleActivatedAbility(new DamageTargetEffect(2), new ManaCostsImpl<>("{R}"));
|
||||
ability.addCost(new SacrificeSourceCost());
|
||||
ability.addTarget(new TargetCreaturePermanent(filter));
|
||||
ability.addTarget(new TargetPermanent(filter));
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
package mage.target.common;
|
||||
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.target.TargetPermanent;
|
||||
|
||||
/**
|
||||
|
|
@ -13,10 +12,6 @@ public class TargetCreaturePermanent extends TargetPermanent {
|
|||
this(1);
|
||||
}
|
||||
|
||||
public TargetCreaturePermanent(FilterCreaturePermanent filter) {
|
||||
super(1, 1, filter, false);
|
||||
}
|
||||
|
||||
public TargetCreaturePermanent(int numTargets) {
|
||||
this(numTargets, numTargets);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue