From 3f4475a136bba68ff734b7a15671889abf8befbd Mon Sep 17 00:00:00 2001 From: jeffwadsworth Date: Mon, 10 Aug 2020 09:11:30 -0500 Subject: [PATCH] - Fixed #6943 --- Mage.Sets/src/mage/cards/u/UrzasBauble.java | 22 ++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/Mage.Sets/src/mage/cards/u/UrzasBauble.java b/Mage.Sets/src/mage/cards/u/UrzasBauble.java index 31f43a76915..dc8a6c7c075 100644 --- a/Mage.Sets/src/mage/cards/u/UrzasBauble.java +++ b/Mage.Sets/src/mage/cards/u/UrzasBauble.java @@ -1,4 +1,3 @@ - package mage.cards.u; import java.util.UUID; @@ -30,7 +29,7 @@ import mage.target.TargetPlayer; public final class UrzasBauble extends CardImpl { public UrzasBauble(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{0}"); + super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{0}"); // {tap}, Sacrifice Urza's Bauble: Look at a card at random in target player's hand. You draw a card at the beginning of the next turn's upkeep. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new LookAtRandomCardEffect(), new TapSourceCost()); @@ -39,7 +38,6 @@ public final class UrzasBauble extends CardImpl { ability.addEffect(new CreateDelayedTriggeredAbilityEffect(new AtTheBeginOfNextUpkeepDelayedTriggeredAbility(new DrawCardSourceControllerEffect(1)), false)); this.addAbility(ability); } - public UrzasBauble(final UrzasBauble card) { super(card); @@ -57,7 +55,7 @@ class LookAtRandomCardEffect extends OneShotEffect { super(Outcome.Benefit); this.staticText = "Look at a card at random in target player's hand"; } - + public LookAtRandomCardEffect(final LookAtRandomCardEffect effect) { super(effect); } @@ -66,23 +64,25 @@ class LookAtRandomCardEffect extends OneShotEffect { public LookAtRandomCardEffect copy() { return new LookAtRandomCardEffect(this); } - + @Override public boolean apply(Game game, Ability source) { - Player you = game.getPlayer(source.getControllerId()); + Player controller = game.getPlayer(source.getControllerId()); Player targetPlayer = game.getPlayer(source.getFirstTarget()); MageObject sourceObject = game.getObject(source.getSourceId()); - if (you != null && targetPlayer != null && sourceObject != null) { - if(!targetPlayer.getHand().isEmpty()) - { + if (controller != null + && targetPlayer != null + && sourceObject != null) { + if (!targetPlayer.getHand().isEmpty()) { Cards randomCard = new CardsImpl(); Card card = targetPlayer.getHand().getRandom(game); randomCard.add(card); - you.lookAtCards(sourceObject.getName(), randomCard, game); + controller.lookAtCards(sourceObject.getName(), randomCard, game); + game.informPlayer(targetPlayer, "The random card from your hand shown to " + controller.getName() + " is " + card.getName()); } return true; } return false; } - + }