Prevented 0 damage prevention events.

This commit is contained in:
LevelX2 2013-09-27 16:14:13 +02:00
parent 8674bbf10d
commit 0357dcb59d
4 changed files with 5 additions and 4 deletions

View file

@ -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) {

View file

@ -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);