mirror of
https://github.com/magefree/mage.git
synced 2025-12-24 04:22:01 -08:00
[YDMU] Implement Marwyn's Kindred & Wandering Treefolk (#12625)
This commit is contained in:
parent
4a041aa89c
commit
3321cd03bc
5 changed files with 174 additions and 1 deletions
|
|
@ -0,0 +1,46 @@
|
|||
package mage.abilities.effects.common;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.constants.Outcome;
|
||||
import mage.filter.FilterCard;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
|
||||
/**
|
||||
* @author karapuzz14
|
||||
*/
|
||||
public class SeekCardEffect extends OneShotEffect {
|
||||
private final FilterCard filter;
|
||||
|
||||
/**
|
||||
* @param filter for selecting a card
|
||||
*/
|
||||
public SeekCardEffect(FilterCard filter) {
|
||||
super(Outcome.Benefit);
|
||||
this.filter = filter;
|
||||
this.staticText = "seek a " + filter.getMessage();
|
||||
}
|
||||
|
||||
private SeekCardEffect(final SeekCardEffect effect) {
|
||||
super(effect);
|
||||
this.filter = effect.filter;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SeekCardEffect copy() {
|
||||
return new SeekCardEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
|
||||
if (controller != null) {
|
||||
return controller.seekCard(filter, source, game);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue