forked from External/mage
* Devour abilities - fixed that it doesn't trigger simultaneous events after multiple permanents sacrifice (#6254, #6273)
This commit is contained in:
parent
da52fc430c
commit
85083a4433
2 changed files with 32 additions and 13 deletions
|
|
@ -88,19 +88,19 @@ public class DevourEffect extends ReplacementEffectImpl {
|
|||
controller.chooseTarget(Outcome.Detriment, target, source, game);
|
||||
if (!target.getTargets().isEmpty()) {
|
||||
List<SubTypeList> cardSubtypes = new ArrayList<>();
|
||||
int devouredCreatures = target.getTargets().size();
|
||||
int devouredCreatures = 0;
|
||||
for (UUID targetId : target.getTargets()) {
|
||||
Permanent targetCreature = game.getPermanent(targetId);
|
||||
if (targetCreature != null && targetCreature.sacrifice(source.getSourceId(), game)) {
|
||||
cardSubtypes.add(targetCreature.getSubtype(game));
|
||||
devouredCreatures++;
|
||||
}
|
||||
}
|
||||
if (!game.isSimulation()) {
|
||||
game.informPlayers(creature.getLogName() + " devours " + devouredCreatures + " creatures");
|
||||
}
|
||||
for (UUID targetId : target.getTargets()) {
|
||||
Permanent targetCreature = game.getPermanent(targetId);
|
||||
if (targetCreature != null) {
|
||||
cardSubtypes.add(targetCreature.getSubtype(game));
|
||||
}
|
||||
if (targetCreature == null || !targetCreature.sacrifice(source.getSourceId(), game)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
game.getState().processAction(game); // need for multistep effects
|
||||
|
||||
int amountCounters;
|
||||
if (devourFactor == DevourFactor.DevourX) {
|
||||
amountCounters = devouredCreatures * devouredCreatures;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue