From d498df6a54d4498d306d64a6a5ca842ef3a0478a Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Sun, 14 Sep 2014 23:57:55 +0200 Subject: [PATCH] Some minor changes to framework classes. --- .../LookLibraryAndPickControllerEffect.java | 18 +++++++++++++++++- .../GainProtectionFromColorTargetEffect.java | 3 +++ Mage/src/mage/target/TargetSource.java | 3 +++ 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/Mage/src/mage/abilities/effects/common/LookLibraryAndPickControllerEffect.java b/Mage/src/mage/abilities/effects/common/LookLibraryAndPickControllerEffect.java index 5320a239ea..ee78931caa 100644 --- a/Mage/src/mage/abilities/effects/common/LookLibraryAndPickControllerEffect.java +++ b/Mage/src/mage/abilities/effects/common/LookLibraryAndPickControllerEffect.java @@ -45,6 +45,7 @@ import mage.target.TargetCard; import java.util.List; import java.util.UUID; +import mage.util.CardUtil; /** * @@ -216,7 +217,22 @@ public class LookLibraryAndPickControllerEffect extends LookLibraryControllerEff } sb.append("put ").append(filter.getMessage()).append(" from among them onto the "); } else { - sb.append(". Put one of them into your "); + sb.append(". Put "); + if (numberToPick.calculate(null, null, this) > 1 ) { + if (upTo) { + if (numberToPick.calculate(null, null, this) == (numberOfCards.calculate(null, null, this))) { + sb.append("any number"); + } else { + sb.append("up to ").append(CardUtil.numberToText(numberToPick.calculate(null, null, this))); + } + } else{ + sb.append(CardUtil.numberToText(numberToPick.calculate(null, null, this))); + } + } else { + sb.append("one"); + } + + sb.append(" of them into your "); } } sb.append(targetPickedCards.toString().toLowerCase()); diff --git a/Mage/src/mage/abilities/effects/common/continious/GainProtectionFromColorTargetEffect.java b/Mage/src/mage/abilities/effects/common/continious/GainProtectionFromColorTargetEffect.java index 8d4cbeda66..7b6011a44c 100644 --- a/Mage/src/mage/abilities/effects/common/continious/GainProtectionFromColorTargetEffect.java +++ b/Mage/src/mage/abilities/effects/common/continious/GainProtectionFromColorTargetEffect.java @@ -70,6 +70,9 @@ public class GainProtectionFromColorTargetEffect extends GainAbilityTargetEffect if (creature != null && player != null) { while (!choice.isChosen()) { player.choose(Outcome.Protect, choice, game); + if (!player.isInGame()) { + return false; + } } FilterCard protectionFilter = (FilterCard)((ProtectionAbility)ability).getFilter(); protectionFilter.add(new ColorPredicate(choice.getColor())); diff --git a/Mage/src/mage/target/TargetSource.java b/Mage/src/mage/target/TargetSource.java index 53cee0231b..5eced2dae6 100644 --- a/Mage/src/mage/target/TargetSource.java +++ b/Mage/src/mage/target/TargetSource.java @@ -93,6 +93,9 @@ public class TargetSource extends TargetObject { else { addTarget(id, source, game, notTarget); } + if (object != null) { + game.informPlayers("Selected " + object.getLogName() + " as source"); + } } }