File tree Expand file tree Collapse file tree 1 file changed +7
-12
lines changed
Expand file tree Collapse file tree 1 file changed +7
-12
lines changed Original file line number Diff line number Diff line change 1010
1111(def identity-quotes (atom {}))
1212
13+ (defn- load-quote-file [filename]
14+ (let [file (io/file filename)]
15+ (when (.exists file)
16+ (edn/read-string (slurp file)))))
17+
1318(defn load-quotes! []
14- (let [quotes-corp (when (.exists (io/file quotes-corp-filename))
15- (-> (io/file quotes-corp-filename)
16- (slurp )
17- (edn/read-string )))
18- quotes-runner (when (.exists (io/file quotes-runner-filename))
19- (-> (io/file quotes-runner-filename)
20- (slurp )
21- (edn/read-string )))]
22- (reset! identity-quotes (merge quotes-corp quotes-runner))))
19+ (reset! identity-quotes (merge (load-quote-file quotes-corp-filename)
20+ (load-quote-file quotes-runner-filename))))
2321
2422(defn- choose-and-repeat [options qty]
2523 (when (not-empty options)
2624 (repeat qty (first (shuffle options)))))
2725
2826(defn make-quote [{player-ident :title } {opp-ident :title opp-faction :faction }]
29-
3027 (let [generic (get-in @identity-quotes [player-ident generic-key])
3128 opp-faction (get-in @identity-quotes [player-ident opp-faction])
3229 opp-specific (get-in @identity-quotes [player-ident opp-ident])
3734 (if (not-empty non-blank)
3835 (first (shuffle non-blank))
3936 " NO QUOTE SRY" )))
40-
41-
You can’t perform that action at this time.
0 commit comments