Various text fixes found while closing #6885

This commit is contained in:
Alex W. Jackson 2022-01-24 00:40:25 -05:00
parent faf2e4ec82
commit 26a2e0a5ed
113 changed files with 384 additions and 618 deletions

View file

@ -63,6 +63,6 @@ public class PermanentsOnBattlefieldCount implements DynamicValue {
@Override
public String getMessage() {
return filter.getMessage();
return multiplier == null ? "the number of " + filter.getMessage() : filter.getMessage();
}
}

View file

@ -1,7 +1,5 @@
package mage.abilities.effects.common.continuous;
import java.util.Iterator;
import mage.MageObjectReference;
import mage.abilities.Ability;
import mage.abilities.dynamicvalue.DynamicValue;
@ -11,11 +9,15 @@ import mage.constants.Duration;
import mage.constants.Layer;
import mage.constants.Outcome;
import mage.constants.SubLayer;
import mage.filter.StaticFilters;
import mage.filter.common.FilterCreaturePermanent;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.util.CardUtil;
import java.util.Iterator;
import java.util.Locale;
/**
*
* @author BetaSteward_at_googlemail.com
@ -33,11 +35,11 @@ public class BoostAllEffect extends ContinuousEffectImpl {
}
public BoostAllEffect(DynamicValue power, DynamicValue toughness, Duration duration) {
this(power, toughness, duration, new FilterCreaturePermanent("all creatures"), false);
this(power, toughness, duration, StaticFilters.FILTER_PERMANENT_ALL_CREATURES, false);
}
public BoostAllEffect(int power, int toughness, Duration duration, boolean excludeSource) {
this(power, toughness, duration, new FilterCreaturePermanent("all creatures"), excludeSource);
this(power, toughness, duration, StaticFilters.FILTER_PERMANENT_ALL_CREATURES, excludeSource);
}
public BoostAllEffect(int power, int toughness, Duration duration, FilterCreaturePermanent filter, boolean excludeSource) {
@ -147,10 +149,12 @@ public class BoostAllEffect extends ContinuousEffectImpl {
protected void setText() {
StringBuilder sb = new StringBuilder();
if (excludeSource) {
boolean each = filter.getMessage().toLowerCase(Locale.ENGLISH).startsWith("each");
if (excludeSource && !each) {
sb.append("other ");
}
sb.append(filter.getMessage()).append(" get ");
sb.append(filter.getMessage());
sb.append(each ? " gets " : " get ");
sb.append(CardUtil.getBoostText(power, toughness, duration));
staticText = sb.toString();
}

View file

@ -16,6 +16,7 @@ import mage.game.permanent.Permanent;
import mage.util.CardUtil;
import java.util.Iterator;
import java.util.Locale;
/**
* @author BetaSteward_at_googlemail.com
@ -127,10 +128,12 @@ public class BoostControlledEffect extends ContinuousEffectImpl {
private void setText() {
StringBuilder sb = new StringBuilder();
if (excludeSource) {
boolean each = filter.getMessage().toLowerCase(Locale.ENGLISH).startsWith("each");
if (excludeSource && !each) {
sb.append("other ");
}
sb.append(filter.getMessage()).append(" you control get ");
sb.append(filter.getMessage()).append(" you control ");
sb.append(each ? "gets " : "get ");
sb.append(CardUtil.getBoostText(power, toughness, duration));
staticText = sb.toString();
}

View file

@ -30,18 +30,23 @@ public class BoostSourceEffect extends ContinuousEffectImpl implements SourceEff
this(power, toughness, duration, false);
}
public BoostSourceEffect(DynamicValue power, DynamicValue toughness, Duration duration, boolean lockedIn) {
this(power, toughness, duration, lockedIn, "{this}");
}
/**
* @param power
* @param toughness
* @param duration
* @param lockedIn if true, power and toughness will be calculated only once, when the ability resolves
* @param description
*/
public BoostSourceEffect(DynamicValue power, DynamicValue toughness, Duration duration, boolean lockedIn) {
public BoostSourceEffect(DynamicValue power, DynamicValue toughness, Duration duration, boolean lockedIn, String description) {
super(duration, Layer.PTChangingEffects_7, SubLayer.ModifyPT_7c, Outcome.BoostCreature);
this.power = power;
this.toughness = toughness;
this.lockedIn = lockedIn;
this.staticText = "{this} gets " + CardUtil.getBoostText(power, toughness, duration);
this.staticText = description + " gets " + CardUtil.getBoostText(power, toughness, duration);
}
public BoostSourceEffect(final BoostSourceEffect effect) {

View file

@ -137,20 +137,15 @@ public class GainAbilityAllEffect extends ContinuousEffectImpl {
StringBuilder sb = new StringBuilder();
boolean quotes = forceQuotes || (ability instanceof SimpleActivatedAbility) || (ability instanceof TriggeredAbility);
if (excludeSource) {
sb.append("Other ");
boolean each = filter.getMessage().toLowerCase(Locale.ENGLISH).startsWith("each");
if (excludeSource && !each) {
sb.append("other ");
}
sb.append(filter.getMessage());
if (duration == Duration.WhileOnBattlefield) {
if (filter.getMessage().toLowerCase(Locale.ENGLISH).startsWith("each")) {
sb.append(" has ");
} else {
sb.append(" have ");
}
} else if (filter.getMessage().toLowerCase(Locale.ENGLISH).startsWith("each")) {
sb.append(" gains ");
sb.append(each ? " has " : " have ");
} else {
sb.append(" gain ");
sb.append(each ? " gains " : " gain ");
}
if (quotes) {
sb.append('"');

View file

@ -7,8 +7,10 @@ import mage.filter.common.FilterAttackingCreature;
public class BattleCryAbility extends AttacksTriggeredAbility {
private static final FilterAttackingCreature filter = new FilterAttackingCreature();
public BattleCryAbility() {
super(new BoostControlledEffect(1, 0, Duration.EndOfTurn, new FilterAttackingCreature(), true), false);
super(new BoostControlledEffect(1, 0, Duration.EndOfTurn, filter, true), false);
}
public BattleCryAbility(final BattleCryAbility ability) {

View file

@ -117,6 +117,12 @@ public final class StaticFilters {
FILTER_CARD_FROM_YOUR_GRAVEYARD.setLockedFilter(true);
}
public static final FilterCard FILTER_CARDS_FROM_YOUR_GRAVEYARD = new FilterCard("cards from your graveyard");
static {
FILTER_CARDS_FROM_YOUR_GRAVEYARD.setLockedFilter(true);
}
public static final FilterCard FILTER_CARD_INSTANT_OR_SORCERY_FROM_YOUR_GRAVEYARD = new FilterInstantOrSorceryCard("instant or sorcery card from your graveyard");
static {
@ -563,6 +569,12 @@ public final class StaticFilters {
FILTER_PERMANENT_CREATURES.setLockedFilter(true);
}
public static final FilterCreaturePermanent FILTER_PERMANENT_ALL_CREATURES = new FilterCreaturePermanent("all creatures");
static {
FILTER_PERMANENT_ALL_CREATURES.setLockedFilter(true);
}
public static final FilterCreaturePermanent FILTER_PERMANENT_CREATURES_CONTROLLED = new FilterCreaturePermanent("creatures you control");
static {
@ -762,6 +774,12 @@ public final class StaticFilters {
FILTER_ATTACKING_OR_BLOCKING_CREATURES.setLockedFilter(true);
}
public static final FilterBlockingCreature FILTER_BLOCKING_CREATURES = new FilterBlockingCreature("blocking creatures");
static {
FILTER_BLOCKING_CREATURES.setLockedFilter(true);
}
public static final FilterPermanent FILTER_PERMANENT_AURA = new FilterPermanent();
static {

View file

@ -13,7 +13,7 @@ import mage.abilities.keyword.FlyingAbility;
public final class BirdSoldierToken extends TokenImpl {
public BirdSoldierToken() {
super("Bird Soldier", "1/1 white Bird Soldier creature with flying");
super("Bird Soldier", "1/1 white Bird Soldier creature token with flying");
cardType.add(CardType.CREATURE);
subtype.add(SubType.BIRD);