diff --git a/Mage/src/mage/abilities/ActivatedAbilityImpl.java b/Mage/src/mage/abilities/ActivatedAbilityImpl.java index 64f7d23517..10e37e0e02 100644 --- a/Mage/src/mage/abilities/ActivatedAbilityImpl.java +++ b/Mage/src/mage/abilities/ActivatedAbilityImpl.java @@ -50,6 +50,7 @@ import mage.game.Game; import mage.game.stack.Spell; import mage.game.stack.StackAbility; import mage.target.Target; +import mage.target.Targets; /** @@ -281,12 +282,7 @@ public abstract class ActivatedAbilityImpl> ex sb.append(spellAbility.name); } } - if (spellAbility.getTargets().size() > 0) { - for (Target target: spellAbility.getTargets()) { - sb.append(" targeting "); - sb.append(target.getTargetedName(game)); - } - } + appendTargetDescriptionForLog(sb, spellAbility.getTargets(), game); } } } else if (object instanceof Spell && ((Spell) object).getSpellAbility().getModes().size() > 1) { @@ -297,21 +293,11 @@ public abstract class ActivatedAbilityImpl> ex if (spellModes.getSelectedModes().contains(mode.getId())) { spellModes.setMode(mode); sb.append(" (mode ").append(item).append(")"); - if (getTargets().size() > 0) { - sb.append(" targeting "); - for (Target target: getTargets()) { - sb.append(target.getTargetedName(game)); - } - } + appendTargetDescriptionForLog(sb, getTargets(), game); } } } else { - if (getTargets().size() > 0) { - sb.append(" targeting "); - for (Target target: getTargets()) { - sb.append(target.getTargetedName(game)); - } - } + appendTargetDescriptionForLog(sb, getTargets(), game); } for (Choice choice :this.getChoices()) { sb.append(" - ").append(choice.getMessage()).append(": ").append(choice.getChoice()); @@ -319,7 +305,25 @@ public abstract class ActivatedAbilityImpl> ex return sb.toString(); } - String getOptionalTextSuffix(Game game, Spell spell) { + private void appendTargetDescriptionForLog(StringBuilder sb, Targets targets, Game game) { + if (targets.size() > 0) { + String usedVerb = null; + for (Target target: targets) { + if (!target.isNotTarget()) { + if (usedVerb == null || usedVerb.equals(" choosing ")) { + usedVerb = " targeting "; + sb.append(usedVerb); + } + } else if (target.isNotTarget() && (usedVerb == null || usedVerb.equals(" targeting "))) { + usedVerb = " choosing "; + sb.append(usedVerb); + } + sb.append(target.getTargetedName(game)); + } + } + } + + private String getOptionalTextSuffix(Game game, Spell spell) { StringBuilder sb = new StringBuilder(); for (Ability ability : (Abilities) spell.getAbilities()) { if (ability instanceof OptionalAdditionalSourceCosts) { diff --git a/Mage/src/mage/players/PlayerImpl.java b/Mage/src/mage/players/PlayerImpl.java index f2a3237c08..b9ed06f3a4 100644 --- a/Mage/src/mage/players/PlayerImpl.java +++ b/Mage/src/mage/players/PlayerImpl.java @@ -2107,7 +2107,7 @@ public abstract class PlayerImpl> implements Player, Ser game.informPlayers(new StringBuilder(this.getName()) .append(" puts ").append(card.getName()).append(" ") .append(fromZone != null ? new StringBuilder("from ").append(fromZone.toString().toLowerCase(Locale.ENGLISH)).append(" "):"") - .append("onto his or her hand").toString()); + .append("into his or her hand").toString()); } return result; }