This commit is contained in:
jeffwadsworth 2020-08-10 09:11:30 -05:00
parent 82e560f2ff
commit 3f4475a136

View file

@ -1,4 +1,3 @@
package mage.cards.u; package mage.cards.u;
import java.util.UUID; import java.util.UUID;
@ -30,7 +29,7 @@ import mage.target.TargetPlayer;
public final class UrzasBauble extends CardImpl { public final class UrzasBauble extends CardImpl {
public UrzasBauble(UUID ownerId, CardSetInfo setInfo) { 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. // {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()); Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new LookAtRandomCardEffect(), new TapSourceCost());
@ -40,7 +39,6 @@ public final class UrzasBauble extends CardImpl {
this.addAbility(ability); this.addAbility(ability);
} }
public UrzasBauble(final UrzasBauble card) { public UrzasBauble(final UrzasBauble card) {
super(card); super(card);
} }
@ -69,16 +67,18 @@ class LookAtRandomCardEffect extends OneShotEffect {
@Override @Override
public boolean apply(Game game, Ability source) { 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()); Player targetPlayer = game.getPlayer(source.getFirstTarget());
MageObject sourceObject = game.getObject(source.getSourceId()); MageObject sourceObject = game.getObject(source.getSourceId());
if (you != null && targetPlayer != null && sourceObject != null) { if (controller != null
if(!targetPlayer.getHand().isEmpty()) && targetPlayer != null
{ && sourceObject != null) {
if (!targetPlayer.getHand().isEmpty()) {
Cards randomCard = new CardsImpl(); Cards randomCard = new CardsImpl();
Card card = targetPlayer.getHand().getRandom(game); Card card = targetPlayer.getHand().getRandom(game);
randomCard.add(card); 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 true;
} }