Implement Damage Batch for Permanent event (#11841)

* implement [WHO] Donna Noble

* Changed trigger to DAMAGED_BATCH_FOR_PERMANENTS, check for need of separate targets

* fix short circuit operator

* simplify control path in paired damage trigger

* Initial commit, missing tests

* use CardUtil.getEventTargets

* Implement Donna Noble using DamagedBatchForOnePermanentEvent

* fix double-effect bug

* remove unnecessary custom effect

* Fix addSimultaneousDamage to avoid adding damage events to existing DamagedBatchForOnePlayerEvent instances when they shouldnt

* Add clarifying comment

* Incorporate batching of DAMAGED_BATCH_FOR_ONE_PERMANENT into if-else if tree to match new logic

* Add tests

* make ability inline

* Move DamageBatchTests

* Change batch events to take first event in constructor
This commit is contained in:
jimga150 2024-03-17 16:15:50 -04:00 committed by GitHub
parent b2aa8abba2
commit 67286aa1a0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 365 additions and 12 deletions

View file

@ -1,14 +1,13 @@
package mage.game.events;
import java.util.UUID;
/**
* @author Susucr
*/
public class DamagedBatchForOnePlayerEvent extends DamagedBatchEvent {
public DamagedBatchForOnePlayerEvent(UUID playerId) {
public DamagedBatchForOnePlayerEvent(DamagedEvent firstEvent) {
super(EventType.DAMAGED_BATCH_FOR_ONE_PLAYER, DamagedPlayerEvent.class);
this.setPlayerId(playerId);
setPlayerId(firstEvent.getPlayerId());
addEvent(firstEvent);
}
}