Prevent message spam on some items (#16621)

This commit is contained in:
DamianX
2017-12-02 17:55:01 +01:00
committed by Pieter-Jan Briers
parent 3f6f3b1e15
commit f90af69bce
2 changed files with 11 additions and 6 deletions

View File

@@ -215,11 +215,13 @@
user.show_message("The DNA hash on the card is [dna_hash].",1)
user.show_message("The fingerprint hash on the card is [fingerprint_hash].",1)
/obj/item/weapon/card/id/attack_self(mob/user as mob)
user.visible_message("[user] shows you: [bicon(src)] [src.name]: assignment: [src.assignment]",\
"You flash your ID card: [bicon(src)] [src.name]: assignment: [src.assignment]")
src.add_fingerprint(user)
return
/obj/item/weapon/card/id/attack_self(var/mob/user)
if(user.attack_delayer.blocked())
return
user.visible_message("[user] shows you: [bicon(src)] [name]: assignment: [assignment]",\
"You flash your ID card: [bicon(src)] [name]: assignment: [assignment]")
user.delayNextAttack(1 SECONDS)
add_fingerprint(user)
/obj/item/weapon/card/id/GetAccess()
return (access | base_access)

View File

@@ -92,11 +92,14 @@
update_icon()
/obj/item/toy/cards/attack_self(mob/user as mob)
/obj/item/toy/cards/attack_self(var/mob/user)
if(user.attack_delayer.blocked())
return
cards = shuffle(cards)
playsound(user, 'sound/items/cardshuffle.ogg', 50, 1)
user.visible_message("<span class = 'notice'>[user] shuffles the deck.</span>",
"<span class = 'notice'>You shuffle the deck.</span>")
user.delayNextAttack(1 SECONDS)
/obj/item/toy/cards/attackby(obj/item/I, mob/living/user)
..()