mirror of
https://github.com/magefree/mage.git
synced 2026-01-26 21:29:17 -08:00
- More fixes related to #6851
This commit is contained in:
parent
d8c9d10066
commit
ea72e3c8cb
5 changed files with 93 additions and 58 deletions
|
|
@ -1,6 +1,7 @@
|
|||
|
||||
package mage.cards.e;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
|
|
@ -21,7 +22,7 @@ import mage.players.Player;
|
|||
public final class EmptyTheCatacombs extends CardImpl {
|
||||
|
||||
public EmptyTheCatacombs(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{3}{B}");
|
||||
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{3}{B}");
|
||||
|
||||
// Each player returns all creature cards from their graveyard to their hand.
|
||||
this.getSpellAbility().addEffect(new EmptyTheCatacombsEffect());
|
||||
|
|
@ -57,14 +58,24 @@ class EmptyTheCatacombsEffect extends OneShotEffect {
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
for (UUID playerId : game.getState().getPlayersInRange(source.getControllerId(), game)) {
|
||||
Player player = game.getPlayer(playerId);
|
||||
if (player != null) {
|
||||
for (Card card : player.getGraveyard().getCards(filter, game)) {
|
||||
card.moveToZone(Zone.HAND, source.getSourceId(), game, true);
|
||||
Set<Card> toHand = new HashSet<>();
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller != null) {
|
||||
for (UUID playerId : game.getState().getPlayersInRange(source.getControllerId(), game)) {
|
||||
Player player = game.getPlayer(playerId);
|
||||
if (player != null) {
|
||||
for (Card card : player.getGraveyard().getCards(filter, game)) {
|
||||
if (card != null) {
|
||||
toHand.add(card);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// must happen simultaneously Rule 101.4
|
||||
controller.moveCards(toHand, Zone.HAND, source, game, false, false, true, null);
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
|
||||
package mage.cards.e;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
|
|
@ -65,29 +66,32 @@ class EnslavedHorrorEffect extends OneShotEffect {
|
|||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) {
|
||||
if (playerId.equals(controller.getId())) {
|
||||
continue;
|
||||
}
|
||||
Player player = game.getPlayer(playerId);
|
||||
if (player != null) {
|
||||
FilterCreatureCard filterCreatureCard = new FilterCreatureCard("creature card from your graveyard");
|
||||
filterCreatureCard.add(new OwnerIdPredicate(playerId));
|
||||
TargetCardInGraveyard target = new TargetCardInGraveyard(0, 1, filterCreatureCard);
|
||||
target.setNotTarget(true);
|
||||
if (target.canChoose(playerId, game)
|
||||
&& player.chooseTarget(outcome, target, source, game)) {
|
||||
Card card = game.getCard(target.getFirstTarget());
|
||||
if (card != null) {
|
||||
player.moveCards(card, Zone.BATTLEFIELD, source, game);
|
||||
Set<Card> toBattlefield = new HashSet<>();
|
||||
if (controller != null) {
|
||||
for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) {
|
||||
if (playerId.equals(controller.getId())) {
|
||||
continue;
|
||||
}
|
||||
Player player = game.getPlayer(playerId);
|
||||
if (player != null) {
|
||||
FilterCreatureCard filterCreatureCard = new FilterCreatureCard("creature card from your graveyard");
|
||||
filterCreatureCard.add(new OwnerIdPredicate(playerId));
|
||||
TargetCardInGraveyard target = new TargetCardInGraveyard(0, 1, filterCreatureCard);
|
||||
target.setNotTarget(true);
|
||||
if (target.canChoose(playerId, game)
|
||||
&& player.chooseTarget(outcome, target, source, game)) {
|
||||
Card card = game.getCard(target.getFirstTarget());
|
||||
if (card != null) {
|
||||
toBattlefield.add(card);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// must happen simultaneously Rule 101.4
|
||||
controller.moveCards(toBattlefield, Zone.BATTLEFIELD, source, game, false, false, true, null);
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
|
||||
package mage.cards.e;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
|
|
@ -23,7 +24,7 @@ import mage.target.common.TargetCardInGraveyard;
|
|||
public final class Exhume extends CardImpl {
|
||||
|
||||
public Exhume(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{1}{B}");
|
||||
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{1}{B}");
|
||||
|
||||
// Each player puts a creature card from their graveyard onto the battlefield.
|
||||
this.getSpellAbility().addEffect(new ExhumeEffect());
|
||||
|
|
@ -58,26 +59,29 @@ class ExhumeEffect extends OneShotEffect {
|
|||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) {
|
||||
Player player = game.getPlayer(playerId);
|
||||
if (player != null) {
|
||||
FilterCreatureCard filterCreatureCard = new FilterCreatureCard("creature card from your graveyard");
|
||||
filterCreatureCard.add(new OwnerIdPredicate(playerId));
|
||||
TargetCardInGraveyard target = new TargetCardInGraveyard(filterCreatureCard);
|
||||
target.setNotTarget(true);
|
||||
if (target.canChoose(playerId, game)
|
||||
&& player.chooseTarget(outcome, target, source, game)) {
|
||||
Card card = game.getCard(target.getFirstTarget());
|
||||
if (card != null) {
|
||||
player.moveCards(card, Zone.BATTLEFIELD, source, game);
|
||||
Set<Card> toBattlefield = new HashSet<>();
|
||||
if (controller != null) {
|
||||
for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) {
|
||||
Player player = game.getPlayer(playerId);
|
||||
if (player != null) {
|
||||
FilterCreatureCard filterCreatureCard = new FilterCreatureCard("creature card from your graveyard");
|
||||
filterCreatureCard.add(new OwnerIdPredicate(playerId));
|
||||
TargetCardInGraveyard target = new TargetCardInGraveyard(filterCreatureCard);
|
||||
target.setNotTarget(true);
|
||||
if (target.canChoose(playerId, game)
|
||||
&& player.chooseTarget(outcome, target, source, game)) {
|
||||
Card card = game.getCard(target.getFirstTarget());
|
||||
if (card != null) {
|
||||
toBattlefield.add(card);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// must happen simultaneously Rule 101.4
|
||||
controller.moveCards(toBattlefield, Zone.BATTLEFIELD, source, game, false, false, true, null);
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,11 +1,13 @@
|
|||
|
||||
package mage.cards.g;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.cards.CardsImpl;
|
||||
|
|
@ -29,7 +31,7 @@ import mage.target.common.TargetCardInYourGraveyard;
|
|||
public final class GraveSifter extends CardImpl {
|
||||
|
||||
public GraveSifter(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{5}{G}");
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{5}{G}");
|
||||
this.subtype.add(SubType.ELEMENTAL);
|
||||
this.subtype.add(SubType.BEAST);
|
||||
|
||||
|
|
@ -71,6 +73,7 @@ class GraveSifterEffect extends OneShotEffect {
|
|||
Choice typeChoice = new ChoiceCreatureType(game.getObject(source.getSourceId()));
|
||||
typeChoice.setMessage("Choose creature type to return cards from your graveyard");
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
Set<Card> toHand = new HashSet<>();
|
||||
if (controller != null) {
|
||||
for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) {
|
||||
Player player = game.getPlayer(playerId);
|
||||
|
|
@ -82,11 +85,14 @@ class GraveSifterEffect extends OneShotEffect {
|
|||
filter.add(SubType.byDescription(typeChoice.getChoice()).getPredicate());
|
||||
Target target = new TargetCardInYourGraveyard(0, Integer.MAX_VALUE, filter);
|
||||
player.chooseTarget(outcome, target, source, game);
|
||||
player.moveCards(new CardsImpl(target.getTargets()), Zone.HAND, source, game);
|
||||
toHand.addAll(new CardsImpl(target.getTargets()).getCards(game));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// must happen simultaneously Rule 101.4
|
||||
controller.moveCards(toHand, Zone.HAND, source, game, false, false, true, null);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -1,12 +1,14 @@
|
|||
|
||||
package mage.cards.t;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.PayMoreToCastAsThoughtItHadFlashAbility;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
|
|
@ -63,12 +65,20 @@ class TwilightsCallEffect extends OneShotEffect {
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
for (UUID playerId : game.getState().getPlayersInRange(source.getControllerId(), game)) {
|
||||
Player player = game.getPlayer(playerId);
|
||||
if (player != null) {
|
||||
player.moveCards(player.getGraveyard().getCards(StaticFilters.FILTER_CARD_CREATURE, game), Zone.BATTLEFIELD, source, game);
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
Set<Card> toBattlefield = new HashSet<>();
|
||||
if (controller != null) {
|
||||
for (UUID playerId : game.getState().getPlayersInRange(source.getControllerId(), game)) {
|
||||
Player player = game.getPlayer(playerId);
|
||||
if (player != null) {
|
||||
toBattlefield.addAll(player.getGraveyard().getCards(StaticFilters.FILTER_CARD_CREATURE, game));
|
||||
}
|
||||
}
|
||||
|
||||
// must happen simultaneously Rule 101.4
|
||||
controller.moveCards(toBattlefield, Zone.BATTLEFIELD, source, game, false, false, true, null);
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue