mirror of
https://github.com/magefree/mage.git
synced 2025-12-28 14:32:06 -08:00
[WOC] Implement Court of Embereth (#10971)
* Clean text generation of ConditionalOneShotEffect to prevent "if if" * [WOC] Implement Court of Embereth
This commit is contained in:
parent
26012ee135
commit
249e7bf31b
6 changed files with 106 additions and 3 deletions
|
|
@ -85,10 +85,18 @@ public class ConditionalOneShotEffect extends OneShotEffect {
|
|||
if (staticText != null && !staticText.isEmpty()) {
|
||||
return staticText;
|
||||
}
|
||||
if (otherwiseEffects.isEmpty()) {
|
||||
return "if " + condition.toString() + ", " + CardUtil.getTextWithFirstCharLowerCase(effects.getText(mode));
|
||||
|
||||
String conditionText = condition.toString();
|
||||
if (conditionText.startsWith("if ") || conditionText.startsWith("If ")) {
|
||||
conditionText = conditionText.substring(3);
|
||||
}
|
||||
return effects.getText(mode) + ". If " + condition.toString() + ", " + CardUtil.getTextWithFirstCharLowerCase(otherwiseEffects.getText(mode));
|
||||
|
||||
if (otherwiseEffects.isEmpty()) {
|
||||
return "if " + conditionText + ", "
|
||||
+ CardUtil.getTextWithFirstCharLowerCase(effects.getText(mode));
|
||||
}
|
||||
return effects.getText(mode) + ". If " + conditionText + ", "
|
||||
+ CardUtil.getTextWithFirstCharLowerCase(otherwiseEffects.getText(mode));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -18,4 +18,10 @@ public abstract class OneShotEffect extends EffectImpl {
|
|||
protected OneShotEffect(final OneShotEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public OneShotEffect setText(String staticText) {
|
||||
super.setText(staticText);
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -38,6 +38,10 @@ public class DamagePlayersEffect extends OneShotEffect {
|
|||
this(outcome, amount, TargetController.ANY);
|
||||
}
|
||||
|
||||
public DamagePlayersEffect(DynamicValue amount, TargetController controller) {
|
||||
this(Outcome.Damage, amount, controller, "{this}");
|
||||
}
|
||||
|
||||
public DamagePlayersEffect(Outcome outcome, DynamicValue amount, TargetController controller) {
|
||||
this(outcome, amount, controller, "{this}");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,29 @@
|
|||
package mage.game.permanent.token;
|
||||
|
||||
import mage.MageInt;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.SubType;
|
||||
|
||||
/**
|
||||
* @author LevelX2
|
||||
*/
|
||||
public final class Knight31RedToken extends TokenImpl {
|
||||
|
||||
public Knight31RedToken() {
|
||||
super("Knight Token", "3/1 red Knight creature token");
|
||||
|
||||
cardType.add(CardType.CREATURE);
|
||||
color.setRed(true);
|
||||
subtype.add(SubType.KNIGHT);
|
||||
power = new MageInt(3);
|
||||
toughness = new MageInt(1);
|
||||
}
|
||||
|
||||
protected Knight31RedToken(final Knight31RedToken token) {
|
||||
super(token);
|
||||
}
|
||||
|
||||
public Knight31RedToken copy() {
|
||||
return new Knight31RedToken(this);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue