mirror of
https://github.com/correl/mage.git
synced 2024-12-28 11:14:13 +00:00
[VOW] Implemented Consuming Tide
This commit is contained in:
parent
d97d15edc9
commit
a16f247611
2 changed files with 99 additions and 0 deletions
98
Mage.Sets/src/mage/cards/c/ConsumingTide.java
Normal file
98
Mage.Sets/src/mage/cards/c/ConsumingTide.java
Normal file
|
@ -0,0 +1,98 @@
|
|||
package mage.cards.c;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.UUID;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.players.Player;
|
||||
import mage.target.common.TargetNonlandPermanent;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author weirddan455
|
||||
*/
|
||||
public final class ConsumingTide extends CardImpl {
|
||||
|
||||
public ConsumingTide(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{2}{U}{U}");
|
||||
|
||||
// Each player chooses a nonland permanent they control. Return all nonland permanents not chosen this way to their owners' hands.
|
||||
// Then you draw a card for each opponent who has more cards in their hand than you.
|
||||
this.getSpellAbility().addEffect(new ConsumingTideEffect());
|
||||
}
|
||||
|
||||
private ConsumingTide(final ConsumingTide card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ConsumingTide copy() {
|
||||
return new ConsumingTide(this);
|
||||
}
|
||||
}
|
||||
|
||||
class ConsumingTideEffect extends OneShotEffect {
|
||||
|
||||
public ConsumingTideEffect() {
|
||||
super(Outcome.ReturnToHand);
|
||||
staticText = "Each player chooses a nonland permanent they control. Return all nonland permanents not chosen this way to their owners' hands. "
|
||||
+ "Then you draw a card for each opponent who has more cards in their hand than you";
|
||||
}
|
||||
|
||||
private ConsumingTideEffect(final ConsumingTideEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ConsumingTideEffect copy() {
|
||||
return new ConsumingTideEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller == null) {
|
||||
return false;
|
||||
}
|
||||
HashSet<UUID> chosenPermanents = new HashSet<>();
|
||||
for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) {
|
||||
Player player = game.getPlayer(playerId);
|
||||
if (player != null) {
|
||||
TargetNonlandPermanent target = new TargetNonlandPermanent();
|
||||
target.setNotTarget(true);
|
||||
player.choose(Outcome.Benefit, target, source.getSourceId(), game);
|
||||
UUID permId = target.getFirstTarget();
|
||||
if (permId != null) {
|
||||
chosenPermanents.add(permId);
|
||||
}
|
||||
}
|
||||
}
|
||||
HashSet<Card> permanentsToHand = new HashSet<>();
|
||||
for (Permanent permanent : game.getBattlefield().getActivePermanents(StaticFilters.FILTER_PERMANENT_NON_LAND, controller.getId(), source.getSourceId(), game)) {
|
||||
if (!chosenPermanents.contains(permanent.getId())) {
|
||||
permanentsToHand.add(permanent);
|
||||
}
|
||||
}
|
||||
controller.moveCards(permanentsToHand, Zone.HAND, source, game);
|
||||
int controllerHandSize = controller.getHand().size();
|
||||
int cardsToDraw = 0;
|
||||
for (UUID opponentId : game.getOpponents(controller.getId())) {
|
||||
Player opponent = game.getPlayer(opponentId);
|
||||
if (opponent != null && opponent.getHand().size() > controllerHandSize) {
|
||||
cardsToDraw++;
|
||||
}
|
||||
}
|
||||
controller.drawCards(cardsToDraw, source, game);
|
||||
return true;
|
||||
}
|
||||
}
|
|
@ -51,6 +51,7 @@ public final class InnistradCrimsonVow extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Change of Fortune", 150, Rarity.RARE, mage.cards.c.ChangeOfFortune.class));
|
||||
cards.add(new SetCardInfo("Clever Distraction", 9, Rarity.UNCOMMON, mage.cards.c.CleverDistraction.class));
|
||||
cards.add(new SetCardInfo("Cloaked Cadet", 192, Rarity.UNCOMMON, mage.cards.c.CloakedCadet.class));
|
||||
cards.add(new SetCardInfo("Consuming Tide", 53, Rarity.RARE, mage.cards.c.ConsumingTide.class));
|
||||
cards.add(new SetCardInfo("Dawnhart Geist", 8, Rarity.UNCOMMON, mage.cards.d.DawnhartGeist.class));
|
||||
cards.add(new SetCardInfo("Deathcap Glade", 261, Rarity.RARE, mage.cards.d.DeathcapGlade.class));
|
||||
cards.add(new SetCardInfo("Demonic Bargain", 103, Rarity.RARE, mage.cards.d.DemonicBargain.class));
|
||||
|
|
Loading…
Reference in a new issue