Custom items 26/05 (#8958)

* Custom items 26/05

* tweaks this.

* Update code/modules/customitems/item_defines.dm

Co-authored-by: Matt Atlas <mattiathebest2000@hotmail.it>

* Update code/game/objects/items/devices/megaphone.dm

Co-authored-by: Matt Atlas <mattiathebest2000@hotmail.it>

* matt's suggestion.

* Fixes travis

Co-authored-by: Matt Atlas <mattiathebest2000@hotmail.it>
This commit is contained in:
Alberyk
2020-06-02 19:07:32 +02:00
committed by GitHub
co-authored by Matt Atlas
parent 1869a24a29
commit 66c8b4e52a
4 changed files with 187 additions and 7 deletions
+10 -7
View File
@@ -10,6 +10,8 @@
var/emagged = 0
var/insults = 0
var/list/insultmsg = list("FUCK EVERYONE!", "I'M A TATER!", "ALL SECURITY TO SHOOT ME ON SIGHT!", "I HAVE A BOMB!", "CAPTAIN IS A COMDOM!", "FOR THE SYNDICATE!")
var/activation_sound = 'sound/items/megaphone.ogg'
var/needs_user_location = TRUE
/obj/item/device/megaphone/attack_self(mob/living/user as mob)
if (user.client)
@@ -29,19 +31,20 @@
if(!message)
return
message = capitalize(message)
if ((src.loc == user && usr.stat == 0))
if ((user.stat == CONSCIOUS))
if(needs_user_location)
if(!src.loc == user)
return
if(emagged)
if(insults)
for(var/mob/O in (viewers(user)))
O.show_message("<B>[user]</B> broadcasts, <FONT size=3>\"[pick(insultmsg)]\"</FONT>",2) // 2 stands for hearable message
user.visible_message("<B>[user]</B> broadcasts, <FONT size=3>\"[pick(insultmsg)]\"</FONT>")
insults--
else
to_chat(user, "<span class='warning'>*BZZZZzzzzzt*</span>")
else
for(var/mob/O in (viewers(user)))
O.show_message("<B>[user]</B> broadcasts, <FONT size=3>\"[message]\"</FONT>",2) // 2 stands for hearable message
playsound(loc, 'sound/items/megaphone.ogg', 100, 0, 1)
user.visible_message("<B>[user]</B> broadcasts, <FONT size=3>\"[message]\"</FONT>")
if(activation_sound)
playsound(loc, activation_sound, 100, 0, 1)
spamcheck = 1
spawn(20)
spamcheck = 0