mirror of
https://github.com/magefree/mage.git
synced 2026-01-09 12:22:10 -08:00
Fix SacrificedArtifactThisTurnCondition
This commit is contained in:
parent
a9e4d9b471
commit
c4668476b1
1 changed files with 10 additions and 5 deletions
|
|
@ -7,6 +7,10 @@ import mage.abilities.hint.Hint;
|
|||
import mage.game.Game;
|
||||
import mage.watchers.common.PermanentsSacrificedWatcher;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
|
|
@ -20,11 +24,12 @@ public enum SacrificedArtifactThisTurnCondition implements Condition {
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
return game
|
||||
.getState()
|
||||
.getWatcher(PermanentsSacrificedWatcher.class)
|
||||
.getThisTurnSacrificedPermanents(source.getControllerId())
|
||||
.stream()
|
||||
return Optional.ofNullable(game
|
||||
.getState()
|
||||
.getWatcher(PermanentsSacrificedWatcher.class)
|
||||
.getThisTurnSacrificedPermanents(source.getControllerId()))
|
||||
.map(List::stream)
|
||||
.orElseGet(Stream::empty)
|
||||
.anyMatch(permanent -> permanent.isArtifact(game));
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue