forked from External/mage
[MKM] Implement Person of Interest
This commit is contained in:
parent
291f88b1f6
commit
1f3d184ead
3 changed files with 80 additions and 0 deletions
|
|
@ -0,0 +1,36 @@
|
|||
package mage.abilities.effects.common;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.constants.Outcome;
|
||||
import mage.game.Game;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public class SuspectSourceEffect extends OneShotEffect {
|
||||
|
||||
public SuspectSourceEffect() {
|
||||
super(Outcome.Benefit);
|
||||
staticText = "suspect it";
|
||||
}
|
||||
|
||||
private SuspectSourceEffect(final SuspectSourceEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SuspectSourceEffect copy() {
|
||||
return new SuspectSourceEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Optional.ofNullable(source.getSourcePermanentIfItStillExists(game))
|
||||
.ifPresent(permanent -> permanent.setSuspected(true, game, source));
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue