mirror of
https://github.com/magefree/mage.git
synced 2025-12-28 14:32:06 -08:00
fix #10078 (Duplicity)
This commit is contained in:
parent
5e095afdb0
commit
c6a54c5a66
1 changed files with 6 additions and 5 deletions
|
|
@ -112,16 +112,17 @@ class DuplicityExileHandEffect extends OneShotEffect {
|
|||
public boolean apply(Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
MageObject sourceObject = game.getObject(source);
|
||||
if (controller != null
|
||||
&& sourceObject != null) {
|
||||
if (!controller.getHand().isEmpty()) {
|
||||
UUID exileId = source.getSourceId();
|
||||
if (controller != null && sourceObject != null) {
|
||||
UUID exileId = source.getSourceId();
|
||||
Set<Card> cardsInExile = game.getExile().getExileZone(exileId).getCards(game);
|
||||
if (controller.getHand().isEmpty()) {
|
||||
controller.moveCards(cardsInExile, Zone.HAND, source, game);
|
||||
} else {
|
||||
Set<Card> cardsFromHandToExile = controller.getHand().getCards(game);
|
||||
for (Card card : cardsFromHandToExile) {
|
||||
controller.moveCardsToExile(card, source, game, true, exileId, sourceObject.getName());
|
||||
card.setFaceDown(true, game);
|
||||
}
|
||||
Set<Card> cardsInExile = game.getExile().getExileZone(exileId).getCards(game);
|
||||
Set<Card> cardsToReturnToHandFromExile = new HashSet<>();
|
||||
for (Card card : cardsInExile) {
|
||||
if (!cardsFromHandToExile.contains(card)) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue