[BLB] Implement Camellia, the Seedmiser. (#12751)

* [BLB] Implement Camellia, the Seedmiser.

Also implemented SacrificedPermanentBatchEvent, SacrificeOneOrMorePermanentsTriggeredAbility, and refactored existing Whenever you sacrifice one or more [filter] abilities to use the new SacrificeOneOrMorePermanentsTriggeredAbility (even though as they all only trigger once per turn and technically function correctly with the old SacrificePermanentTriggeredAbility.

* Fix accidental newline.
This commit is contained in:
Grath 2024-08-29 10:35:13 -04:00 committed by GitHub
parent c937856adf
commit 3c419a857f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 244 additions and 12 deletions

View file

@ -930,6 +930,24 @@ public class GameState implements Serializable, Copyable<GameState> {
}
}
public void addSimultaneousSacrificedPermanentToBatch(GameEvent sacrificedEvent, Game game) {
// Combine multiple sacrificed permanent events in the single event (batch)
// existing batch
boolean isBatchUsed = false;
for (GameEvent event : simultaneousEvents) {
if (event instanceof SacrificedPermanentBatchEvent) {
((SacrificedPermanentBatchEvent) event).addEvent(sacrificedEvent);
isBatchUsed = true;
}
}
// new batch
if (!isBatchUsed) {
addSimultaneousEvent(new SacrificedPermanentBatchEvent(sacrificedEvent), game);
}
}
public void addSimultaneousLifeLossToBatch(LifeLostEvent lifeLossEvent, Game game) {
// Combine multiple life loss events in the single event (batch)
// see GameEvent.LOST_LIFE_BATCH