forked from External/mage
[MAT] implemented Ob Nixilis, Captive Kingpin, refactored life lose and batches events (#11974)
This commit is contained in:
parent
0987e01f92
commit
50c75f05bd
8 changed files with 424 additions and 2 deletions
|
|
@ -808,6 +808,25 @@ public class GameState implements Serializable, Copyable<GameState> {
|
|||
return !simultaneousEvents.isEmpty();
|
||||
}
|
||||
|
||||
public void addSimultaneousLifeLossEventToBatches(LifeLostEvent lifeLossEvent, Game game) {
|
||||
// Combine multiple life loss events in the single event (batch)
|
||||
// see GameEvent.LOST_LIFE_BATCH
|
||||
|
||||
// existing batch
|
||||
boolean isLifeLostBatchUsed = false;
|
||||
for (GameEvent event : simultaneousEvents) {
|
||||
if (event instanceof LifeLostBatchEvent) {
|
||||
((LifeLostBatchEvent) event).addEvent(lifeLossEvent);
|
||||
isLifeLostBatchUsed = true;
|
||||
}
|
||||
}
|
||||
|
||||
// new batch
|
||||
if (!isLifeLostBatchUsed) {
|
||||
addSimultaneousEvent(new LifeLostBatchEvent(lifeLossEvent), game);
|
||||
}
|
||||
}
|
||||
|
||||
public void addSimultaneousDamage(DamagedEvent damagedEvent, Game game) {
|
||||
// Combine multiple damage events in the single event (batch)
|
||||
// * per damage type (see GameEvent.DAMAGED_BATCH_FOR_PERMANENTS, GameEvent.DAMAGED_BATCH_FOR_PLAYERS)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue