From 1acf0fa509a565cee4e2dc34b1e7d9551b08ac35 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Sat, 20 Jun 2015 23:38:43 +0200 Subject: [PATCH] Forcefield, added a log text about the chosen creature. --- Mage.Sets/src/mage/sets/mastersedition/Forcefield.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Mage.Sets/src/mage/sets/mastersedition/Forcefield.java b/Mage.Sets/src/mage/sets/mastersedition/Forcefield.java index cc7ebcd252..dd707a170d 100644 --- a/Mage.Sets/src/mage/sets/mastersedition/Forcefield.java +++ b/Mage.Sets/src/mage/sets/mastersedition/Forcefield.java @@ -28,6 +28,7 @@ package mage.sets.mastersedition; import java.util.UUID; +import mage.MageObject; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.mana.GenericManaCost; @@ -45,6 +46,7 @@ import mage.filter.predicate.permanent.UnblockedPredicate; import mage.game.Game; import mage.game.events.GameEvent; import mage.game.events.GameEvent.EventType; +import mage.game.permanent.Permanent; import mage.players.Player; import mage.target.Target; import mage.target.common.TargetCreaturePermanent; @@ -98,9 +100,14 @@ class ForcefieldEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); - if (controller != null) { + MageObject sourceObject = source.getSourceObject(game); + if (controller != null && sourceObject != null) { Target target = new TargetCreaturePermanent(1, 1, filter, true); if (controller.choose(Outcome.PreventDamage, target, source.getSourceId(), game)) { + Permanent creature = game.getPermanent(target.getFirstTarget()); + if (creature != null) { + game.informPlayers(sourceObject.getLogName() + ": " + controller.getLogName() + " has chosen " + creature.getLogName()); + } ContinuousEffect effect = new ForcefieldPreventionEffect(); effect.setTargetPointer(new FixedTarget(target.getFirstTarget())); game.addEffect(effect, source);