text fixes

This commit is contained in:
xenohedron 2023-10-15 00:55:28 -04:00
parent 1e482ece12
commit 7f2924b764
5 changed files with 16 additions and 45 deletions

View file

@ -1,6 +1,5 @@
package mage.abilities.effects.common;
import mage.abilities.Ability;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.dynamicvalue.common.StaticValue;
@ -13,43 +12,29 @@ import mage.players.Player;
import mage.util.CardUtil;
/**
* @Author Susucr
* <p>
* @author Susucr
*
* Have the Controller of target permanent (or LKI controller) create Tokens.
*/
public class CreateTokenControllerTargetPermanentEffect extends OneShotEffect {
private final Token token;
private final DynamicValue amount;
private final boolean tapped;
private final boolean attacking;
public CreateTokenControllerTargetPermanentEffect(Token token) {
this(token, StaticValue.get(1));
}
public CreateTokenControllerTargetPermanentEffect(Token token, int amount) {
this(token, StaticValue.get(amount));
}
public CreateTokenControllerTargetPermanentEffect(Token token, DynamicValue amount) {
this(token, amount, false, false);
this(token, 1, false);
}
public CreateTokenControllerTargetPermanentEffect(Token token, int amount, boolean tapped) {
this(token, amount, tapped, false);
this(token, StaticValue.get(amount), tapped);
}
public CreateTokenControllerTargetPermanentEffect(Token token, int amount, boolean tapped, boolean attacking) {
this(token, StaticValue.get(amount), tapped, attacking);
}
public CreateTokenControllerTargetPermanentEffect(Token token, DynamicValue amount, boolean tapped, boolean attacking) {
public CreateTokenControllerTargetPermanentEffect(Token token, DynamicValue amount, boolean tapped) {
super(Outcome.Neutral);
this.token = token;
this.amount = amount.copy();
this.tapped = tapped;
this.attacking = attacking;
this.staticText = setText();
this.staticText = makeText();
}
protected CreateTokenControllerTargetPermanentEffect(final CreateTokenControllerTargetPermanentEffect effect) {
@ -57,7 +42,6 @@ public class CreateTokenControllerTargetPermanentEffect extends OneShotEffect {
this.token = effect.token.copy();
this.amount = effect.amount.copy();
this.tapped = effect.tapped;
this.attacking = effect.attacking;
}
@Override
@ -72,13 +56,13 @@ public class CreateTokenControllerTargetPermanentEffect extends OneShotEffect {
Player controllerOfTarget = game.getPlayer(creature.getControllerId());
if (controllerOfTarget != null) {
int value = amount.calculate(game, source, this);
return token.putOntoBattlefield(value, game, source, controllerOfTarget.getId(), tapped, attacking);
return token.putOntoBattlefield(value, game, source, controllerOfTarget.getId(), tapped, false);
}
}
return false;
}
private String setText() {
private String makeText() {
String text = "Its controller creates ";
if (token.getDescription().contains(", a legendary")) {
@ -87,33 +71,21 @@ public class CreateTokenControllerTargetPermanentEffect extends OneShotEffect {
}
if (amount.toString().equals("1")) {
if (tapped && !attacking) {
if (tapped) {
text += "a tapped " + token.getDescription();
} else {
text += CardUtil.addArticle(token.getDescription());
}
} else {
text += CardUtil.numberToText(amount.toString()) + " ";
if (tapped && !attacking) {
if (tapped) {
text += "tapped ";
}
text += token.getDescription().replace("token. It has", "tokens. They have");
if (token.getDescription().endsWith("token")) {
text += "s";
}
text.replace("token ", "tokens ");
}
if (attacking) {
if (amount.toString().equals("1")) {
text += " that's";
} else {
text += " that are";
}
if (tapped) {
text += " tapped and";
}
text += " attacking";
text = text.replace("token ", "tokens ");
}
String message = amount.getMessage();

View file

@ -37,14 +37,13 @@ public class FaceVillainousChoice {
private boolean handleChoice(Player player, Game game, Ability source) {
VillainousChoice chosenChoice = player.chooseUse(
outcome, "You face a villanous choice:", null,
outcome, "You face a villainous choice:", null,
firstChoice.getMessage(game, source), secondChoice.getMessage(game, source), source, game
) ? firstChoice : secondChoice;
return chosenChoice.doChoice(player, game, source);
}
public String generateRule() {
return "faces a villanous choice &mdash; " + firstChoice.getRule() + ", or " + secondChoice.getRule();
return "faces a villainous choice &mdash; " + firstChoice.getRule() + ", or " + secondChoice.getRule();
}
}