mirror of
https://github.com/correl/mage.git
synced 2024-11-16 03:00:12 +00:00
* Dust to Dust - Fixed tooltip text.
This commit is contained in:
parent
c7c6c1fa4b
commit
6b20f7733a
3 changed files with 24 additions and 5 deletions
|
@ -32,6 +32,7 @@ import mage.abilities.effects.common.ExileTargetEffect;
|
|||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Rarity;
|
||||
import mage.filter.common.FilterArtifactPermanent;
|
||||
import mage.target.common.TargetArtifactPermanent;
|
||||
|
||||
/**
|
||||
|
@ -44,10 +45,9 @@ public class DustToDust extends CardImpl {
|
|||
super(ownerId, 78, "Dust to Dust", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{1}{W}{W}");
|
||||
this.expansionSetCode = "DRK";
|
||||
|
||||
|
||||
// Exile two target artifacts.
|
||||
this.getSpellAbility().addEffect(new ExileTargetEffect());
|
||||
this.getSpellAbility().addTarget(new TargetArtifactPermanent(2));
|
||||
this.getSpellAbility().addTarget(new TargetArtifactPermanent(2, 2, new FilterArtifactPermanent("artifacts"), false));
|
||||
}
|
||||
|
||||
public DustToDust(final DustToDust card) {
|
||||
|
|
|
@ -109,7 +109,7 @@ public class DestroyTargetEffect extends OneShotEffect {
|
|||
return staticText;
|
||||
}
|
||||
StringBuilder sb = new StringBuilder();
|
||||
if (mode.getTargets().size() == 0) {
|
||||
if (mode.getTargets().isEmpty()) {
|
||||
sb.append("destroy that creature"); //TODO add possibility to specify text with targetPointer usage
|
||||
} else {
|
||||
Target target;
|
||||
|
|
|
@ -41,6 +41,8 @@ import mage.game.permanent.Permanent;
|
|||
import mage.players.Player;
|
||||
import mage.target.Target;
|
||||
import mage.target.targetpointer.FirstTargetPointer;
|
||||
import mage.target.targetpointer.SecondTargetPointer;
|
||||
import mage.util.CardUtil;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -146,10 +148,27 @@ public class ExileTargetEffect extends OneShotEffect {
|
|||
if (staticText != null && !staticText.isEmpty()) {
|
||||
return staticText;
|
||||
}
|
||||
StringBuilder sb = new StringBuilder();
|
||||
if (mode.getTargets().isEmpty()) {
|
||||
return "exile it";
|
||||
sb.append("exile that permanent"); // this will be used if the target is set by target pointer and staticText not set.
|
||||
} else {
|
||||
return "exile target " + mode.getTargets().get(0).getTargetName();
|
||||
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 {
|
||||
sb.append("exile ").append(CardUtil.numberToText(target.getNumberOfTargets())).append(" target ").append(target.getTargetName());
|
||||
}
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue