public int preventDamage(final int damage, Card source, boolean isCombat) {

        if (AllZoneUtil.isCardInPlay("Leyline of Punishment")) return damage;

        int restDamage = damage;

        // Purity has to stay here because it changes the game state
        if (AllZoneUtil.isCardInPlay("Purity", this) && !isCombat) {
            gainLife(restDamage, null);
            return 0;
        }

        restDamage = staticDamagePrevention(restDamage, source, isCombat);

        if (restDamage >= preventNextDamage) {
            restDamage = restDamage - preventNextDamage;
            preventNextDamage = 0;
        } else {
            restDamage = 0;
            preventNextDamage = preventNextDamage - restDamage;
        }

        return restDamage;
    }