mirror of
https://github.com/magefree/mage.git
synced 2025-12-25 04:52:07 -08:00
Replace many custom effects with ExileUntilSourceLeavesEffect
This commit is contained in:
parent
6f8d0dcee5
commit
e310ede837
25 changed files with 101 additions and 604 deletions
|
|
@ -129,29 +129,6 @@ public class ExileTargetEffect extends OneShotEffect {
|
|||
if (staticText != null && !staticText.isEmpty()) {
|
||||
return staticText;
|
||||
}
|
||||
StringBuilder sb = new StringBuilder();
|
||||
if (mode.getTargets().isEmpty()) {
|
||||
sb.append("exile that permanent"); // this will be used if the target is set by target pointer and staticText not set.
|
||||
} else {
|
||||
Target target;
|
||||
if (targetPointer instanceof SecondTargetPointer && mode.getTargets().size() > 1) {
|
||||
target = mode.getTargets().get(1);
|
||||
} else {
|
||||
target = mode.getTargets().get(0);
|
||||
}
|
||||
if (target.getNumberOfTargets() == 1) {
|
||||
String targetName = target.getTargetName();
|
||||
sb.append("exile ");
|
||||
if (!targetName.startsWith("another")) {
|
||||
sb.append("target ");
|
||||
}
|
||||
sb.append(targetName);
|
||||
} else if (target.getNumberOfTargets() == 0 && target.getMaxNumberOfTargets() > 0) {
|
||||
sb.append("exile up to ").append(CardUtil.numberToText(target.getMaxNumberOfTargets())).append(" target ").append(target.getTargetName());
|
||||
} else {
|
||||
sb.append("exile ").append(CardUtil.numberToText(target.getNumberOfTargets())).append(" target ").append(target.getTargetName());
|
||||
}
|
||||
}
|
||||
return sb.toString();
|
||||
return "exile " + getTargetPointer().describeTargets(mode.getTargets(), "that permanent");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,25 +1,24 @@
|
|||
package mage.target.common;
|
||||
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.filter.common.FilterAttackingOrBlockingCreature;
|
||||
import mage.target.TargetPermanent;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author nantuko
|
||||
* @author awjackson
|
||||
*/
|
||||
public class TargetAttackingOrBlockingCreature extends TargetPermanent {
|
||||
|
||||
public TargetAttackingOrBlockingCreature() {
|
||||
this(1, 1, StaticFilters.FILTER_ATTACKING_OR_BLOCKING_CREATURE, false);
|
||||
this(1);
|
||||
}
|
||||
|
||||
public TargetAttackingOrBlockingCreature(int numTargets) {
|
||||
this(numTargets, numTargets, StaticFilters.FILTER_ATTACKING_OR_BLOCKING_CREATURE, false);
|
||||
this(numTargets, numTargets);
|
||||
}
|
||||
|
||||
public TargetAttackingOrBlockingCreature(int minNumTargets, int maxNumTargets, FilterAttackingOrBlockingCreature filter, boolean notTarget) {
|
||||
super(minNumTargets, maxNumTargets, filter, notTarget);
|
||||
public TargetAttackingOrBlockingCreature(int minNumTargets, int maxNumTargets) {
|
||||
super(minNumTargets, maxNumTargets, maxNumTargets > 1 ? StaticFilters.FILTER_ATTACKING_OR_BLOCKING_CREATURES : StaticFilters.FILTER_ATTACKING_OR_BLOCKING_CREATURE);
|
||||
}
|
||||
|
||||
public TargetAttackingOrBlockingCreature(final TargetAttackingOrBlockingCreature target) {
|
||||
|
|
@ -30,5 +29,4 @@ public class TargetAttackingOrBlockingCreature extends TargetPermanent {
|
|||
public TargetAttackingOrBlockingCreature copy() {
|
||||
return new TargetAttackingOrBlockingCreature(this);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue