mirror of
https://github.com/correl/mage.git
synced 2024-12-25 11:11:16 +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
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
boolean sacrificed = false;
|
||||
switch (sacrificingPlayer) {
|
||||
case YOU:
|
||||
if (event.getPlayerId().equals(getControllerId())) {
|
||||
return false;
|
||||
sacrificed = true;
|
||||
}
|
||||
break;
|
||||
case OPPONENT:
|
||||
Player controller = game.getPlayer(getControllerId());
|
||||
if (controller == null || !controller.hasOpponent(event.getPlayerId(), game)) {
|
||||
return false;
|
||||
sacrificed = true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
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
|
||||
|
|
Loading…
Reference in a new issue