mirror of
https://github.com/magefree/mage.git
synced 2026-01-09 20:32:06 -08:00
another batch of text cleanup (#11694)
* minor refactor EntersBattlefieldEffect * more minor refactoring * text fix * fix more text * more text adjustments * more text discrepancy fixes * continue the text fixes * followup fixes and more fixes
This commit is contained in:
parent
7008f0a7f0
commit
4959ef4d49
84 changed files with 192 additions and 212 deletions
|
|
@ -226,7 +226,7 @@ public abstract class TriggeredAbilityImpl extends AbilityImpl implements Trigge
|
|||
}
|
||||
}
|
||||
if (replaceRuleText && triggerPhrase != null) {
|
||||
superRule = superRule.replaceFirst("^((?:you may )?sacrifice |(put|remove) an? [^ ]+ counter (on|from) |return |transform |untap |regenerate )?\\{this\\}", "$1it");
|
||||
superRule = superRule.replaceFirst("^((?:you may )?sacrifice |(put|remove) [^ ]+ [^ ]+ counters? (on|from) |return |transform |untap |regenerate )?\\{this\\}", "$1it");
|
||||
}
|
||||
sb.append(superRule);
|
||||
if (triggersOnceEachTurn) {
|
||||
|
|
|
|||
|
|
@ -18,9 +18,9 @@ import mage.game.events.GameEvent;
|
|||
*/
|
||||
public class BecomesAttachedToCreatureSourceEffect extends ReplacementEffectImpl {
|
||||
|
||||
protected Effects baseEffects = new Effects();
|
||||
protected String text;
|
||||
protected Condition condition;
|
||||
private final Effects baseEffects;
|
||||
private final String text;
|
||||
private final Condition condition;
|
||||
|
||||
public BecomesAttachedToCreatureSourceEffect(Effect baseEffect) {
|
||||
this(baseEffect, "");
|
||||
|
|
@ -32,6 +32,7 @@ public class BecomesAttachedToCreatureSourceEffect extends ReplacementEffectImpl
|
|||
|
||||
public BecomesAttachedToCreatureSourceEffect(Effect baseEffect, Condition condition, String text) {
|
||||
super(Duration.WhileOnBattlefield, baseEffect.getOutcome(), false);
|
||||
this.baseEffects = new Effects();
|
||||
this.baseEffects.add(baseEffect);
|
||||
this.text = text;
|
||||
this.condition = condition;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
package mage.abilities.effects;
|
||||
|
||||
import mage.MageObject;
|
||||
|
|
@ -20,11 +19,11 @@ import mage.players.Player;
|
|||
*/
|
||||
public class EntersBattlefieldEffect extends ReplacementEffectImpl {
|
||||
|
||||
protected Effects baseEffects = new Effects();
|
||||
protected String text;
|
||||
protected Condition condition;
|
||||
protected boolean optional;
|
||||
protected EnterEventType enterEventType;
|
||||
private final Effects baseEffects;
|
||||
private final String text;
|
||||
private final Condition condition;
|
||||
private final boolean optional;
|
||||
private final EnterEventType enterEventType;
|
||||
|
||||
public static final String SOURCE_CAST_SPELL_ABILITY = "sourceCastSpellAbility";
|
||||
|
||||
|
|
@ -46,6 +45,7 @@ public class EntersBattlefieldEffect extends ReplacementEffectImpl {
|
|||
|
||||
public EntersBattlefieldEffect(Effect baseEffect, Condition condition, String text, boolean selfScope, boolean optional, EnterEventType enterEventType) {
|
||||
super(Duration.WhileOnBattlefield, baseEffect.getOutcome(), selfScope);
|
||||
this.baseEffects = new Effects();
|
||||
this.baseEffects.add(baseEffect);
|
||||
this.enterEventType = enterEventType;
|
||||
this.text = text;
|
||||
|
|
@ -83,12 +83,8 @@ public class EntersBattlefieldEffect extends ReplacementEffectImpl {
|
|||
|
||||
@Override
|
||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
if (event.getTargetId().equals(source.getSourceId())) {
|
||||
if (condition == null || condition.apply(game, source)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
return event.getTargetId().equals(source.getSourceId())
|
||||
&& (condition == null || condition.apply(game, source));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -43,6 +43,9 @@ public class AddContinuousEffectToGame extends OneShotEffect {
|
|||
|
||||
@Override
|
||||
public String getText(Mode mode) {
|
||||
if (staticText != null && !staticText.isEmpty()) {
|
||||
return staticText;
|
||||
}
|
||||
return effects.getText(mode);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@ public class DontUntapInControllersNextUntapStepSourceEffect extends ContinuousR
|
|||
|
||||
protected DontUntapInControllersNextUntapStepSourceEffect(final DontUntapInControllersNextUntapStepSourceEffect effect) {
|
||||
super(effect);
|
||||
this.validForTurnNum = effect.validForTurnNum;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ public class ExileCardYouChooseTargetOpponentEffect extends OneShotEffect {
|
|||
public ExileCardYouChooseTargetOpponentEffect(FilterCard filter) {
|
||||
super(Outcome.Discard);
|
||||
this.staticText = "target opponent reveals their hand. You choose "
|
||||
+ filter.getMessage() + " from it and exile that card";
|
||||
+ filter.getMessage() + (filter.getMessage().contains("from it") ? "" : " from it") + " and exile that card";
|
||||
this.filter = filter;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,6 @@ import mage.constants.Outcome;
|
|||
import mage.constants.SubLayer;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.util.CardUtil;
|
||||
|
||||
/**
|
||||
* @author mzulch
|
||||
|
|
@ -17,14 +16,22 @@ public class CanBlockAdditionalCreatureTargetEffect extends ContinuousEffectImpl
|
|||
|
||||
protected int amount;
|
||||
|
||||
/**
|
||||
* Need to set text manually
|
||||
* Target can block an additional creature this turn
|
||||
*/
|
||||
public CanBlockAdditionalCreatureTargetEffect() {
|
||||
this(Duration.EndOfTurn, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* Need to set text manually
|
||||
* @param duration of effect
|
||||
* @param amount 0 = any number
|
||||
*/
|
||||
public CanBlockAdditionalCreatureTargetEffect(Duration duration, int amount) {
|
||||
super(duration, Outcome.Benefit);
|
||||
this.amount = amount;
|
||||
staticText = setText();
|
||||
}
|
||||
|
||||
protected CanBlockAdditionalCreatureTargetEffect(final CanBlockAdditionalCreatureTargetEffect effect) {
|
||||
|
|
@ -59,24 +66,6 @@ public class CanBlockAdditionalCreatureTargetEffect extends ContinuousEffectImpl
|
|||
return false;
|
||||
}
|
||||
|
||||
private String setText() {
|
||||
String text = "target can block ";
|
||||
switch (amount) {
|
||||
case 0:
|
||||
text += "any number of creatures";
|
||||
break;
|
||||
default:
|
||||
text += CardUtil.numberToText(amount, "an") + " additional creature" + (amount > 1 ? "s" : "");
|
||||
}
|
||||
if (duration == Duration.EndOfTurn) {
|
||||
text += " this turn";
|
||||
}
|
||||
if (duration == Duration.WhileOnBattlefield) {
|
||||
text += " each combat";
|
||||
}
|
||||
return text;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasLayer(Layer layer) {
|
||||
return layer == Layer.RulesEffects;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue