From a60bfdf934a2313f890fea9115ecf947eba2c40f Mon Sep 17 00:00:00 2001
From: Varelion <99684831+Varelion@users.noreply.github.com>
Date: Sun, 22 Oct 2023 12:54:09 -0400
Subject: [PATCH] AltClick() Deck Shuffle (#22924)
* Update tarot.dm
Allow shuffle through AltClick(), reduce shuffle time.
* Update cards.dm
Allow AltClick to shuffle the deck.
* Updated tarot.dm
Removed the tarot shuffle, as it was already inherited from deck's new AltClick shuffle option.
* Update cards.dm
Lowered cooldown on cards.dm to match tarot.dm
* Change tarot.dm and cards.dm
Changed shuffling cooldown time from 5 seconds to one second.
---
code/modules/games/cards.dm | 5 ++++-
code/modules/games/tarot.dm | 3 ++-
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/code/modules/games/cards.dm b/code/modules/games/cards.dm
index 43088af133f..e8ee0cd1e05 100644
--- a/code/modules/games/cards.dm
+++ b/code/modules/games/cards.dm
@@ -239,6 +239,9 @@
/obj/item/deck/attack_self()
deckshuffle()
+/obj/item/deck/AltClick()
+ deckshuffle()
+
/obj/item/deck/verb/verb_shuffle()
if(!isobserver(usr))
set category = "Object"
@@ -249,7 +252,7 @@
/obj/item/deck/proc/deckshuffle()
var/mob/living/user = usr
- if(cooldown < world.time - 5 SECONDS)
+ if(cooldown < world.time - 1 SECONDS)
cards = shuffle(cards)
user.visible_message("[user] shuffles [src].")
playsound(user, 'sound/items/cardshuffle.ogg', 50, 1)
diff --git a/code/modules/games/tarot.dm b/code/modules/games/tarot.dm
index b176bbd78be..da99f76b2fd 100644
--- a/code/modules/games/tarot.dm
+++ b/code/modules/games/tarot.dm
@@ -15,7 +15,7 @@
/obj/item/deck/tarot/deckshuffle()
var/mob/living/user = usr
- if(cooldown < world.time - 5 SECONDS)
+ if(cooldown < world.time - 1 SECONDS)
var/list/newcards = list()
while(cards.len)
var/datum/playingcard/P = pick(cards)
@@ -28,3 +28,4 @@
playsound(user, 'sound/items/cardshuffle.ogg', 50, 1)
user.visible_message("[user] shuffles [src].", "You shuffle [src].")
cooldown = world.time
+