mirror of
https://github.com/magefree/mage.git
synced 2025-12-22 19:41:59 -08:00
- Fixed #6943
This commit is contained in:
parent
82e560f2ff
commit
3f4475a136
1 changed files with 11 additions and 11 deletions
|
|
@ -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());
|
||||||
|
|
@ -39,7 +38,6 @@ public final class UrzasBauble extends CardImpl {
|
||||||
ability.addEffect(new CreateDelayedTriggeredAbilityEffect(new AtTheBeginOfNextUpkeepDelayedTriggeredAbility(new DrawCardSourceControllerEffect(1)), false));
|
ability.addEffect(new CreateDelayedTriggeredAbilityEffect(new AtTheBeginOfNextUpkeepDelayedTriggeredAbility(new DrawCardSourceControllerEffect(1)), false));
|
||||||
this.addAbility(ability);
|
this.addAbility(ability);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public UrzasBauble(final UrzasBauble card) {
|
public UrzasBauble(final UrzasBauble card) {
|
||||||
super(card);
|
super(card);
|
||||||
|
|
@ -57,7 +55,7 @@ class LookAtRandomCardEffect extends OneShotEffect {
|
||||||
super(Outcome.Benefit);
|
super(Outcome.Benefit);
|
||||||
this.staticText = "Look at a card at random in target player's hand";
|
this.staticText = "Look at a card at random in target player's hand";
|
||||||
}
|
}
|
||||||
|
|
||||||
public LookAtRandomCardEffect(final LookAtRandomCardEffect effect) {
|
public LookAtRandomCardEffect(final LookAtRandomCardEffect effect) {
|
||||||
super(effect);
|
super(effect);
|
||||||
}
|
}
|
||||||
|
|
@ -66,23 +64,25 @@ class LookAtRandomCardEffect extends OneShotEffect {
|
||||||
public LookAtRandomCardEffect copy() {
|
public LookAtRandomCardEffect copy() {
|
||||||
return new LookAtRandomCardEffect(this);
|
return new LookAtRandomCardEffect(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@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;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue