mirror of
https://github.com/correl/mage.git
synced 2025-01-13 11:01:58 +00:00
* Scrap Mastery - Fixed a bug that card movement caused an exception.
This commit is contained in:
parent
a84a560327
commit
f47a2d9384
1 changed files with 4 additions and 6 deletions
|
@ -33,9 +33,8 @@ import java.util.Set;
|
|||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.Cards;
|
||||
import mage.cards.CardsImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Rarity;
|
||||
|
@ -90,12 +89,12 @@ class ScrapMasteryEffect extends OneShotEffect {
|
|||
public boolean apply(Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller != null) {
|
||||
Map<UUID, Set<UUID>> exiledCards = new HashMap<>();
|
||||
Map<UUID, Set<Card>> exiledCards = new HashMap<>();
|
||||
// exile artifacts from graveyard
|
||||
for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) {
|
||||
Player player = game.getPlayer(playerId);
|
||||
if (player != null) {
|
||||
Set cards = player.getGraveyard().getCards(new FilterArtifactCard(), game);
|
||||
Set<Card> cards = player.getGraveyard().getCards(new FilterArtifactCard(), game);
|
||||
controller.moveCards(cards, Zone.EXILED, source, game);
|
||||
exiledCards.put(player.getId(), cards);
|
||||
}
|
||||
|
@ -113,8 +112,7 @@ class ScrapMasteryEffect extends OneShotEffect {
|
|||
for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) {
|
||||
Player player = game.getPlayer(playerId);
|
||||
if (player != null) {
|
||||
Cards playersExiledCards = new CardsImpl(exiledCards.get(playerId));
|
||||
controller.moveCards(playersExiledCards, Zone.BATTLEFIELD, source, game);
|
||||
controller.moveCards(exiledCards.get(playerId), Zone.BATTLEFIELD, source, game);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
|
Loading…
Reference in a new issue