Skip to content

Commit 3ca80fe

Browse files
committed
sound for shuffling
1 parent 1988858 commit 3ca80fe

File tree

4 files changed

+21
-16
lines changed

4 files changed

+21
-16
lines changed

resources/public/sound/shuffle.mp3

8.23 KB
Binary file not shown.

resources/public/sound/shuffle.ogg

10.6 KB
Binary file not shown.

src/clj/game/core/shuffling.clj

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
[game.core.engine :refer [trigger-event]]
77
[game.core.flags :refer [zone-locked?]]
88
[game.core.moving :refer [move move-zone]]
9-
[game.core.say :refer [system-msg]]
9+
[game.core.say :refer [system-msg play-sfx]]
1010
[game.core.servers :refer [name-zone]]
1111
[game.macros :refer [continue-ability msg req]]
1212
[game.utils :refer [enumerate-str enumerate-cards quantify]])
@@ -36,21 +36,24 @@
3636

3737
(defn shuffle!
3838
"Shuffles the vector in @state [side kw]."
39-
[state side kw]
40-
(when (contains? #{:deck :hand :discard} kw)
41-
(trigger-event state side (when (= :deck kw) (if (= :corp side) :corp-shuffle-deck :runner-shuffle-deck)))
42-
(when (and (:breach @state)
43-
(= :corp side)
44-
(= :deck kw))
45-
;; we no longer know the cards in R&D, even if they were candidates before
46-
(swap! state assoc-in [:breach :known-cids :deck] []))
47-
(when (and (:access @state)
48-
(:run @state)
49-
(= :corp side)
50-
(= :deck kw))
51-
(swap! state assoc-in [:run :shuffled-during-access :rd] true))
52-
(swap! state update-in [:stats side :shuffle-count] (fnil + 0) 1)
53-
(swap! state update-in [side kw] shuffle-coll)))
39+
([state side kw] (shuffle! state side kw nil))
40+
([state side kw {:keys [no-sfx] :as args}]
41+
(when (contains? #{:deck :hand :discard} kw)
42+
(trigger-event state side (when (= :deck kw) (if (= :corp side) :corp-shuffle-deck :runner-shuffle-deck)))
43+
(when (and (:breach @state)
44+
(= :corp side)
45+
(= :deck kw))
46+
;; we no longer know the cards in R&D, even if they were candidates before
47+
(swap! state assoc-in [:breach :known-cids :deck] []))
48+
(when (and (:access @state)
49+
(:run @state)
50+
(= :corp side)
51+
(= :deck kw))
52+
(swap! state assoc-in [:run :shuffled-during-access :rd] true))
53+
(when-not no-sfx
54+
(play-sfx state side "shuffle"))
55+
(swap! state update-in [:stats side :shuffle-count] (fnil + 0) 1)
56+
(swap! state update-in [side kw] shuffle-coll))))
5457

5558
(defn shuffle-cards-into-deck!
5659
"Shuffles a given set of cards into the deck. Will print out what's happened. Will always shuffle."
@@ -115,6 +118,7 @@
115118
"Shuffle R&D/Stack."
116119
[state side {:keys [close]}]
117120
(swap! state update-in [side :deck] shuffle)
121+
(play-sfx state side "shuffle")
118122
(if close
119123
(do
120124
(swap! state update-in [side] dissoc :view-deck)

src/cljs/nr/sounds.cljs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@
7070
"rez-other"
7171
"run-successful"
7272
"run-unsuccessful"
73+
"shuffle"
7374
"time-out"
7475
"virus-purge"])
7576

0 commit comments

Comments
 (0)