Gives the monkey a gun (#58565)

This adds a rare-ish negative station trait that gives Pun Pun a weapon, fills their heart with anger, and bloodies up the location they spawn in. (Yes the weapon is even more rarely a gun)

A request for one of the weapons to be a sign meant that a random sign type was added here as well.
This commit is contained in:
Emmett Gaines
2021-05-08 01:00:59 -04:00
committed by GitHub
parent 84250aead0
commit 14d337787b
4 changed files with 117 additions and 18 deletions
+20 -16
View File
@@ -59,12 +59,14 @@
* The first time a pen is used on any sign, this populates GLOBAL_LIST_EMPTY(editable_sign_types), creating a global list of all the signs that you can set a sign backing to with a pen.
*/
/proc/populate_editable_sign_types()
var/list/output = list()
for(var/s in subtypesof(/obj/structure/sign))
var/obj/structure/sign/potential_sign = s
if(!initial(potential_sign.is_editable))
continue
GLOB.editable_sign_types[initial(potential_sign.sign_change_name)] = potential_sign
GLOB.editable_sign_types = sortList(GLOB.editable_sign_types) //Alphabetizes the results.
output[initial(potential_sign.sign_change_name)] = potential_sign
output = sortList(output) //Alphabetizes the results.
return output
/obj/structure/sign/wrench_act(mob/living/user, obj/item/wrench/I)
. = ..()
@@ -130,9 +132,7 @@
/obj/structure/sign/attackby(obj/item/I, mob/user, params)
if(is_editable && istype(I, /obj/item/pen))
if(!length(GLOB.editable_sign_types))
populate_editable_sign_types()
if(!length(GLOB.editable_sign_types))
CRASH("GLOB.editable_sign_types failed to populate")
CRASH("GLOB.editable_sign_types failed to populate")
var/choice = input(user, "Select a sign type.", "Sign Customization") as null|anything in GLOB.editable_sign_types
if(!choice)
return
@@ -160,9 +160,7 @@
/obj/item/sign/attackby(obj/item/I, mob/user, params)
if(is_editable && istype(I, /obj/item/pen))
if(!length(GLOB.editable_sign_types))
populate_editable_sign_types()
if(!length(GLOB.editable_sign_types))
CRASH("GLOB.editable_sign_types failed to populate")
CRASH("GLOB.editable_sign_types failed to populate")
var/choice = input(user, "Select a sign type.", "Sign Customization") as null|anything in GLOB.editable_sign_types
if(!choice)
return
@@ -174,18 +172,20 @@
user.visible_message("<span class='notice'>You begin changing [src].</span>")
if(!do_after(user, 4 SECONDS, target = src))
return
var/obj/structure/sign/sign_type = GLOB.editable_sign_types[choice]
name = initial(sign_type.name)
if(sign_type != /obj/structure/sign/blank)
desc = "[initial(sign_type.desc)] It can be placed on a wall."
else
desc = initial(desc) //If you're changing it to a blank sign, just use obj/item/sign's description.
icon_state = initial(sign_type.icon_state)
sign_path = sign_type
set_sign_type(GLOB.editable_sign_types[choice])
user.visible_message("<span class='notice'>You finish changing the sign.</span>")
return
return ..()
/obj/item/sign/proc/set_sign_type(obj/structure/sign/fake_type)
name = initial(fake_type.name)
if(fake_type != /obj/structure/sign/blank)
desc = "[initial(fake_type.desc)] It can be placed on a wall."
else
desc = initial(desc)
icon_state = initial(fake_type.icon_state)
sign_path = fake_type
/obj/item/sign/afterattack(atom/target, mob/user, proximity)
. = ..()
if(!iswallturf(target) || !proximity)
@@ -210,6 +210,10 @@
placed_sign.setDir(dir)
qdel(src)
/obj/item/sign/random/Initialize()
. = ..()
set_sign_type(GLOB.editable_sign_types[pick(GLOB.editable_sign_types)])
/obj/structure/sign/nanotrasen
name = "\improper Nanotrasen logo sign"
sign_change_name = "Corporate Logo - Nanotrasen"