[VOW] some more text fixes

This commit is contained in:
Evan Kranzler 2021-11-12 19:58:50 -05:00
parent 9ee8ef6eab
commit 6b2fc867f4
6 changed files with 26 additions and 15 deletions

View file

@ -73,6 +73,7 @@ public class Effects extends ArrayList<Effect> {
} else if (lastRule != null && lastRule.length() > 3) {
//check if lastRule already has appropriate punctuation, if so, add a space.
if (lastRule.endsWith(".\"")
|| lastRule.endsWith(".]")
|| lastRule.endsWith(".)")
|| lastRule.endsWith(".)</i>")
|| lastRule.endsWith(".")) {
@ -105,6 +106,7 @@ public class Effects extends ArrayList<Effect> {
if (lastRule != null && lastRule.length() > 3
&& !lastRule.endsWith(".")
&& !lastRule.endsWith("\"")
&& !lastRule.endsWith(".]")
&& !lastRule.startsWith("<b>Level ")
&& !lastRule.endsWith(".)")
&& !lastRule.endsWith("</i>")) {

View file

@ -1,14 +1,15 @@
package mage.abilities.effects.common.continuous;
import mage.abilities.Ability;
import mage.abilities.Mode;
import mage.abilities.TriggeredAbility;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.effects.ContinuousEffectImpl;
import mage.constants.*;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.target.targetpointer.FixedTarget;
import java.util.Locale;
/**
* @author BetaSteward_at_googlemail.com
*/
@ -47,9 +48,7 @@ public class GainAbilityAttachedEffect extends ContinuousEffectImpl {
independentEffect = true;
}
if (rule == null) {
setText();
} else {
if (rule != null) {
this.staticText = rule;
}
@ -115,7 +114,11 @@ public class GainAbilityAttachedEffect extends ContinuousEffectImpl {
//
}
private void setText() {
@Override
public String getText(Mode mode) {
if (staticText != null && !staticText.isEmpty()) {
return staticText;
}
StringBuilder sb = new StringBuilder();
sb.append(attachmentType.verb().toLowerCase());
sb.append(" " + targetObjectName + " ");
@ -124,11 +127,17 @@ public class GainAbilityAttachedEffect extends ContinuousEffectImpl {
} else {
sb.append("gains ");
}
sb.append(ability.getRule("this " + targetObjectName));
if (!duration.toString().isEmpty()) {
sb.append(' ').append(duration.toString());
boolean quotes = (ability instanceof SimpleActivatedAbility) || (ability instanceof TriggeredAbility);
if (quotes) {
sb.append('"');
}
staticText = sb.toString();
sb.append(ability.getRule("this " + targetObjectName));
if (quotes) {
sb.append('"');
}
if (!duration.toString().isEmpty()) {
sb.append(' ').append(duration);
}
return sb.toString();
}
}