[LRW] various text fixes

This commit is contained in:
Evan Kranzler 2022-03-07 20:19:20 -05:00
parent 605e7a7e50
commit 50b3d3d8d9
43 changed files with 318 additions and 339 deletions

View file

@ -12,7 +12,6 @@ import mage.game.permanent.Permanent;
import mage.util.CardUtil;
/**
*
* @author LevelX2
*/
public class CanBlockAdditionalCreatureEffect extends ContinuousEffectImpl {
@ -69,21 +68,21 @@ public class CanBlockAdditionalCreatureEffect extends ContinuousEffectImpl {
}
private String setText() {
String text = "{this} can block ";
switch (amount) {
case 0:
text += "any number of creatures";
break;
default:
text += CardUtil.numberToText(amount, "an") + " additional creature" + (amount > 1 ? "s" : "");
StringBuilder sb = new StringBuilder("{this} can block ");
if (amount == 0) {
sb.append("any number of creatures");
} else {
sb.append(CardUtil.numberToText(amount, "an"));
sb.append(" additional creature");
sb.append((amount > 1 ? "s" : ""));
}
if (duration == Duration.EndOfTurn) {
text += " this turn";
sb.append(" this turn");
}
if (duration == Duration.WhileOnBattlefield) {
text += " each combat";
if (duration == Duration.WhileOnBattlefield && amount == 1) {
sb.append(" each combat");
}
return text;
return sb.toString();
}
@Override

View file

@ -1,17 +1,16 @@
package mage.abilities.effects.common.combat;
import mage.abilities.Ability;
import mage.abilities.effects.ContinuousEffectImpl;
import mage.constants.Duration;
import mage.constants.Layer;
import mage.constants.Outcome;
import mage.constants.SubLayer;
import mage.abilities.Ability;
import mage.abilities.effects.ContinuousEffectImpl;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.util.CardUtil;
/**
*
* @author North
*/
public class CantBeBlockedByOneEffect extends ContinuousEffectImpl {
@ -23,9 +22,9 @@ public class CantBeBlockedByOneEffect extends ContinuousEffectImpl {
}
public CantBeBlockedByOneEffect(int amount, Duration duration) {
super(duration, Outcome.Benefit);
super(duration, Layer.RulesEffects, SubLayer.NA, Outcome.Benefit);
this.amount = amount;
staticText = "{this} can't be blocked except by " + amount + " or more creatures";
staticText = "{this} can't be blocked except by " + CardUtil.numberToText(amount) + " or more creatures";
}
public CantBeBlockedByOneEffect(final CantBeBlockedByOneEffect effect) {
@ -39,26 +38,12 @@ public class CantBeBlockedByOneEffect extends ContinuousEffectImpl {
}
@Override
public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) {
Permanent perm = game.getPermanent(source.getSourceId());
public boolean apply(Game game, Ability source) {
Permanent perm = source.getSourcePermanentIfItStillExists(game);
if (perm != null) {
switch (layer) {
case RulesEffects:
perm.setMinBlockedBy(amount);
break;
}
perm.setMinBlockedBy(amount);
return true;
}
return false;
}
@Override
public boolean apply(Game game, Ability source) {
return false;
}
@Override
public boolean hasLayer(Layer layer) {
return layer == Layer.RulesEffects;
}
}
}