mirror of
https://github.com/correl/mage.git
synced 2024-11-15 11:09:30 +00:00
* Show and Tell - Fixed that you see the choice of other players vefore you select yourself a card (this does not fix that a selected clone can select another selected creature coming into play with Show and Tell).
This commit is contained in:
parent
da0100d3fd
commit
e453c44f2f
2 changed files with 25 additions and 13 deletions
|
@ -39,9 +39,9 @@ import mage.constants.Rarity;
|
|||
import mage.constants.Zone;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.game.permanent.token.EmptyToken;
|
||||
import mage.players.Player;
|
||||
import mage.players.PlayerList;
|
||||
import mage.game.permanent.token.EmptyToken;
|
||||
import mage.target.common.TargetControlledCreaturePermanent;
|
||||
import mage.util.CardUtil;
|
||||
|
||||
|
@ -100,7 +100,7 @@ class TemptWithReflectionsEffect extends OneShotEffect {
|
|||
CardUtil.copyTo(token).from(permanent);
|
||||
token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId());
|
||||
|
||||
Set<UUID> playersSaidYes = new HashSet<UUID>();
|
||||
Set<UUID> playersSaidYes = new HashSet<>();
|
||||
PlayerList playerList = game.getPlayerList().copy();
|
||||
playerList.setCurrent(game.getActivePlayerId());
|
||||
Player player = game.getPlayer(game.getActivePlayerId());
|
||||
|
|
|
@ -27,6 +27,8 @@
|
|||
*/
|
||||
package mage.sets.urzassaga;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
|
@ -41,6 +43,7 @@ import mage.filter.predicate.Predicates;
|
|||
import mage.filter.predicate.mageobject.CardTypePredicate;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
import mage.players.PlayerList;
|
||||
import mage.target.common.TargetCardInHand;
|
||||
|
||||
/**
|
||||
|
@ -101,20 +104,29 @@ class ShowAndTellEffect extends OneShotEffect {
|
|||
if (controller == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
for (UUID playerId : controller.getInRange()) {
|
||||
Player player = game.getPlayer(playerId);
|
||||
if (player != null) {
|
||||
if (player.chooseUse(outcome, "Put an artifact, creature, enchantment, or land card from hand onto the battlefield?", game)) {
|
||||
TargetCardInHand target = new TargetCardInHand(filter);
|
||||
if (player.choose(outcome, target, source.getSourceId(), game)) {
|
||||
Card card = game.getCard(target.getFirstTarget());
|
||||
if (card != null) {
|
||||
player.putOntoBattlefieldWithInfo(card, game, Zone.HAND, source.getSourceId());
|
||||
}
|
||||
List<Card> cardsToPutIntoPlay = new ArrayList<>();
|
||||
TargetCardInHand target = new TargetCardInHand(filter);
|
||||
PlayerList playerList = game.getPlayerList().copy();
|
||||
playerList.setCurrent(game.getActivePlayerId());
|
||||
Player player = game.getPlayer(game.getActivePlayerId());
|
||||
do {
|
||||
if (player.chooseUse(outcome, "Put an artifact, creature, enchantment, or land card from hand onto the battlefield?", game)) {
|
||||
target.clearChosen();
|
||||
if (player.chooseTarget(outcome, target, source, game)) {
|
||||
Card card = game.getCard(target.getFirstTarget());
|
||||
if (card != null) {
|
||||
cardsToPutIntoPlay.add(card);
|
||||
}
|
||||
}
|
||||
}
|
||||
player = playerList.getNextInRange(controller, game);
|
||||
} while (!player.getId().equals(game.getActivePlayerId()));
|
||||
|
||||
for (Card card: cardsToPutIntoPlay) {
|
||||
player = game.getPlayer(card.getOwnerId());
|
||||
if (player != null) {
|
||||
player.putOntoBattlefieldWithInfo(card, game, Zone.HAND, source.getSourceId());
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue