Fix handling of damage to permanents (WIP) (#7592)

* initial refactor of damage events

* cleaned up some instances of classes that need to be removed

* removed old damage event classes

* removed outdated imports

* temporarily refactor Everlasting Torment (this will need to be changed more)

* updated damage handling to use new changes

* some reworking of lethal/excess damage plus a test

* updated damage marking to handle planeswalkers

* updated implementation of Phyrexian Unlife

* updated implementation of Everlasting Torment

* added some more excess damage tests

* small change to wither check
This commit is contained in:
Evan Kranzler 2021-02-22 17:11:24 -05:00 committed by GitHub
parent 39f6b69391
commit 5390963d38
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
201 changed files with 1132 additions and 1187 deletions

View file

@ -58,9 +58,9 @@ class AjaniSteadfastPreventEffect extends PreventionEffectImpl {
return super.applies(event, source, game);
}
if (event.getType() == GameEvent.EventType.DAMAGE_PLANESWALKER) {
if (event.getType() == GameEvent.EventType.DAMAGE_PERMANENT) {
Permanent permanent = game.getPermanent(event.getTargetId());
if (permanent != null && permanent.isControlledBy(source.getControllerId())) {
if (permanent != null && permanent.isPlaneswalker() && permanent.isControlledBy(source.getControllerId())) {
return super.applies(event, source, game);
}
}