forked from External/mage
refactor: fixed dies events support in single cards (part 5);
This commit is contained in:
parent
740a9347ae
commit
6d55e4b9e6
25 changed files with 262 additions and 13 deletions
|
|
@ -8,7 +8,9 @@ import mage.constants.AbilityType;
|
|||
import mage.constants.AbilityWord;
|
||||
import mage.constants.Zone;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.BatchEvent;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.game.events.ZoneChangeBatchEvent;
|
||||
import mage.game.events.ZoneChangeEvent;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.game.permanent.PermanentToken;
|
||||
|
|
@ -465,8 +467,14 @@ public abstract class TriggeredAbilityImpl extends AbilityImpl implements Trigge
|
|||
public static boolean isInUseableZoneDiesTrigger(TriggeredAbility source, GameEvent event, Game game) {
|
||||
// runtime check: wrong trigger settings
|
||||
if (!source.isLeavesTheBattlefieldTrigger()) {
|
||||
// TODO: enable after fix
|
||||
// throw new IllegalArgumentException("Wrong code usage: all dies triggers must use setLeavesTheBattlefieldTrigger(true)");
|
||||
throw new IllegalArgumentException("Wrong code usage: all dies triggers must use setLeavesTheBattlefieldTrigger(true) and override isInUseableZone - "
|
||||
+ source.getSourceObject(game) + " - " + source);
|
||||
}
|
||||
|
||||
// runtime check: wrong isInUseableZone for batch related triggers
|
||||
if (event instanceof BatchEvent) {
|
||||
throw new IllegalArgumentException("Wrong code usage: batch events unsupported here, possible miss of override isInUseableZone - "
|
||||
+ source.getSourceObject(game) + " - " + source);
|
||||
}
|
||||
|
||||
// Get the source permanent of the ability
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue