mirror of
https://github.com/correl/mage.git
synced 2024-12-26 11:09:27 +00:00
* Reviving Vapors - fixed missing gain life part of the effect (#7205);
This commit is contained in:
parent
513609b12a
commit
4d50dfd475
2 changed files with 12 additions and 13 deletions
|
@ -85,10 +85,7 @@ class DaxosOfMeletisEffect extends OneShotEffect {
|
||||||
// move card to exile
|
// move card to exile
|
||||||
controller.moveCardsToExile(card, source, game, true, exileId, sourceObject.getIdName());
|
controller.moveCardsToExile(card, source, game, true, exileId, sourceObject.getIdName());
|
||||||
// player gains life
|
// player gains life
|
||||||
int cmc = card.getConvertedManaCost();
|
controller.gainLife(card.getConvertedManaCost(), game, source);
|
||||||
if (cmc > 0) {
|
|
||||||
controller.gainLife(cmc, game, source);
|
|
||||||
}
|
|
||||||
// Add effects only if the card has a spellAbility (e.g. not for lands).
|
// Add effects only if the card has a spellAbility (e.g. not for lands).
|
||||||
if (card.getSpellAbility() != null) {
|
if (card.getSpellAbility() != null) {
|
||||||
// allow to cast the card
|
// allow to cast the card
|
||||||
|
|
|
@ -1,15 +1,9 @@
|
||||||
|
|
||||||
package mage.cards.r;
|
package mage.cards.r;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.MageObject;
|
import mage.MageObject;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.effects.OneShotEffect;
|
import mage.abilities.effects.OneShotEffect;
|
||||||
import mage.cards.Card;
|
import mage.cards.*;
|
||||||
import mage.cards.CardImpl;
|
|
||||||
import mage.cards.CardSetInfo;
|
|
||||||
import mage.cards.Cards;
|
|
||||||
import mage.cards.CardsImpl;
|
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.constants.Outcome;
|
import mage.constants.Outcome;
|
||||||
import mage.constants.Zone;
|
import mage.constants.Zone;
|
||||||
|
@ -18,14 +12,15 @@ import mage.game.Game;
|
||||||
import mage.players.Player;
|
import mage.players.Player;
|
||||||
import mage.target.TargetCard;
|
import mage.target.TargetCard;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author LevelX2
|
* @author LevelX2
|
||||||
*/
|
*/
|
||||||
public final class RevivingVapors extends CardImpl {
|
public final class RevivingVapors extends CardImpl {
|
||||||
|
|
||||||
public RevivingVapors(UUID ownerId, CardSetInfo setInfo) {
|
public RevivingVapors(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{2}{W}{U}");
|
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{2}{W}{U}");
|
||||||
|
|
||||||
// Reveal the top three cards of your library and put one of them into your hand. You gain life equal to that card's converted mana cost. Put all other cards revealed this way into your graveyard.
|
// Reveal the top three cards of your library and put one of them into your hand. You gain life equal to that card's converted mana cost. Put all other cards revealed this way into your graveyard.
|
||||||
this.getSpellAbility().addEffect(new RevivingVaporsEffect());
|
this.getSpellAbility().addEffect(new RevivingVaporsEffect());
|
||||||
|
@ -62,12 +57,14 @@ class RevivingVaporsEffect extends OneShotEffect {
|
||||||
|
|
||||||
Cards cards = new CardsImpl(controller.getLibrary().getTopCards(game, 3));
|
Cards cards = new CardsImpl(controller.getLibrary().getTopCards(game, 3));
|
||||||
if (!cards.isEmpty()) {
|
if (!cards.isEmpty()) {
|
||||||
|
// Reveal the top three cards of your library and put one of them into your hand
|
||||||
controller.revealCards(sourceObject.getName(), cards, game);
|
controller.revealCards(sourceObject.getName(), cards, game);
|
||||||
Card card = null;
|
Card card = null;
|
||||||
if (cards.size() == 1) {
|
if (cards.size() == 1) {
|
||||||
card = cards.getRandom(game);
|
card = cards.getRandom(game);
|
||||||
} else {
|
} else {
|
||||||
TargetCard target = new TargetCard(Zone.LIBRARY, new FilterCard("card to put into your hand"));
|
TargetCard target = new TargetCard(Zone.LIBRARY, new FilterCard("card to put into your hand"));
|
||||||
|
target.setNotTarget(true);
|
||||||
target.setRequired(true);
|
target.setRequired(true);
|
||||||
if (controller.choose(Outcome.DrawCard, cards, target, game)) {
|
if (controller.choose(Outcome.DrawCard, cards, target, game)) {
|
||||||
card = cards.get(target.getFirstTarget(), game);
|
card = cards.get(target.getFirstTarget(), game);
|
||||||
|
@ -76,7 +73,12 @@ class RevivingVaporsEffect extends OneShotEffect {
|
||||||
if (card != null) {
|
if (card != null) {
|
||||||
cards.remove(card);
|
cards.remove(card);
|
||||||
controller.moveCards(card, Zone.HAND, source, game);
|
controller.moveCards(card, Zone.HAND, source, game);
|
||||||
|
|
||||||
|
// You gain life equal to that card's converted mana cost
|
||||||
|
controller.gainLife(card.getConvertedManaCost(), game, source);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Put all other cards revealed this way into your graveyard
|
||||||
controller.moveCards(cards, Zone.GRAVEYARD, source, game);
|
controller.moveCards(cards, Zone.GRAVEYARD, source, game);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Reference in a new issue