mirror of
https://github.com/correl/mage.git
synced 2024-12-26 03:00:11 +00:00
spjspj - Reduce to Dreams was only returning the controller's enchantments/artifacts to hand. Should be all players in range having them returned to hand.
This commit is contained in:
parent
b7a0fa42fb
commit
f5adc6591e
1 changed files with 16 additions and 6 deletions
|
@ -36,11 +36,14 @@ import mage.abilities.effects.OneShotEffect;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.constants.Outcome;
|
import mage.constants.Outcome;
|
||||||
import mage.constants.Zone;
|
import mage.constants.Zone;
|
||||||
|
import mage.filter.FilterPermanent;
|
||||||
import mage.filter.common.FilterControlledPermanent;
|
import mage.filter.common.FilterControlledPermanent;
|
||||||
import mage.filter.predicate.Predicates;
|
import mage.filter.predicate.Predicates;
|
||||||
import mage.filter.predicate.mageobject.CardTypePredicate;
|
import mage.filter.predicate.mageobject.CardTypePredicate;
|
||||||
|
import mage.filter.predicate.other.OwnerIdPredicate;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.game.permanent.Permanent;
|
import mage.game.permanent.Permanent;
|
||||||
|
import mage.players.Player;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
@ -88,8 +91,15 @@ class ReduceToDreamsEffect extends OneShotEffect {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(Game game, Ability source) {
|
public boolean apply(Game game, Ability source) {
|
||||||
for (Permanent creature : game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source.getSourceId(), game)) {
|
Player controller = game.getPlayer(source.getControllerId());
|
||||||
creature.moveToZone(Zone.HAND, source.getSourceId(), game, true);
|
if (controller != null) {
|
||||||
|
for (UUID playerId : controller.getInRange()) {
|
||||||
|
FilterPermanent playerFilter = filter.copy();
|
||||||
|
playerFilter.add(new OwnerIdPredicate(playerId));
|
||||||
|
for (Permanent permanent : game.getBattlefield().getActivePermanents(playerFilter, playerId, game)) {
|
||||||
|
permanent.moveToZone(Zone.HAND, playerId, game, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue