mirror of
https://github.com/magefree/mage.git
synced 2025-12-26 13:32:06 -08:00
[MH2] Implemented Vile Entomber
This commit is contained in:
parent
d4eb9f5c92
commit
798b578125
5 changed files with 94 additions and 82 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue