forked from External/mage
Introduce new batch event for life lost for a specific player (#13071)
* Introduce new batch event for life lost for a specific player closes #12202, fix #10805 * implement [DSC] Valgavoth, Harrower of Souls * text fixes
This commit is contained in:
parent
95e986dee7
commit
d6cf207a8b
28 changed files with 693 additions and 707 deletions
|
|
@ -975,12 +975,17 @@ public class GameState implements Serializable, Copyable<GameState> {
|
|||
// Combine multiple life loss events in the single event (batch)
|
||||
// see GameEvent.LOST_LIFE_BATCH
|
||||
|
||||
// existing batch
|
||||
// existing batchs
|
||||
boolean isLifeLostBatchUsed = false;
|
||||
boolean isSingleBatchUsed = false;
|
||||
for (GameEvent event : simultaneousEvents) {
|
||||
if (event instanceof LifeLostBatchEvent) {
|
||||
((LifeLostBatchEvent) event).addEvent(lifeLossEvent);
|
||||
isLifeLostBatchUsed = true;
|
||||
} else if (event instanceof LifeLostBatchForOnePlayerEvent
|
||||
&& event.getTargetId().equals(lifeLossEvent.getTargetId())) {
|
||||
((LifeLostBatchForOnePlayerEvent) event).addEvent(lifeLossEvent);
|
||||
isSingleBatchUsed = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -988,6 +993,9 @@ public class GameState implements Serializable, Copyable<GameState> {
|
|||
if (!isLifeLostBatchUsed) {
|
||||
addSimultaneousEvent(new LifeLostBatchEvent(lifeLossEvent), game);
|
||||
}
|
||||
if (!isSingleBatchUsed) {
|
||||
addSimultaneousEvent(new LifeLostBatchForOnePlayerEvent(lifeLossEvent), game);
|
||||
}
|
||||
}
|
||||
|
||||
public void addSimultaneousTappedToBatch(TappedEvent tappedEvent, Game game) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue