[MH2] Implemented Vile Entomber

This commit is contained in:
Evan Kranzler 2021-06-03 08:44:01 -04:00
parent d4eb9f5c92
commit 798b578125
5 changed files with 94 additions and 82 deletions

View file

@ -0,0 +1,44 @@
package mage.abilities.effects.common.search;
import mage.abilities.Ability;
import mage.abilities.effects.SearchEffect;
import mage.constants.Outcome;
import mage.constants.Zone;
import mage.filter.StaticFilters;
import mage.game.Game;
import mage.players.Player;
import mage.target.common.TargetCardInLibrary;
/**
* @author TheElk801
*/
public class SearchLibraryPutInGraveyardEffect extends SearchEffect {
public SearchLibraryPutInGraveyardEffect() {
super(new TargetCardInLibrary(StaticFilters.FILTER_CARD), Outcome.Neutral);
staticText = "search your library for a card, put that card into your graveyard, then shuffle";
}
public SearchLibraryPutInGraveyardEffect(final SearchLibraryPutInGraveyardEffect effect) {
super(effect);
}
@Override
public SearchLibraryPutInGraveyardEffect copy() {
return new SearchLibraryPutInGraveyardEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
if (controller == null) {
return false;
}
if (controller.searchLibrary(target, source, game)) {
controller.moveCards(game.getCard(target.getFirstTarget()), Zone.GRAVEYARD, source, game);
}
controller.shuffleLibrary(source, game);
return true;
}
}