mirror of
https://github.com/correl/mage.git
synced 2024-11-15 11:09:30 +00:00
* Slaughter The Strong - fixed AI freeze the game (#5023);
This commit is contained in:
parent
c9f216889b
commit
c6786d26bf
1 changed files with 17 additions and 5 deletions
|
@ -1,9 +1,6 @@
|
|||
|
||||
package mage.cards.s;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.cards.CardImpl;
|
||||
|
@ -22,8 +19,11 @@ import mage.players.Player;
|
|||
import mage.target.Target;
|
||||
import mage.target.TargetPermanent;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public final class SlaughterTheStrong extends CardImpl {
|
||||
|
@ -90,7 +90,19 @@ class SlaughterTheStrongEffect extends OneShotEffect {
|
|||
} else {
|
||||
currentFilter.add(new PowerPredicate(ComparisonType.FEWER_THAN, 5 - powerSum));
|
||||
}
|
||||
Target target = new TargetPermanent(0, 1, currentFilter, true);
|
||||
|
||||
// human can de-select targets, but AI must choose only one time
|
||||
Target target;
|
||||
if (player.isHuman()) {
|
||||
target = new TargetPermanent(0, 1, currentFilter, true);
|
||||
} else {
|
||||
FilterControlledCreaturePermanent strictFilter = currentFilter.copy();
|
||||
selectedCreatures.stream().forEach(id -> {
|
||||
strictFilter.add(Predicates.not(new PermanentIdPredicate(id)));
|
||||
});
|
||||
target = new TargetPermanent(0, 1, strictFilter, true);
|
||||
}
|
||||
|
||||
player.chooseTarget(Outcome.BoostCreature, target, source, game);
|
||||
if (target.getFirstTarget() != null) {
|
||||
if (selectedCreatures.contains(target.getFirstTarget())) {
|
||||
|
|
Loading…
Reference in a new issue