mirror of
https://github.com/magefree/mage.git
synced 2025-12-24 04:22:01 -08:00
[MH2] various text fixes
This commit is contained in:
parent
3158621a87
commit
daf77b2ee8
36 changed files with 121 additions and 87 deletions
|
|
@ -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();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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");
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue