forked from External/mage
[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:
parent
c937856adf
commit
3c419a857f
10 changed files with 244 additions and 12 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue