anchor.diff:               (affected-by-spell victim +spell-chemical-stability+))
       (setf amount (floor amount 2)))
   
  -  (floor (min (calculate-damage-cap ch) amount)))
  +  (floor (min (calculate-damage-cap attacker) amount)))
   
   (defun remove-damage-sensitive-affects (ch)
     (when (aff-flagged ch +aff-sleep+)
  
positive.code:     ;; Maximum damage reduction of 75%
      (/ (min reduction 75) 100)))
  
  (defun calculate-damage-cap (ch)
    (if ch
        (max (+ 20 (level-of ch) (* 2 (remort-gen-of ch)))
             (+ (* 20 (level-of ch)) (* 2 (level-of ch) (remort-gen-of ch))))
        7000))
  
  (defun bad-attack-type (attack)
  
negative.code:                             (mana-shield-low-of victim)))))
        (decf amount absorbed)
        (decf (mana-of victim)
              (floor (* absorbed (- 1 (min (dam-reduction-of victim attacker)) 0.5))))
  
        (when (<= (mana-of victim) (mana-shield-low-of victim))
          (send-to-char victim "Your mana shield has expired.~%")
          (affect-from-char victim +spell-mana-shield+))))
    ;; Knights, clerics, and monks out of alignment
    (when (and attacker
               (or (and (is-neutral attacker)
                        (or (is-knight attacker) (is-cleric attacker)))
                   (and (not (is-neutral attacker))
                        (is-monk attacker))))
      (decf amount (floor amount 4)))
  
    ;; Lunar alignment damage bonuses and reduction
    (when (and attacker (is-class attacker +class-cleric+) (is-evil attacker))
      ;; evil clerics get an alignment-based damage bonus, up to 30% on
      ;; new moons, %10 otherwise.
      (incf amount (floor (* amount (- (alignment-of attacker)))
                          (if (eql (lunar-phase *lunar-day*) +moon-new+)
                              3000
                              10000))))
    ;; Damage reduction
    (decf amount (* amount (dam-reduction-of victim attacker)))
  
    ;; Very hard to damage mobs
    (when (or (is-pudding victim) (is-slime victim) (is-troll victim))
  