- Added Ashiok, Dream Render.

This commit is contained in:
Agetian
2019-05-14 08:38:24 +03:00
parent 5eb56e0d0e
commit 72d623784a
4 changed files with 26 additions and 1 deletions

View File

@@ -48,6 +48,11 @@ public class ChangeZoneAllEffect extends SpellAbilityEffect {
cards = new CardCollection(); cards = new CardCollection();
for (final Player p : tgtPlayers) { for (final Player p : tgtPlayers) {
cards.addAll(p.getCardsIn(origin)); cards.addAll(p.getCardsIn(origin));
if (origin.contains(ZoneType.Library) && sa.hasParam("Search") && !sa.getActivatingPlayer().canSearchOwnLibraryWith(sa, p)) {
cards.removeAll(p.getCardsIn(ZoneType.Library));
}
} }
if (origin.contains(ZoneType.Library) && sa.hasParam("Search")) { if (origin.contains(ZoneType.Library) && sa.hasParam("Search")) {
// Search library using changezoneall effect need a param "Search" // Search library using changezoneall effect need a param "Search"

View File

@@ -767,7 +767,7 @@ public class ChangeZoneEffect extends SpellAbilityEffect {
fetchList.addAll(player.getCardsIn(ZoneType.Library, fetchNum)); fetchList.addAll(player.getCardsIn(ZoneType.Library, fetchNum));
} }
} }
if (decider.hasKeyword("CantSearchLibrary")) { if (decider.hasKeyword("CantSearchLibrary") || !decider.canSearchOwnLibraryWith(sa, player)) {
fetchList.removeAll(player.getCardsIn(ZoneType.Library)); fetchList.removeAll(player.getCardsIn(ZoneType.Library));
// "if you do/sb does, shuffle" is not mandatory (usually a triggered ability), should has this param. // "if you do/sb does, shuffle" is not mandatory (usually a triggered ability), should has this param.
// "then shuffle" is mandatory // "then shuffle" is mandatory

View File

@@ -2965,4 +2965,16 @@ public class Player extends GameEntity implements Comparable<Player> {
return true; return true;
} }
public boolean canSearchOwnLibraryWith(SpellAbility sa, Player targetPlayer) {
if (sa == null) {
return true;
}
if (targetPlayer.equals(sa.getActivatingPlayer()) && hasKeyword("Spells and abilities you control can't cause you to search your library.")) {
return false;
}
return true;
}
} }

View File

@@ -0,0 +1,8 @@
Name:Ashiok, Dream Render
ManaCost:1 UB UB
Types:Legendary Planeswalker Ashiok
Loyalty:5
S:Mode$ Continuous | Affected$ Opponent | AddKeyword$ Spells and abilities you control can't cause you to search your library. | Description$ Spells and abilities your opponents control can't cause their controller to search their library.
A:AB$ Mill | Cost$ SubCounter<1/LOYALTY> | Planeswalker$ True | NumCards$ 4 | ValidTgts$ Player | TgtPrompt$ Choose a player | SubAbility$ DBExileGrave | SpellDescription$ Target player puts the top four cards of their library into their graveyard. Then exile each opponent's graveyard.
SVar:DBExileGrave:DB$ ChangeZoneAll | Origin$ Graveyard | Destination$ Exile | Defined$ Opponent | ChangeType$ Card
Oracle:Spells and abilities your opponents control can't cause their controller to search their library.\n[-1]: Target player puts the top four cards of their library into their graveyard. Then exile each opponent's graveyard.