diff --git a/src/clj/game/core/set_up.clj b/src/clj/game/core/set_up.clj index 40c302707d..7f4877c93e 100644 --- a/src/clj/game/core/set_up.clj +++ b/src/clj/game/core/set_up.clj @@ -13,7 +13,7 @@ [game.core.prompts :refer [clear-wait-prompt show-prompt show-wait-prompt]] [game.core.quick-draft :refer [check-quick-draft]] [game.core.say :refer [system-msg system-say implementation-msg]] - [game.core.shuffling :refer [shuffle-into-deck]] + [game.core.shuffling :refer [shuffle-into-deck shuffle-coll]] [game.core.state :refer [new-state]] [game.macros :refer [wait-for]] [game.quotes :as quotes] @@ -28,8 +28,9 @@ "Creates a shuffled draw deck (R&D/Stack) from the given list of cards. Loads card data from the server-card map if available." [deck] - (shuffle (mapcat #(map build-card (repeat (:qty %) (assoc (:card %) :art (:art %)))) - (shuffle (vec (:cards deck)))))) + (->> deck :cards vec + (mapcat #(map build-card (repeat (:qty %) (assoc (:card %) :art (:art %))))) + shuffle-coll vec)) ;;; Functions for the creation of games and the progression of turns. (defn mulligan diff --git a/src/clj/game/core/shuffling.clj b/src/clj/game/core/shuffling.clj index 1efd5a68b7..01613ee039 100644 --- a/src/clj/game/core/shuffling.clj +++ b/src/clj/game/core/shuffling.clj @@ -24,7 +24,7 @@ (.setSeed rand seed-bytes) rand)) -(defn- shuffle-coll +(defn shuffle-coll ;; Ref: https://github.com/clojure/clojure/blob/ce55092f2b2f5481d25cff6205470c1335760ef6/src/clj/clojure/core.clj#L7342 ;; we're just substituting in a good rng source (1024 bits of entropy) rather than the default used by java (40 bits of entropy) ;; this should theoretically be invisible, since any random slice of the possible sets of deck orderings is also random,