mirror of
https://github.com/magefree/mage.git
synced 2025-12-27 22:12:03 -08:00
Prevented 0 damage prevention events.
This commit is contained in:
parent
8674bbf10d
commit
0357dcb59d
4 changed files with 5 additions and 4 deletions
|
|
@ -52,7 +52,7 @@ public class PreventAllDamageEffect extends PreventionEffectImpl<PreventAllDamag
|
|||
this.onlyCombat = onlyCombat;
|
||||
}
|
||||
|
||||
public PreventAllDamageEffect(Duration duration, boolean onlyCombat) {
|
||||
public PreventAllDamageEffect(Duration duration, boolean onlyCombat) {
|
||||
super(duration);
|
||||
this.onlyCombat = onlyCombat;
|
||||
}
|
||||
|
|
@ -100,7 +100,7 @@ public class PreventAllDamageEffect extends PreventionEffectImpl<PreventAllDamag
|
|||
|
||||
@Override
|
||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
if (super.applies(event, source, game) && event instanceof DamageEvent) {
|
||||
if (super.applies(event, source, game) && event instanceof DamageEvent && event.getAmount() > 0) {
|
||||
DamageEvent damageEvent = (DamageEvent) event;
|
||||
if (damageEvent.isCombatDamage() || !onlyCombat) {
|
||||
if (filter == null) {
|
||||
|
|
|
|||
|
|
@ -619,6 +619,7 @@ public abstract class PermanentImpl<T extends PermanentImpl<T>> extends CardImpl
|
|||
*/
|
||||
private int damage(int damageAmount, UUID sourceId, Game game, boolean preventable, boolean combat, boolean markDamage, ArrayList<UUID> appliedEffects) {
|
||||
int damageDone = 0;
|
||||
// because of "Doran, the Siege Tower" we can't check here for 0 damage.
|
||||
if (canDamage(game.getObject(sourceId), game)) {
|
||||
if (cardType.contains(CardType.PLANESWALKER)) {
|
||||
damageDone = damagePlaneswalker(damageAmount, sourceId, game, preventable, combat, markDamage, appliedEffects);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue