mirror of
https://github.com/PolarisSS13/Polaris.git
synced 2026-01-03 05:52:17 +00:00
A lot of new defines are now in inventory_sizes.dm, which contains; All the size identifiers (the thing that tells the game if something is bulky, or w/e). Storage costs for all the sizes, which are exponents of two, as previously. A few constants for inventory size. Also changes all storage item's capacity definitions by basing it off of how many 'normal slots' exist for it. This allows one to change the definition for all of the defines in the file, and everything will follow along without needing to change 500 files. In testing, I made all ITEMSIZE_COST_* defines doubled, and nothing had broke. The benefit of doing all of this is that it makes adding new weight classes in the future much simpler, and makes knowing how much space a container has easier, as seeing ITEMSIZE_COST_NORMAL * 7 means it can hold seven normal items.
58 lines
2.1 KiB
Plaintext
58 lines
2.1 KiB
Plaintext
/obj/item/device/hailer
|
|
name = "hailer"
|
|
desc = "Used by obese officers to save their breath for running."
|
|
icon_state = "voice0"
|
|
item_state = "flashbang" //looks exactly like a flash (and nothing like a flashbang)
|
|
w_class = ITEMSIZE_TINY
|
|
flags = CONDUCT
|
|
slot_flags = SLOT_EARS
|
|
|
|
var/use_message = "Halt! Security!"
|
|
var/spamcheck = 0
|
|
var/insults
|
|
|
|
/obj/item/device/hailer/verb/set_message()
|
|
set name = "Set Hailer Message"
|
|
set category = "Object"
|
|
set desc = "Alter the message shouted by your hailer."
|
|
|
|
if(!isnull(insults))
|
|
usr << "The hailer is fried. The tiny input screen just shows a waving ASCII penis."
|
|
return
|
|
|
|
var/new_message = input(usr, "Please enter new message (leave blank to reset).") as text
|
|
if(!new_message || new_message == "")
|
|
use_message = "Halt! Security!"
|
|
else
|
|
use_message = capitalize(copytext(sanitize(new_message), 1, MAX_MESSAGE_LEN))
|
|
|
|
usr << "You configure the hailer to shout \"[use_message]\"."
|
|
/
|
|
obj/item/device/hailer/attack_self(mob/living/carbon/user as mob)
|
|
if (spamcheck)
|
|
return
|
|
|
|
if(isnull(insults))
|
|
playsound(get_turf(src), 'sound/voice/halt.ogg', 100, 1, vary = 0)
|
|
user.audible_message("<span class='warning'>[user]'s [name] rasps, \"[use_message]\"</span>", "<span class='warning'>\The [user] holds up \the [name].</span>")
|
|
else
|
|
if(insults > 0)
|
|
playsound(get_turf(src), 'sound/voice/binsult.ogg', 100, 1, vary = 0)
|
|
// Yes, it used to show the transcription of the sound clip. That was a) inaccurate b) immature as shit.
|
|
user.audible_message("<span class='warning'>[user]'s [name] gurgles something indecipherable and deeply offensive.</span>", "<span class='warning'>\The [user] holds up \the [name].</span>")
|
|
insults--
|
|
else
|
|
user << "<span class='danger'>*BZZZZZZZZT*</span>"
|
|
|
|
spamcheck = 1
|
|
spawn(20)
|
|
spamcheck = 0
|
|
|
|
/obj/item/device/hailer/emag_act(var/remaining_charges, var/mob/user)
|
|
if(isnull(insults))
|
|
user << "<span class='danger'>You overload \the [src]'s voice synthesizer.</span>"
|
|
insults = rand(1, 3)//to prevent dickflooding
|
|
return 1
|
|
else
|
|
user << "The hailer is fried. You can't even fit the sequencer into the input slot."
|