mirror of
https://github.com/correl/mage.git
synced 2024-12-27 03:00:13 +00:00
* Highcliff Felidar - Fixed a problem that not always all players were handled (fixes #6826).
This commit is contained in:
parent
0824d2901a
commit
8f2c08efd3
1 changed files with 15 additions and 17 deletions
|
@ -60,8 +60,8 @@ class HighcliffFelidarEffect extends OneShotEffect {
|
|||
|
||||
HighcliffFelidarEffect() {
|
||||
super(Outcome.Benefit);
|
||||
staticText = "for each opponent, choose a creature with the greatest power " +
|
||||
"among creatures that player controls. Destroy those creatures.";
|
||||
staticText = "for each opponent, choose a creature with the greatest power "
|
||||
+ "among creatures that player controls. Destroy those creatures.";
|
||||
}
|
||||
|
||||
private HighcliffFelidarEffect(final HighcliffFelidarEffect effect) {
|
||||
|
@ -75,8 +75,8 @@ class HighcliffFelidarEffect extends OneShotEffect {
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
if (player == null) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller == null) {
|
||||
return false;
|
||||
}
|
||||
Set<UUID> toDestroy = new HashSet();
|
||||
|
@ -93,18 +93,17 @@ class HighcliffFelidarEffect extends OneShotEffect {
|
|||
.mapToInt(MageInt::getValue)
|
||||
.max()
|
||||
.orElse(Integer.MIN_VALUE);
|
||||
if (maxPower == Integer.MIN_VALUE) {
|
||||
return;
|
||||
}
|
||||
FilterPermanent filter = new FilterCreaturePermanent(
|
||||
"creature with the greatest power controlled by " + opponent.getName()
|
||||
);
|
||||
filter.add(new ControllerIdPredicate(opponent.getId()));
|
||||
filter.add(new PowerPredicate(ComparisonType.EQUAL_TO, maxPower));
|
||||
TargetPermanent target = new TargetPermanent(filter);
|
||||
target.setNotTarget(true);
|
||||
if (player.choose(outcome, target, source.getSourceId(), game)) {
|
||||
toDestroy.add(target.getFirstTarget());
|
||||
if (maxPower > Integer.MIN_VALUE) {
|
||||
FilterPermanent filter = new FilterCreaturePermanent(
|
||||
"creature with the greatest power controlled by " + opponent.getName()
|
||||
);
|
||||
filter.add(new ControllerIdPredicate(opponent.getId()));
|
||||
filter.add(new PowerPredicate(ComparisonType.EQUAL_TO, maxPower));
|
||||
TargetPermanent target = new TargetPermanent(filter);
|
||||
target.setNotTarget(true);
|
||||
if (controller.choose(outcome, target, source.getSourceId(), game)) {
|
||||
toDestroy.add(target.getFirstTarget());
|
||||
}
|
||||
}
|
||||
});
|
||||
toDestroy.stream()
|
||||
|
@ -116,7 +115,6 @@ class HighcliffFelidarEffect extends OneShotEffect {
|
|||
}
|
||||
|
||||
// I realized after writing all this that the ability doesn't target but I like this code too much to erase it
|
||||
|
||||
//enum HighcliffFelidarAdjuster implements TargetAdjuster {
|
||||
// instance;
|
||||
//
|
||||
|
|
Loading…
Reference in a new issue