mirror of
https://github.com/correl/mage.git
synced 2024-11-29 03:00:12 +00:00
- Fixed #6192
This commit is contained in:
parent
ef224fe15c
commit
e91b0a01d2
1 changed files with 17 additions and 10 deletions
|
@ -18,6 +18,8 @@ import mage.players.Player;
|
||||||
import mage.target.common.TargetCardInYourGraveyard;
|
import mage.target.common.TargetCardInYourGraveyard;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
import mage.cards.Cards;
|
||||||
|
import mage.constants.Zone;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author TheElk801
|
* @author TheElk801
|
||||||
|
@ -34,7 +36,9 @@ public final class LagonnaBandStoryteller extends CardImpl {
|
||||||
this.power = new MageInt(3);
|
this.power = new MageInt(3);
|
||||||
this.toughness = new MageInt(4);
|
this.toughness = new MageInt(4);
|
||||||
|
|
||||||
// When Lagonna-Band Storyteller enters the battlefield, you may put target enchantment card from your graveyard on top of your library. If you do, you gain life equal to its converted mana cost.
|
// When Lagonna-Band Storyteller enters the battlefield, you may put target
|
||||||
|
// enchantment card from your graveyard on top of your library.
|
||||||
|
// If you do, you gain life equal to its converted mana cost.
|
||||||
Ability ability = new EntersBattlefieldTriggeredAbility(new LagonnaBandStorytellerEffect(), true);
|
Ability ability = new EntersBattlefieldTriggeredAbility(new LagonnaBandStorytellerEffect(), true);
|
||||||
ability.addTarget(new TargetCardInYourGraveyard(filter));
|
ability.addTarget(new TargetCardInYourGraveyard(filter));
|
||||||
this.addAbility(ability);
|
this.addAbility(ability);
|
||||||
|
@ -54,8 +58,8 @@ class LagonnaBandStorytellerEffect extends OneShotEffect {
|
||||||
|
|
||||||
LagonnaBandStorytellerEffect() {
|
LagonnaBandStorytellerEffect() {
|
||||||
super(Outcome.Benefit);
|
super(Outcome.Benefit);
|
||||||
staticText = "put target enchantment card from your graveyard on top of your library. " +
|
staticText = "put target enchantment card from your graveyard on top of your library. "
|
||||||
"If you do, you gain life equal to its converted mana cost.";
|
+ "If you do, you gain life equal to its converted mana cost.";
|
||||||
}
|
}
|
||||||
|
|
||||||
private LagonnaBandStorytellerEffect(final LagonnaBandStorytellerEffect effect) {
|
private LagonnaBandStorytellerEffect(final LagonnaBandStorytellerEffect effect) {
|
||||||
|
@ -69,16 +73,19 @@ class LagonnaBandStorytellerEffect extends OneShotEffect {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(Game game, Ability source) {
|
public boolean apply(Game game, Ability source) {
|
||||||
Player player = game.getPlayer(source.getSourceId());
|
Player controller = game.getPlayer(source.getControllerId());
|
||||||
Card card = game.getCard(source.getFirstTarget());
|
Card card = game.getCard(source.getFirstTarget());
|
||||||
if (player == null || card == null) {
|
if (controller == null
|
||||||
|
|| card == null
|
||||||
|
|| !card.isEnchantment()
|
||||||
|
|| game.getState().getZone(card.getId()) != Zone.GRAVEYARD) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
int cmc = card.getConvertedManaCost();
|
int cmc = card.getConvertedManaCost();
|
||||||
if (!player.putCardsOnTopOfLibrary(new CardsImpl(card), game, source, false)) {
|
if (controller.putCardsOnTopOfLibrary(new CardsImpl(card), game, source, false)) {
|
||||||
return false;
|
controller.gainLife(cmc, game, source);
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
player.gainLife(cmc, game, source);
|
return false;
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in a new issue