Fixed multiple card texts;

This commit is contained in:
Oleg Agafonov 2020-01-18 11:01:33 +04:00
parent 5157a88dba
commit b2ab3a2ba4
9 changed files with 34 additions and 23 deletions

View file

@ -1,6 +1,5 @@
package mage.cards.a; package mage.cards.a;
import java.util.UUID;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.LoyaltyAbility; import mage.abilities.LoyaltyAbility;
import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility; import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility;
@ -21,6 +20,8 @@ import mage.game.Game;
import mage.target.common.TargetCardInGraveyard; import mage.target.common.TargetCardInGraveyard;
import mage.target.common.TargetOpponent; import mage.target.common.TargetOpponent;
import java.util.UUID;
/** /**
* @author TheElk801 * @author TheElk801
*/ */
@ -37,7 +38,7 @@ public final class AshiokSculptorOfFears extends CardImpl {
// +2: Draw a card. Each player puts the top two cards of their library into their graveyard. // +2: Draw a card. Each player puts the top two cards of their library into their graveyard.
Ability ability = new LoyaltyAbility( Ability ability = new LoyaltyAbility(
new DrawCardSourceControllerEffect(1).setText("draw a card."), 2 new DrawCardSourceControllerEffect(1).setText("draw a card"), 2
); );
ability.addEffect(new PutTopCardOfLibraryIntoGraveEachPlayerEffect(2, TargetController.ANY)); ability.addEffect(new PutTopCardOfLibraryIntoGraveEachPlayerEffect(2, TargetController.ANY));
this.addAbility(ability); this.addAbility(ability);

View file

@ -33,7 +33,7 @@ public final class DemonOfLoathing extends CardImpl {
// Whenever Demon of Loathing deals combat damage to a player, that player sacrifices a creature. // Whenever Demon of Loathing deals combat damage to a player, that player sacrifices a creature.
this.addAbility(new DealsCombatDamageToAPlayerTriggeredAbility(new SacrificeEffect( this.addAbility(new DealsCombatDamageToAPlayerTriggeredAbility(new SacrificeEffect(
StaticFilters.FILTER_PERMANENT_A_CREATURE, 1, "that player" StaticFilters.FILTER_PERMANENT_CREATURE, 1, "that player"
), false, true)); ), false, true));
} }

View file

@ -26,7 +26,7 @@ public final class DreamstalkerManticore extends CardImpl {
// Whenever you cast your first spell during each opponent's turn, Dreamstalker Manticore deals 1 damage to any target. // Whenever you cast your first spell during each opponent's turn, Dreamstalker Manticore deals 1 damage to any target.
Ability ability = new FirstSpellOpponentsTurnTriggeredAbility( Ability ability = new FirstSpellOpponentsTurnTriggeredAbility(
new DamageTargetEffect(1, "it"), false new DamageTargetEffect(1), false
); );
ability.addTarget(new TargetAnyTarget()); ability.addTarget(new TargetAnyTarget());
this.addAbility(ability); this.addAbility(ability);

View file

@ -1,6 +1,5 @@
package mage.cards.u; package mage.cards.u;
import java.util.UUID;
import mage.abilities.effects.common.DamageAllEffect; import mage.abilities.effects.common.DamageAllEffect;
import mage.abilities.effects.common.replacement.DealtDamageToCreatureBySourceDies; import mage.abilities.effects.common.replacement.DealtDamageToCreatureBySourceDies;
import mage.cards.CardImpl; import mage.cards.CardImpl;
@ -10,8 +9,9 @@ import mage.constants.Duration;
import mage.filter.common.FilterCreatureOrPlaneswalkerPermanent; import mage.filter.common.FilterCreatureOrPlaneswalkerPermanent;
import mage.watchers.common.DamagedByWatcher; import mage.watchers.common.DamagedByWatcher;
import java.util.UUID;
/** /**
*
* @author LevelX2 * @author LevelX2
*/ */
public final class UnderworldFires extends CardImpl { public final class UnderworldFires extends CardImpl {
@ -22,6 +22,7 @@ public final class UnderworldFires extends CardImpl {
// Underworld Fires deals 1 damage to each creature and each planeswalker. // Underworld Fires deals 1 damage to each creature and each planeswalker.
this.getSpellAbility().addEffect(new DamageAllEffect(1, this.getSpellAbility().addEffect(new DamageAllEffect(1,
new FilterCreatureOrPlaneswalkerPermanent("creature and each planeswalker"))); new FilterCreatureOrPlaneswalkerPermanent("creature and each planeswalker")));
// If a permanent dealt damage this way would die this turn, exile it instead. // If a permanent dealt damage this way would die this turn, exile it instead.
this.getSpellAbility().addEffect(new DealtDamageToCreatureBySourceDies(this, Duration.EndOfTurn)); this.getSpellAbility().addEffect(new DealtDamageToCreatureBySourceDies(this, Duration.EndOfTurn));
this.getSpellAbility().addWatcher(new DamagedByWatcher(false)); this.getSpellAbility().addWatcher(new DamagedByWatcher(false));

View file

@ -20,7 +20,6 @@ import mage.target.Target;
import mage.target.Targets; import mage.target.Targets;
/** /**
*
* @author LevelX2 * @author LevelX2
*/ */
public class SagaAbility extends SimpleStaticAbility { public class SagaAbility extends SimpleStaticAbility {
@ -101,7 +100,7 @@ public class SagaAbility extends SimpleStaticAbility {
public static boolean isChapterAbility(StackObject stackObject) { public static boolean isChapterAbility(StackObject stackObject) {
if (stackObject instanceof StackAbility) { if (stackObject instanceof StackAbility) {
return ((StackAbility) stackObject).getStackAbility() instanceof ChapterTriggeredAbility; return stackObject.getStackAbility() instanceof ChapterTriggeredAbility;
} }
return false; return false;
} }
@ -181,7 +180,7 @@ class ChapterTriggeredAbility extends TriggeredAbilityImpl {
} }
} }
String text = super.getRule(); String text = super.getRule();
sb.append(": ").append(Character.toUpperCase(text.charAt(0))).append(text.substring(1)); sb.append(" - ").append(Character.toUpperCase(text.charAt(0))).append(text.substring(1));
return sb.toString(); return sb.toString();
} }
} }

View file

@ -1,14 +1,11 @@
package mage.abilities.effects.common; package mage.abilities.effects.common;
import mage.constants.Outcome;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.OneShotEffect;
import mage.constants.Outcome;
import mage.constants.Zone; import mage.constants.Zone;
import mage.game.Game; import mage.game.Game;
import mage.players.Player; import mage.players.Player;
import mage.util.CardUtil; import mage.util.CardUtil;
/** /**
@ -49,6 +46,7 @@ public class PutTopCardOfLibraryIntoGraveControllerEffect extends OneShotEffect
if (numberCards == 1) { if (numberCards == 1) {
sb.append(" card"); sb.append(" card");
} else { } else {
sb.append(" ");
sb.append(CardUtil.numberToText(numberCards)); sb.append(CardUtil.numberToText(numberCards));
sb.append(" cards"); sb.append(" cards");
} }

View file

@ -148,7 +148,7 @@ public class GainAbilityControlledEffect extends ContinuousEffectImpl {
if (!duration.toString().isEmpty() && duration != Duration.EndOfGame) { if (!duration.toString().isEmpty() && duration != Duration.EndOfGame) {
sb.append(' ').append(duration.toString()); sb.append(' ').append(duration.toString());
} }
staticText = sb.toString(); staticText = sb.toString() + ".";
} }
} }

View file

@ -1,4 +1,3 @@
package mage.abilities.effects.common.continuous; package mage.abilities.effects.common.continuous;
import mage.MageObject; import mage.MageObject;
@ -16,7 +15,6 @@ import mage.game.permanent.Permanent;
import mage.players.Player; import mage.players.Player;
/** /**
*
* @author BetaSteward_at_googlemail.com * @author BetaSteward_at_googlemail.com
*/ */
public class GainProtectionFromColorTargetEffect extends GainAbilityTargetEffect { public class GainProtectionFromColorTargetEffect extends GainAbilityTargetEffect {
@ -78,6 +76,20 @@ public class GainProtectionFromColorTargetEffect extends GainAbilityTargetEffect
if (staticText != null && !staticText.isEmpty()) { if (staticText != null && !staticText.isEmpty()) {
return staticText; return staticText;
} }
return "target creature you control gains protection from the color of your choice " + duration.toString();
StringBuilder sb = new StringBuilder();
if (!mode.getTargets().isEmpty()) {
if (mode.getTargets().get(0).getTargetName().contains("target")) {
sb.append(mode.getTargets().get(0).getTargetName());
} else {
sb.append("target ").append(mode.getTargets().get(0).getTargetName());
}
}
if (sb.length() > 0) {
sb.append(" ");
}
sb.append("gains protection from the color of your choice " + duration.toString());
return sb.toString();
} }
} }

View file

@ -1,7 +1,5 @@
package mage.abilities.effects.common.search; package mage.abilities.effects.common.search;
import java.util.List;
import java.util.UUID;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.effects.SearchEffect; import mage.abilities.effects.SearchEffect;
import mage.cards.CardsImpl; import mage.cards.CardsImpl;
@ -12,8 +10,10 @@ import mage.players.Player;
import mage.target.common.TargetCardInLibrary; import mage.target.common.TargetCardInLibrary;
import mage.util.CardUtil; import mage.util.CardUtil;
import java.util.List;
import java.util.UUID;
/** /**
*
* @author BetaSteward_at_googlemail.com * @author BetaSteward_at_googlemail.com
*/ */
public class SearchLibraryPutInPlayEffect extends SearchEffect { public class SearchLibraryPutInPlayEffect extends SearchEffect {
@ -84,11 +84,11 @@ public class SearchLibraryPutInPlayEffect extends SearchEffect {
} else { } else {
sb.append("up to ").append(CardUtil.numberToText(target.getMaxNumberOfTargets())).append(' '); sb.append("up to ").append(CardUtil.numberToText(target.getMaxNumberOfTargets())).append(' ');
} }
sb.append(target.getTargetName()).append(" and put them onto the battlefield"); sb.append(target.getTargetName()).append(", put them onto the battlefield");
} else { } else {
sb.append(target.getTargetName().startsWith("a ") || target.getTargetName().startsWith("an ") ? "" : "a ") sb.append(target.getTargetName().startsWith("a ") || target.getTargetName().startsWith("an ") ? "" : "a ")
.append(target.getTargetName()) .append(target.getTargetName())
.append(" and put it onto the battlefield"); .append(", put it onto the battlefield");
} }
if (tapped) { if (tapped) {
sb.append(" tapped"); sb.append(" tapped");