[Add support for divine alternative components
clinton@unknownlamer.org**20080427034411
 * New reader: arcane-spell-components returns arcane components
 * New reader: divine-spell-components returns divine components
] {
hunk ./src/spells.lisp 49
+   (divine-alternatives :initarg :divine-alternatives
+			:accessor spell-divine-alternatives)
hunk ./src/spells.lisp 56
-   (resistance :initarg :resistance :accessor spell-resistance))
+   (resistance :initarg :resistance :accessor spell-resistance)
+   (description :initarg :description :accessor spell-description)
+   ;;; Optimizations
+   (%divine-components-cache))
hunk ./src/spells.lisp 62
+(defmethod arcane-spell-components ((spell spell))
+  (spell-components spell))
+
+(defmethod divine-spell-components ((spell spell))
+  (if (slot-boundp spell '%divine-components-cache)
+      (slot-value spell '%divine-components-cache)
+      (setf (slot-value spell '%divine-components-cache)
+	    (let ((merged (make-pset :pset (spell-components spell))))
+	      (if-bind alternatives (spell-divine-alternatives spell)
+		(map-pset (lambda (a)
+			    (remove-item (car a) merged)
+			    (insert-item (cdr a) merged))
+			  alternatives))
+	      merged))))
+
}