mirror of
https://github.com/correl/mage.git
synced 2025-01-13 19:11:33 +00:00
SacrificeAllTriggeredAbility bug fix. fixes #1736
This commit is contained in:
parent
91f74ced1f
commit
7261452413
1 changed files with 4 additions and 3 deletions
|
@ -48,21 +48,22 @@ public class SacrificeAllTriggeredAbility extends TriggeredAbilityImpl {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean checkTrigger(GameEvent event, Game game) {
|
public boolean checkTrigger(GameEvent event, Game game) {
|
||||||
|
boolean sacrificed = false;
|
||||||
switch (sacrificingPlayer) {
|
switch (sacrificingPlayer) {
|
||||||
case YOU:
|
case YOU:
|
||||||
if (event.getPlayerId().equals(getControllerId())) {
|
if (event.getPlayerId().equals(getControllerId())) {
|
||||||
return false;
|
sacrificed = true;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case OPPONENT:
|
case OPPONENT:
|
||||||
Player controller = game.getPlayer(getControllerId());
|
Player controller = game.getPlayer(getControllerId());
|
||||||
if (controller == null || !controller.hasOpponent(event.getPlayerId(), game)) {
|
if (controller == null || !controller.hasOpponent(event.getPlayerId(), game)) {
|
||||||
return false;
|
sacrificed = true;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
Permanent sacrificedPermanent = game.getPermanentOrLKIBattlefield(event.getTargetId());
|
Permanent sacrificedPermanent = game.getPermanentOrLKIBattlefield(event.getTargetId());
|
||||||
return sacrificedPermanent != null && filter.match(sacrificedPermanent, getSourceId(), getControllerId(), game);
|
return sacrificed && sacrificedPermanent != null && filter.match(sacrificedPermanent, getSourceId(), getControllerId(), game);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in a new issue