* Blood Speaker - fixed that it able to search library after sacrificed/countered by another spell (#5833);

This commit is contained in:
Oleg Agafonov 2019-06-07 19:46:55 +04:00
parent 2f09af3ea9
commit 40ce1201f6

View file

@ -1,14 +1,12 @@
package mage.cards.b;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
import mage.abilities.common.EntersBattlefieldAllTriggeredAbility;
import mage.abilities.costs.common.SacrificeSourceCost;
import mage.abilities.effects.common.DoIfCostPaid;
import mage.abilities.effects.common.ReturnSourceFromGraveyardToHandEffect;
import mage.abilities.effects.common.SacrificeSourceEffect;
import mage.abilities.effects.common.search.SearchLibraryPutInHandEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
@ -21,36 +19,43 @@ import mage.filter.common.FilterControlledCreaturePermanent;
import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.target.common.TargetCardInLibrary;
import java.util.UUID;
/**
*
* @author LevelX2
*/
public final class BloodSpeaker extends CardImpl {
private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("a Demon under your control");
private static final FilterCard filterCard = new FilterCard("Demon card");
private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("a Demon under your control");
private static final FilterCard filterCard = new FilterCard("Demon card");
static {
filter.add(new SubtypePredicate(SubType.DEMON));
filterCard.add(new SubtypePredicate(SubType.DEMON));
}
public BloodSpeaker (UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{B}");
public BloodSpeaker(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{B}");
this.subtype.add(SubType.OGRE, SubType.SHAMAN);
this.power = new MageInt(3);
this.toughness = new MageInt(2);
// At the beginning of your upkeep, you may sacrifice Blood Speaker. If you do, search your library for a Demon card, reveal that card, and put it into your hand. Then shuffle your library.
Ability ability = new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD, new SacrificeSourceEffect(), TargetController.YOU, true);
ability.addEffect(new SearchLibraryPutInHandEffect(new TargetCardInLibrary(filterCard), true, true, "If you do, search your library for "));
Ability ability = new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD,
new DoIfCostPaid(
new SearchLibraryPutInHandEffect(new TargetCardInLibrary(filterCard), true, true, "search your library for "),
new SacrificeSourceCost()
),
TargetController.YOU,
false);
this.addAbility(ability);
// Whenever a Demon enters the battlefield under your control, return Blood Speaker from your graveyard to your hand.
this.addAbility(new EntersBattlefieldAllTriggeredAbility(Zone.GRAVEYARD, new ReturnSourceFromGraveyardToHandEffect(), filter, false));
}
public BloodSpeaker (final BloodSpeaker card) {
public BloodSpeaker(final BloodSpeaker card) {
super(card);
}