mirror of
https://github.com/magefree/mage.git
synced 2025-12-24 20:41:58 -08:00
[MKM] Implement Furtive Courier
This commit is contained in:
parent
c362e51af3
commit
bd0e9ef110
3 changed files with 80 additions and 0 deletions
|
|
@ -0,0 +1,30 @@
|
|||
package mage.abilities.condition.common;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.condition.Condition;
|
||||
import mage.abilities.hint.ConditionHint;
|
||||
import mage.abilities.hint.Hint;
|
||||
import mage.game.Game;
|
||||
import mage.watchers.common.PermanentsSacrificedWatcher;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public enum SacrificedArtifactThisTurnCondition implements Condition {
|
||||
instance;
|
||||
private static final Hint hint = new ConditionHint(instance, "You sacrificed an artifact this turn");
|
||||
|
||||
public static Hint getHint() {
|
||||
return hint;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
return game
|
||||
.getState()
|
||||
.getWatcher(PermanentsSacrificedWatcher.class)
|
||||
.getThisTurnSacrificedPermanents(source.getControllerId())
|
||||
.stream()
|
||||
.anyMatch(permanent -> permanent.isArtifact(game));
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue