mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-23 12:07:27 +01:00
Add unit-tests for card decks (#24791)
* Add unit-tests for card decks * Fix linter CI comments * Rename unit-test file due to duplicate filename * Fix review comments * Fix unit-test broken after review comment fixing * Remove blank unit-tests for card-decks * Use TRUE instead of magic-value 1 in cardshuffle sound call Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com> --------- Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>
This commit is contained in:
@@ -50,10 +50,16 @@
|
||||
|
||||
/obj/item/deck/Initialize(mapload)
|
||||
. = ..()
|
||||
build_decks()
|
||||
update_icon(UPDATE_ICON_STATE)
|
||||
|
||||
/obj/item/deck/proc/build_decks()
|
||||
if(length(cards))
|
||||
// prevent building decks more than once
|
||||
return
|
||||
for(var/deck in 1 to deck_size)
|
||||
build_deck()
|
||||
deck_total = length(cards)
|
||||
update_icon(UPDATE_ICON_STATE)
|
||||
|
||||
/obj/item/deck/proc/build_deck()
|
||||
return
|
||||
@@ -227,8 +233,10 @@
|
||||
var/mob/living/user = usr
|
||||
if(cooldown < world.time - 1 SECONDS)
|
||||
cards = shuffle(cards)
|
||||
user.visible_message("<span class='notice'>[user] shuffles [src].</span>")
|
||||
playsound(user, 'sound/items/cardshuffle.ogg', 50, 1)
|
||||
|
||||
if(user)
|
||||
user.visible_message("<span class='notice'>[user] shuffles [src].</span>")
|
||||
playsound(user, 'sound/items/cardshuffle.ogg', 50, TRUE)
|
||||
cooldown = world.time
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user