mirror of
https://github.com/correl/mage.git
synced 2024-12-25 11:11:16 +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
|
||||
controller.moveCardsToExile(card, source, game, true, exileId, sourceObject.getIdName());
|
||||
// player gains life
|
||||
int cmc = card.getConvertedManaCost();
|
||||
if (cmc > 0) {
|
||||
controller.gainLife(cmc, game, source);
|
||||
}
|
||||
controller.gainLife(card.getConvertedManaCost(), game, source);
|
||||
// Add effects only if the card has a spellAbility (e.g. not for lands).
|
||||
if (card.getSpellAbility() != null) {
|
||||
// allow to cast the card
|
||||
|
|
|
@ -1,15 +1,9 @@
|
|||
|
||||
package mage.cards.r;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageObject;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.cards.Cards;
|
||||
import mage.cards.CardsImpl;
|
||||
import mage.cards.*;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Zone;
|
||||
|
@ -18,14 +12,15 @@ import mage.game.Game;
|
|||
import mage.players.Player;
|
||||
import mage.target.TargetCard;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public final class RevivingVapors extends CardImpl {
|
||||
|
||||
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.
|
||||
this.getSpellAbility().addEffect(new RevivingVaporsEffect());
|
||||
|
@ -62,12 +57,14 @@ class RevivingVaporsEffect extends OneShotEffect {
|
|||
|
||||
Cards cards = new CardsImpl(controller.getLibrary().getTopCards(game, 3));
|
||||
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);
|
||||
Card card = null;
|
||||
if (cards.size() == 1) {
|
||||
card = cards.getRandom(game);
|
||||
} else {
|
||||
TargetCard target = new TargetCard(Zone.LIBRARY, new FilterCard("card to put into your hand"));
|
||||
target.setNotTarget(true);
|
||||
target.setRequired(true);
|
||||
if (controller.choose(Outcome.DrawCard, cards, target, game)) {
|
||||
card = cards.get(target.getFirstTarget(), game);
|
||||
|
@ -76,7 +73,12 @@ class RevivingVaporsEffect extends OneShotEffect {
|
|||
if (card != null) {
|
||||
cards.remove(card);
|
||||
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);
|
||||
}
|
||||
return true;
|
||||
|
|
Loading…
Reference in a new issue