                        (:qty line) " "
                        (if-let [name (get-in line [:card :title])]
                          (let [card (:card line)
-                               infaction (or (= (:faction card) (:faction identity))
-                                            (zero? (:factioncost card)) (= INFINITY (influencelimit identity)))
+                               infaction (noinfcost? identity card)
                                wanted (mostwanted? card)]
                            [:span
                             [:span {:class (if (allowed? card identity) "fake-link" "invalid")

                            (when (or wanted (not infaction))
                              (let [influence (* (:factioncost card) (:qty line))]
                                [:span.influence
                                 {:class (-> card :faction .toLowerCase (.replace " " "-"))
                                  :dangerouslySetInnerHTML
                                  #js {:__html (str (if-not infaction (apply str (for [_ (range influence)] "&#9679;")))
                                                    (if wanted (apply str (for [_ (range (:qty line))] "&#9675;"))))}}]))])

    (om/set-state! owner :deck-edit str)))

(defn influence [deck]
  "Returns a map of faction keywords to influence values from the faction's cards."
  (let [identity (:identity deck)
        cards (:cards deck)
        infhelper (fn [currmap line]
                    (let [card (:card line)]
                      (if (= (:faction card) (:faction identity))
                        currmap
                        (update-in currmap [(keyword (faction-label card))]
                                   (fnil (fn [curinf] (+ curinf (* (:qty line) (:factioncost card))))
                                         0)))))
        infmap (reduce infhelper {} cards)]
    (if (= (:title identity) "The Professor: Keeper of Knowledge")
      (let [progs (filter #(= "Program" (:type (:card %))) cards)
            ;importedprogs (filter #((complement noinfcost?) identity (:card %)) progs)
            singledprogs (reduce #(conj %1 (assoc-in %2 [:qty] 1)) '() progs)
            singledinfmap (reduce infhelper {} singledprogs)]
      (merge-with - infmap singledinfmap))
      infmap)))

(defn influence-count [deck]
  "Returns sum of influence count used by a deck"
  (apply + (vals (influence deck))))

(defn card-count [cards]
  (reduce #(+ %1 (:qty %2)) 0 cards))
