another batch of text fixes

This commit is contained in:
xenohedron 2024-04-04 23:03:58 -04:00
parent 89ea47eb2a
commit 35a22527f1
27 changed files with 62 additions and 40 deletions

View file

@ -2,6 +2,7 @@
package mage.abilities.effects.common;
import mage.abilities.Ability;
import mage.abilities.Mode;
import mage.abilities.effects.OneShotEffect;
import mage.constants.Outcome;
import mage.game.Game;
@ -14,7 +15,6 @@ public class LoseHalfLifeTargetEffect extends OneShotEffect {
public LoseHalfLifeTargetEffect() {
super(Outcome.Damage);
staticText = "that player loses half their life, rounded up";
}
protected LoseHalfLifeTargetEffect(final LoseHalfLifeTargetEffect effect) {
@ -30,7 +30,7 @@ public class LoseHalfLifeTargetEffect extends OneShotEffect {
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(getTargetPointer().getFirst(game, source));
if (player != null) {
Integer amount = (int) Math.ceil(player.getLife() / 2f);
int amount = (int) Math.ceil(player.getLife() / 2f);
if (amount > 0) {
player.loseLife(amount, game, source, false);
return true;
@ -38,4 +38,12 @@ public class LoseHalfLifeTargetEffect extends OneShotEffect {
}
return false;
}
@Override
public String getText(Mode mode) {
if (staticText != null && !staticText.isEmpty()) {
return staticText;
}
return getTargetPointer().describeTargets(mode.getTargets(), "that player") + " loses half their life, rounded up";
}
}

View file

@ -138,7 +138,7 @@ public class MillThenPutInHandEffect extends OneShotEffect {
sb.append("put ");
if (maxAmountReturned > 1) {
sb.append(optional ? "up to " : "");
sb.append(CardUtil.numberToText(amount) + " ");
sb.append(CardUtil.numberToText(maxAmountReturned) + " ");
}
sb.append(filter.getMessage());
sb.append(" from among ");

View file

@ -15,10 +15,14 @@ public class AddCardSubtypeAllEffect extends ContinuousEffectImpl {
private final FilterPermanent filter;
private final SubType addedSubtype;
/**
* Note: must set text manually
*/
public AddCardSubtypeAllEffect(FilterPermanent filter, SubType addedSubtype, DependencyType dependency) {
super(Duration.WhileOnBattlefield, Layer.TypeChangingEffects_4, SubLayer.NA, Outcome.Benefit);
this.filter = filter;
this.addedSubtype = addedSubtype;
this.staticText = filter.getMessage() + " are " + addedSubtype.getPluralName() + " in addition to their other types";
addDependencyType(dependency);
}

View file

@ -14,9 +14,10 @@ import mage.target.common.TargetCardInLibrary;
*/
public class SearchLibraryPutInGraveyardEffect extends SearchEffect {
public SearchLibraryPutInGraveyardEffect() {
public SearchLibraryPutInGraveyardEffect(boolean textThatCard) {
super(new TargetCardInLibrary(StaticFilters.FILTER_CARD), Outcome.Neutral);
staticText = "search your library for a card, put that card into your graveyard, then shuffle";
staticText = "search your library for a card, put " + (textThatCard ? "that card" : "it")
+ " into your graveyard, then shuffle";
}
protected SearchLibraryPutInGraveyardEffect(final SearchLibraryPutInGraveyardEffect effect) {
@ -41,4 +42,4 @@ public class SearchLibraryPutInGraveyardEffect extends SearchEffect {
return true;
}
}
}

View file

@ -41,9 +41,12 @@ public class CollectEvidenceAbility extends StaticAbility implements OptionalAdd
}
public CollectEvidenceAbility(int amount) {
this(amount, null);
}
public CollectEvidenceAbility(int amount, String extraInfoText) {
super(Zone.STACK, null);
this.additionalCost = makeCost(amount);
this.rule = additionalCost.getName() + ". " + additionalCost.getReminderText();
this.rule = additionalCost.getName() + ". " + (extraInfoText == null ? "" : extraInfoText + ". ") + additionalCost.getReminderText();
this.setRuleAtTheTop(true);
this.addHint(hint);
this.amount = amount;

View file

@ -585,6 +585,11 @@ public enum SubType {
return description;
}
// note: does not account for irregular plurals
public String getPluralName() {
return description.endsWith("y") ? description.substring(0, description.length() - 1) + "ies" : description + 's';
}
@Override
public String toString() {
return description;

View file

@ -26,7 +26,7 @@ public class TargetNonlandPermanent extends TargetPermanent {
}
public TargetNonlandPermanent(int minNumTargets, int maxNumTargets, boolean notTarget) {
this(minNumTargets, maxNumTargets, StaticFilters.FILTER_PERMANENT_NON_LAND, notTarget);
this(minNumTargets, maxNumTargets, (maxNumTargets > 1 ? StaticFilters.FILTER_PERMANENTS_NON_LAND : StaticFilters.FILTER_PERMANENT_NON_LAND), notTarget);
}
public TargetNonlandPermanent(int minNumTargets, int maxNumTargets, FilterNonlandPermanent filter, boolean notTarget) {