mirror of
https://github.com/magefree/mage.git
synced 2025-12-28 22:42:03 -08:00
[C15] Added Deadly Tempest and Dread Summons.
This commit is contained in:
parent
581e5bee4c
commit
dcf3ac87f1
5 changed files with 235 additions and 18 deletions
|
|
@ -25,7 +25,6 @@
|
|||
* authors and should not be interpreted as representing official policies, either expressed
|
||||
* or implied, of BetaSteward_at_googlemail.com.
|
||||
*/
|
||||
|
||||
package mage.abilities.effects.common;
|
||||
|
||||
import java.util.UUID;
|
||||
|
|
@ -44,7 +43,6 @@ import mage.util.CardUtil;
|
|||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
|
||||
public class PutTopCardOfLibraryIntoGraveEachPlayerEffect extends OneShotEffect {
|
||||
|
||||
private final DynamicValue numberCards;
|
||||
|
|
@ -53,7 +51,7 @@ public class PutTopCardOfLibraryIntoGraveEachPlayerEffect extends OneShotEffect
|
|||
public PutTopCardOfLibraryIntoGraveEachPlayerEffect(int numberCards, TargetController targetController) {
|
||||
this(new StaticValue(numberCards), targetController);
|
||||
}
|
||||
|
||||
|
||||
public PutTopCardOfLibraryIntoGraveEachPlayerEffect(DynamicValue numberCards, TargetController targetController) {
|
||||
super(Outcome.Discard);
|
||||
this.numberCards = numberCards;
|
||||
|
|
@ -76,42 +74,42 @@ public class PutTopCardOfLibraryIntoGraveEachPlayerEffect extends OneShotEffect
|
|||
public boolean apply(Game game, Ability source) {
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
if (player != null) {
|
||||
switch(targetController) {
|
||||
switch (targetController) {
|
||||
case OPPONENT:
|
||||
for(UUID playerId: game.getOpponents(source.getControllerId()) ) {
|
||||
for (UUID playerId : game.getOpponents(source.getControllerId())) {
|
||||
putCardsToGravecard(playerId, source, game);
|
||||
}
|
||||
break;
|
||||
case ANY:
|
||||
for(UUID playerId: player.getInRange() ) {
|
||||
for (UUID playerId : game.getState().getPlayersInRange(source.getControllerId(), game)) {
|
||||
putCardsToGravecard(playerId, source, game);
|
||||
}
|
||||
break;
|
||||
case NOT_YOU:
|
||||
for(UUID playerId: player.getInRange() ) {
|
||||
for (UUID playerId : game.getState().getPlayersInRange(source.getControllerId(), game)) {
|
||||
if (!playerId.equals(source.getSourceId())) {
|
||||
putCardsToGravecard(playerId, source, game);
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
throw new UnsupportedOperationException("TargetController type not supported.");
|
||||
}
|
||||
throw new UnsupportedOperationException("TargetController type not supported.");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
private void putCardsToGravecard(UUID playerId, Ability source, Game game) {
|
||||
Player player = game.getPlayer(playerId);
|
||||
if (player != null) {
|
||||
player.moveCards(player.getLibrary().getTopCards(game, numberCards.calculate(game, source, this)), Zone.LIBRARY, Zone.GRAVEYARD, source, game);
|
||||
player.moveCards(player.getLibrary().getTopCards(game, numberCards.calculate(game, source, this)), Zone.GRAVEYARD, source, game);
|
||||
}
|
||||
}
|
||||
|
||||
private String setText() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
switch(targetController) {
|
||||
switch (targetController) {
|
||||
case OPPONENT:
|
||||
sb.append("Each opponent ");
|
||||
break;
|
||||
|
|
@ -120,14 +118,14 @@ public class PutTopCardOfLibraryIntoGraveEachPlayerEffect extends OneShotEffect
|
|||
break;
|
||||
case NOT_YOU:
|
||||
sb.append("Each other player ");
|
||||
break;
|
||||
break;
|
||||
default:
|
||||
throw new UnsupportedOperationException("TargetController type not supported.");
|
||||
throw new UnsupportedOperationException("TargetController type not supported.");
|
||||
}
|
||||
sb.append("puts the top ");
|
||||
sb.append(CardUtil.numberToText(numberCards.toString(),"a"));
|
||||
sb.append(CardUtil.numberToText(numberCards.toString(), "a"));
|
||||
sb.append(" card");
|
||||
sb.append(numberCards.toString().equals("1")?"":"s");
|
||||
sb.append(numberCards.toString().equals("1") ? "" : "s");
|
||||
sb.append(" of his or her library into his or her graveyard");
|
||||
return sb.toString();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ public class ZombieToken extends Token {
|
|||
final static private List<String> tokenImageSets = new ArrayList<>();
|
||||
|
||||
static {
|
||||
tokenImageSets.addAll(Arrays.asList("10E", "M10", "M11", "M12", "M13", "M14", "M15", "MBS", "ALA", "ISD", "C14", "CNS", "MMA", "BNG", "KTK", "DTK", "ORI"));
|
||||
tokenImageSets.addAll(Arrays.asList("10E", "M10", "M11", "M12", "M13", "M14", "M15", "MBS", "ALA", "ISD", "C14", "C15", "CNS", "MMA", "BNG", "KTK", "DTK", "ORI"));
|
||||
}
|
||||
|
||||
public ZombieToken() {
|
||||
|
|
|
|||
|
|
@ -3075,7 +3075,7 @@ public abstract class PlayerImpl implements Player, Serializable {
|
|||
case GRAVEYARD:
|
||||
fromZone = game.getState().getZone(cards.iterator().next().getId());
|
||||
successfulMovedCards = moveCardsToGraveyardWithInfo(cards, source, game, fromZone);
|
||||
break;
|
||||
return successfulMovedCards.size() > 0;
|
||||
case BATTLEFIELD: // new logic that does not yet add the permanents to battlefield while replacement effects are handled
|
||||
List<Permanent> permanents = new ArrayList<>();
|
||||
List<Permanent> permanentsEntered = new ArrayList<>();
|
||||
|
|
@ -3285,6 +3285,7 @@ public abstract class PlayerImpl implements Player, Serializable {
|
|||
}
|
||||
}
|
||||
}
|
||||
game.fireEvent(new ZoneChangeGroupEvent(movedCards, source == null ? null : source.getSourceId(), this.getId(), fromZone, Zone.GRAVEYARD));
|
||||
return movedCards;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue