 (defn init-trace [state side card {:keys [base] :as ability} boost]
   (trigger-event state side :pre-init-trace card)
   (let [bonus (or (get-in @state [:bonus :trace]) 0)
-        base (if (fn? base) (base state side card nil) base) 
+        base (if (fn? base) (base state side card nil) base)
         total (+ base boost bonus)]
-    (system-msg state :corp (str "uses " (:title card) 
-                                 " to initiate a trace with strength " total 
+    (system-msg state :corp (str "uses " (:title card)
+                                 " to initiate a trace with strength " total
                                  " (" base
-                                 (when (> bonus 0) (str " + " bonus " bonus")) 
+                                 (when (> bonus 0) (str " + " bonus " bonus"))
                                  " + " boost " [Credits])"))
     (swap! state update-in [:bonus] dissoc :trace)
     (show-prompt state :runner card (str "Boost link strength?") :credit #(resolve-trace state side %))

                 install-cost (if (and (= (:type c) "ICE") (not no-install-cost))
                                (count dest-zone) 0)
                 install-state (or install-state (:install-state cdef))]
             (when (and (not (and (has? c :subtype "Region")
                                  (some #(has? % :subtype "Region") dest-zone)))
                        (pay state side card extra-cost :credit install-cost))
               (when (#{"Asset" "Agenda"} (:type c))
                 (when-let [prev-card (some #(when (#{"Asset" "Agenda"} (:type %)) %) dest-zone)]
                   (system-msg state side (str "trashes " (if (:rezzed prev-card)
                                                            (:title prev-card) "a card") " in " server))
                   (trash state side prev-card {:keep-server-alive true})))
               (let [card-name (if (or (= :rezzed install-state) (= :face-up install-state) (:rezzed c))
                                 (:title card) "a card")]
                 (if (> install-cost 0)
                   (system-msg state side (str "pays " install-cost " [Credits] to install "
                                               card-name " in " server))
                   (system-msg state side (str "installs " card-name " in " server))))
               (let [moved-card (move state side c slot)]
                 (trigger-event state side :corp-install moved-card)
                 (when (= (:type c) "Agenda")
                   (update-advancement-cost state side moved-card))
                 (when (= install-state :rezzed)
                   (rez state side moved-card {:no-cost true}))
                 (when (= install-state :face-up)
                   (card-init state side (assoc (get-card state moved-card) :rezzed true) false)))))))))

(defn play [state side {:keys [card server]}]
  (case (:type card)

  (swap! state update-in [:bonus :cost] (fnil #(+ % n) 0)))

(defn init-trace-bonus [state side n]
  (swap! state update-in [:bonus :trace] (fnil #(+ % n) 0)))

(defn rez-cost [state side {:keys [cost] :as card}]
  (if (nil? cost)
    nil
