mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-16 18:58:00 +00:00
- Fixed ChangeZoneAll with origin library.
This commit is contained in:
@@ -51,24 +51,25 @@ public class ChangeZoneAllEffect extends SpellAbilityEffect {
|
||||
|
||||
if ((!sa.usesTargeting() && !sa.hasParam("Defined")) || sa.hasParam("UseAllOriginZones")) {
|
||||
cards = game.getCardsIn(origin);
|
||||
} else if (origin.contains(ZoneType.Library) && sa.hasParam("Search")) {
|
||||
// Search library using changezoneall effect need a param "Search"
|
||||
if (sa.getActivatingPlayer().hasKeyword("LimitSearchLibrary")) {
|
||||
for (final Player p : tgtPlayers) {
|
||||
cards.addAll(p.getCardsIn(origin));
|
||||
cards.removeAll(p.getCardsIn(ZoneType.Library));
|
||||
int fetchNum = Math.min(p.getCardsIn(ZoneType.Library).size(), 4);
|
||||
cards.addAll(p.getCardsIn(ZoneType.Library, fetchNum));
|
||||
}
|
||||
}
|
||||
if (sa.getActivatingPlayer().hasKeyword("CantSearchLibrary")) {
|
||||
// all these cards have "then that player shuffles", mandatory shuffle
|
||||
cards.removeAll(game.getCardsIn(ZoneType.Library));
|
||||
}
|
||||
} else {
|
||||
for (final Player p : tgtPlayers) {
|
||||
cards.addAll(p.getCardsIn(origin));
|
||||
}
|
||||
if (origin.contains(ZoneType.Library) && sa.hasParam("Search")) {
|
||||
// Search library using changezoneall effect need a param "Search"
|
||||
if (sa.getActivatingPlayer().hasKeyword("LimitSearchLibrary")) {
|
||||
for (final Player p : tgtPlayers) {
|
||||
cards.addAll(p.getCardsIn(origin));
|
||||
cards.removeAll(p.getCardsIn(ZoneType.Library));
|
||||
int fetchNum = Math.min(p.getCardsIn(ZoneType.Library).size(), 4);
|
||||
cards.addAll(p.getCardsIn(ZoneType.Library, fetchNum));
|
||||
}
|
||||
}
|
||||
if (sa.getActivatingPlayer().hasKeyword("CantSearchLibrary")) {
|
||||
// all these cards have "then that player shuffles", mandatory shuffle
|
||||
cards.removeAll(game.getCardsIn(ZoneType.Library));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (origin.contains(ZoneType.Library) && sa.hasParam("Search") && !sa.getActivatingPlayer().hasKeyword("CantSearchLibrary")) {
|
||||
|
||||
Reference in New Issue
Block a user