[MH2] various text fixes

This commit is contained in:
Evan Kranzler 2021-06-22 09:20:05 -04:00
parent 3158621a87
commit daf77b2ee8
36 changed files with 121 additions and 87 deletions

View file

@ -2,16 +2,16 @@
package mage.abilities.effects.common;
import mage.constants.Outcome;
import mage.abilities.Ability;
import mage.abilities.Mode;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.OneShotEffect;
import mage.constants.Outcome;
import mage.game.Game;
import mage.players.Player;
/**
*
* @author BetaSteward_at_googlemail.com
*/
public class GainLifeEffect extends OneShotEffect {
@ -25,9 +25,8 @@ public class GainLifeEffect extends OneShotEffect {
public GainLifeEffect(DynamicValue life) {
super(Outcome.GainLife);
this.life = life;
setText();
}
public GainLifeEffect(DynamicValue life, String rule) {
super(Outcome.GainLife);
this.life = life;
@ -53,24 +52,24 @@ public class GainLifeEffect extends OneShotEffect {
return true;
}
private void setText() {
if (!staticText.isEmpty()) {
return;
@Override
public String getText(Mode mode) {
if (staticText != null && !staticText.isEmpty()) {
return staticText;
}
StringBuilder sb = new StringBuilder();
String message = life.getMessage();
sb.append("you gain ");
if (message.startsWith("that")) {
sb.append(message).append(' ');
} else if (message.isEmpty() || !message.equals("1")) {
} else if (message.isEmpty() || !life.toString().equals("1")) {
sb.append(life).append(' ');
}
sb.append("life");
if (!message.isEmpty() && !message.startsWith("that")) {
sb.append(message.equals("1") ? " equal to the number of " : " for each ");
sb.append(life.toString().equals("1") ? " equal to the number of " : " for each ");
sb.append(message);
}
staticText = sb.toString();
return sb.toString();
}
}

View file

@ -100,7 +100,7 @@ public class ReturnToHandTargetEffect extends OneShotEffect {
sb.append("target ");
}
sb.append(target.getTargetName());
if (target.getMaxNumberOfTargets() > 1 && !target.getTargetName().endsWith("s")) {
if (target.getMaxNumberOfTargets() > 1 && !target.getTargetName().endsWith("s") && !target.getTargetName().endsWith("control")) {
sb.append('s');
}
if (target.getMaxNumberOfTargets() > 1) {

View file

@ -155,7 +155,7 @@ public class DiscardCardYouChooseTargetEffect extends OneShotEffect {
}
private String setText() {
StringBuilder sb = new StringBuilder("Target ");
StringBuilder sb = new StringBuilder("target ");
switch (targetController) {
case OPPONENT:
sb.append("opponent");

View file

@ -316,6 +316,12 @@ public final class StaticFilters {
FILTER_CONTROLLED_A_PERMANENT.setLockedFilter(true);
}
public static final FilterControlledPermanent FILTER_CONTROLLED_PERMANENT_SHORT_TEXT = new FilterControlledPermanent("permanent");
static {
FILTER_CONTROLLED_PERMANENT_SHORT_TEXT.setLockedFilter(true);
}
public static final FilterControlledPermanent FILTER_CONTROLLED_PERMANENT_ARTIFACT = new FilterControlledArtifactPermanent();
static {

View file

@ -9,7 +9,7 @@ import mage.filter.common.FilterCreatureOrPlaneswalkerPermanent;
public class TargetCreatureOrPlaneswalkerAmount extends TargetPermanentAmount {
private static final FilterCreatureOrPlaneswalkerPermanent defaultFilter
= new FilterCreatureOrPlaneswalkerPermanent("target creatures or planeswalkers");
= new FilterCreatureOrPlaneswalkerPermanent("target creatures and/or planeswalkers");
public TargetCreatureOrPlaneswalkerAmount(int amount) {
super(amount, defaultFilter);