Department, warning, and general sign code fix. And brand new custom plaques! (#50550)

* Oh God I hope this works...

* It didn't work.

* Making things better.

* Making things even better.

* That made things worse.

* Sorting works! \o/

* Tidying some thing ups.

* Adding a custom plaque to the game.

* Some plaque tweaks.

* Makes plaques more durable than signs.

* Adds the stack crafting.

* Plaques take a little time to engrave, signs can't be changed instantly anymore.

* Comments, and renamed the global list to avoid confusion.

* Appends "sign" to every name, makes department signs not all caps, fixes some names and descriptions.

* Touching up plaque customization and display, removing one last all caps.

* Plaques can now be engraved in hand too.

* Newline.

* Update code/game/objects/structures/customplaque.dm

Co-Authored-By: Rohesie <rohesie@gmail.com>

* Update code/game/objects/structures/customplaque.dm

Co-Authored-By: Rohesie <rohesie@gmail.com>

* Mirroring some fixes from customplaque.dm

* A bunch of stuff.

* Unwrenched signs now lay horizontal.

* A lot more stuff, turned a negative variable into a positive.

* Fix chat inconsistency, remove deprecated and unused variable.

* Apparently buildable_sign is used elsewhere, whoops.

* Adding documentation to this, fixing a bool being 0 in another file.

* Don't know why this was here, sign dir is 100% irrelevant.

* Fixes some sound malarkey.

* Changes delays to be readable, removes unneeded return.

* Fixes these two early returns, it needed return TRUE at the end to work.

* Trying to fix a revert I messed up...

* Moving plaques to a directory, moving old sign plaque types into it. Map changes.

* Rename since I relocated this object entirely.

* Signs (and plaques) now properly place, and aren't visible through walls.

* Comment to help people in the future.

* Signs and plaques can be placed diagonally now.

* Removes duplicated code line.

* Blank signs now commonly spawn in maint, blank plaques uncommonly.

* Repairing signs & plaques with a welder is now good to go.

* Moves the GLOB, makes it start as an empty list.

* Update code/game/objects/structures/plaques/_plaques.dm

Co-Authored-By: Rohesie <rohesie@gmail.com>

* Gets rid of some oldcode.

* Apply suggestions from code review

Co-Authored-By: tralezab <40974010+tralezab@users.noreply.github.com>

* Simplifying dir switch to two if elses.

* Plaques take one sheet of gold to graft instead of five.

* Just making this wording in crafting a little clearer.

* They can be removed with wrenches, so I don't think this is proper.

* Makes variables descriptive.

* More descriptive variables, a little dmdoc, move things around to be next to like things.

* Remove a redundant definition.

* Apply suggestions from code review

Co-Authored-By: Rohesie <rohesie@gmail.com>

* Fixes mapping path, rename sign_backing to just sign.

Co-authored-by: Rohesie <rohesie@gmail.com>
Co-authored-by: tralezab <40974010+tralezab@users.noreply.github.com>
This commit is contained in:
uomo
2020-04-28 01:43:44 -03:00
committed by GitHub
co-authored by Rohesie tralezab
parent c84213183f
commit d5451ae60a
24 changed files with 652 additions and 281 deletions
+1 -1
View File
@@ -7,7 +7,7 @@
max_integrity = 500
integrity_failure = 0.5
armor = list("melee" = 20, "bullet" = 20, "laser" = 20, "energy" = 100, "bomb" = 0, "bio" = 0, "rad" = 0, "fire" = 50, "acid" = 50)
buildable_sign = 0
buildable_sign = FALSE
var/panel_open = FALSE
var/datum/barsign/chosen_sign
@@ -0,0 +1,183 @@
/obj/structure/plaque //This is a plaque you can craft with gold, then permanently engrave a title and description on, with a fountain pen.
icon = 'icons/obj/decals.dmi'
icon_state = "blankplaque"
name = "blank plaque"
desc = "A blank plaque, use a fancy pen to engrave it. It can be detatched from the wall with a wrench."
anchored = TRUE
opacity = FALSE
density = FALSE
layer = SIGN_LAYER
custom_materials = list(/datum/material/gold = 2000)
max_integrity = 200 //Twice as durable as regular signs.
armor = list("melee" = 50, "bullet" = 0, "laser" = 0, "energy" = 0, "bomb" = 0, "bio" = 0, "rad" = 0, "fire" = 50, "acid" = 50)
rad_flags = RAD_PROTECT_CONTENTS | RAD_NO_CONTAMINATE
///Custom plaque structures and items both start "unengraved", once engraved with a fountain pen their text can't be altered again. Static plaques are already engraved.
var/engraved = FALSE
/obj/item/plaque //The item version of the above.
icon = 'icons/obj/decals.dmi'
icon_state = "blankplaque"
name = "blank plaque"
desc = "A blank plaque, use a fancy pen to engrave it. It can be placed on a wall."
w_class = WEIGHT_CLASS_NORMAL
custom_materials = list(/datum/material/gold = 2000)
max_integrity = 200
armor = list("melee" = 50, "bullet" = 0, "laser" = 0, "energy" = 0, "bomb" = 0, "bio" = 0, "rad" = 0, "fire" = 50, "acid" = 50)
///This points the item to make the proper structure when placed on a wall.
var/plaque_path = /obj/structure/plaque
///Custom plaque structures and items both start "unengraved", once engraved with a fountain pen their text can't be altered again.
var/engraved = FALSE
/obj/structure/plaque/attack_hand(mob/user)
. = ..()
if(.)
return
user.examinate(src)
/obj/structure/plaque/wrench_act(mob/living/user, obj/item/wrench/I)
. = ..()
user.visible_message("<span class='notice'>[user] starts removing [src]...</span>", \
"<span class='notice'>You start unfastening [src].</span>")
I.play_tool_sound(src)
if(!I.use_tool(src, user, 4 SECONDS))
return TRUE
playsound(src, 'sound/items/deconstruct.ogg', 50, TRUE)
user.visible_message("<span class='notice'>[user] unfastens [src].</span>", \
"<span class='notice'>You unfasten [src].</span>")
var/obj/item/plaque/unwrenched_plaque = new (get_turf(user))
if(engraved) //If it's still just a basic unengraved plaque, we can (and should) skip some of the below variable transfers.
unwrenched_plaque.name = name //Copy over the plaque structure variables to the plaque item we're creating when we unwrench it.
unwrenched_plaque.desc = desc
unwrenched_plaque.engraved = engraved
unwrenched_plaque.obj_integrity = obj_integrity
unwrenched_plaque.setDir(dir)
qdel(src) //The plaque structure on the wall goes poof and only the plaque item from unwrenching remains.
return TRUE
/obj/structure/plaque/welder_act(mob/living/user, obj/item/I)
. = ..()
if(user.a_intent == INTENT_HARM)
return FALSE
if(obj_integrity == max_integrity)
to_chat(user, "<span class='warning'>This plaque is already in perfect condition.</span>")
return TRUE
if(!I.tool_start_check(user, amount=0))
return TRUE
user.visible_message("<span class='notice'>[user] starts repairing [src]...</span>", \
"<span class='notice'>You start repairing [src].</span>")
if(!I.use_tool(src, user, 4 SECONDS, volume = 50))
return TRUE
user.visible_message("<span class='notice'>[user] finishes repairing [src].</span>", \
"<span class='notice'>You finish repairing [src].</span>")
obj_integrity = max_integrity
return TRUE
/obj/item/plaque/welder_act(mob/living/user, obj/item/I)
. = ..()
if(user.a_intent == INTENT_HARM)
return FALSE
if(obj_integrity == max_integrity)
to_chat(user, "<span class='warning'>This plaque is already in perfect condition.</span>")
return TRUE
if(!I.tool_start_check(user, amount=0))
return TRUE
user.visible_message("<span class='notice'>[user] starts repairing [src]...</span>", \
"<span class='notice'>You start repairing [src].</span>")
if(!I.use_tool(src, user, 4 SECONDS, volume = 50))
return TRUE
user.visible_message("<span class='notice'>[user] finishes repairing [src].</span>", \
"<span class='notice'>You finish repairing [src].</span>")
obj_integrity = max_integrity
return TRUE
/obj/structure/plaque/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/pen/fountain))
if(engraved)
to_chat(user, "<span class='warning'>This plaque has already been engraved.</span>")
return
var/namechoice = input(user, "Title this plaque. (e.g. 'Best HoP Award', 'Great Ashwalker War Memorial')", "Plaque Customization")
if(!namechoice)
return
var/descriptionchoice = input(user, "Engrave this plaque's text.", "Plaque Customization")
if(!descriptionchoice)
return
if(!Adjacent(user)) //Make sure user is adjacent still
to_chat(user, "<span class='warning'>You need to stand next to the plaque to engrave it!</span>")
return
user.visible_message("<span class='notice'>[user] begins engraving [src].</span>", \
"<span class='notice'>You begin engraving [src].</span>")
if(!do_after(user, 4 SECONDS, target = src)) //This spits out a visible message that somebody is engraving a plaque, then has a delay.
return
name = "\improper [namechoice]" //We want improper here so examine doesn't get weird if somebody capitalizes the plaque title.
desc = "The plaque reads: '[descriptionchoice]'"
engraved = TRUE //The plaque now has a name, description, and can't be altered again.
user.visible_message("<span class='notice'>[user] engraves [src].</span>", \
"<span class='notice'>You engrave [src].</span>")
return
if(istype(I, /obj/item/pen))
if(engraved)
to_chat(user, "<span class='warning'>This plaque has already been engraved, and your pen isn't fancy enough to engrave it anyway! Find a fountain pen.</span>")
return
to_chat(user, "<span class='warning'>Your pen isn't fancy enough to engrave this! Find a fountain pen.</span>") //Go steal the Curator's.
return
return ..()
/obj/item/plaque/attackby(obj/item/I, mob/user, params) //Same as part of the above, except for the item in hand instead of the structure.
if(istype(I, /obj/item/pen/fountain))
if(engraved)
to_chat(user, "<span class='warning'>This plaque has already been engraved.</span>")
return
var/namechoice = input(user, "Title this plaque. (e.g. 'Best HoP Award', 'Great Ashwalker War Memorial')", "Plaque Customization")
if(!namechoice)
return
var/descriptionchoice = input(user, "Engrave this plaque's text.", "Plaque Customization")
if(!descriptionchoice)
return
if(!Adjacent(user)) //Make sure user is adjacent still
to_chat(user, "<span class='warning'>You need to stand next to the plaque to engrave it!</span>")
return
user.visible_message("<span class='notice'>[user] begins engraving [src].</span>", \
"<span class='notice'>You begin engraving [src].</span>")
if(!do_after(user, 40, target = src)) //This spits out a visible message that somebody is engraving a plaque, then has a delay.
return
name = "\improper [namechoice]" //We want improper here so examine doesn't get weird if somebody capitalizes the plaque title.
desc = "The plaque reads: '[descriptionchoice]'"
engraved = TRUE //The plaque now has a name, description, and can't be altered again.
user.visible_message("<span class='notice'>[user] engraves [src].</span>", \
"<span class='notice'>You engrave [src].</span>")
return
if(istype(I, /obj/item/pen))
if(engraved)
to_chat(user, "<span class='warning'>This plaque has already been engraved, and your pen isn't fancy enough to engrave it anyway! Find a fountain pen.</span>")
return
to_chat(user, "<span class='warning'>Your pen isn't fancy enough to engrave this! Find a fountain pen.</span>") //Go steal the Curator's.
return
return ..()
/obj/item/plaque/afterattack(atom/target, mob/user, proximity)
. = ..()
if(!iswallturf(target) || !proximity)
return
var/turf/target_turf = target
var/turf/user_turf = get_turf(user)
var/obj/structure/plaque/placed_plaque = new plaque_path(user_turf) //We place the plaque on the turf the user is standing, and pixel shift it to the target wall, as below.
//This is to mimic how signs and other wall objects are usually placed by mappers, and so they're only visible from one side of a wall.
var/dir = get_dir(user_turf, target_turf)
if(dir & NORTH)
placed_plaque.pixel_y = 32
else if(dir & SOUTH)
placed_plaque.pixel_y = -32
if(dir & EAST)
placed_plaque.pixel_x = 32
else if(dir & WEST)
placed_plaque.pixel_x = -32
user.visible_message("<span class='notice'>[user] fastens [src] to [target_turf].</span>", \
"<span class='notice'>You attach [src] to [target_turf].</span>")
playsound(target_turf, 'sound/items/deconstruct.ogg', 50, TRUE)
if(engraved)
placed_plaque.name = name
placed_plaque.desc = desc
placed_plaque.engraved = engraved
placed_plaque.obj_integrity = obj_integrity
placed_plaque.setDir(dir)
qdel(src)
@@ -1,26 +1,27 @@
//plaques and memorials
//These are static plaques, they are made of gold and start engraved with a title and description.
/obj/structure/sign/plaques
name = "plaque"
desc = "A plaque commemorating an event."
icon_state = "atmosplaque"
/obj/structure/plaque/static_plaque
engraved = TRUE
/obj/structure/sign/plaques/atmos
/obj/structure/plaque/static_plaque/atmos
name = "\improper FEA Atmospherics Division plaque"
desc = "This plaque commemorates the fall of the Atmos FEA division. For all the charred, dizzy, and brittle men who have died in its hands."
/obj/structure/sign/plaques/thunderdome
/obj/structure/plaque/static_plaque/thunderdome
name = "Thunderdome Plaque"
desc = "This plaque commemorates those who have fallen in glorious combat. For all the charred, dizzy, and beaten men who have died in its hands."
/obj/structure/sign/plaques/golden
/obj/structure/plaque/static_plaque/golden
name = "The Most Robust Men Award for Robustness"
desc = "To be Robust is not an action or a way of life, but a mental state. Only those with the force of Will strong enough to act during a crisis, saving friend from foe, are truly Robust. Stay Robust my friends."
icon_state = "goldenplaque"
/obj/structure/sign/plaques/golden/captain
/obj/structure/plaque/static_plaque/golden/captain
name = "The Most Robust Captain Award for Robustness"
//These are plaques that aren't made of metal, so we'll just consider them signs. Those are made of plastic, not gold.
//See: code>game>objects>structures>signs>_signs.dm
/obj/structure/sign/plaques/kiddie
name = "\improper AI developers plaque"
desc = "Next to the extremely long list of names and job titles, there is a drawing of a little child. The child appears to be disabled. Beneath the image, someone has scratched the word \"PACKETS\"."
@@ -31,7 +32,7 @@
desc = "A plaque commemorating the fallen, may they rest in peace, forever asleep amongst the stars. Someone has drawn a picture of a crying badger at the bottom."
/obj/structure/sign/plaques/kiddie/library
name = "Library Rules Sign"
name = "\improper Library Rules Sign"
desc = "A long list of rules to be followed when in the library, extolling the virtues of being quiet at all times and threatening those who would dare eat hot food inside."
/obj/structure/sign/plaques/kiddie/perfect_man
@@ -43,6 +44,6 @@
desc = "A guide to the drone shell dispenser, detailing the constructive and destructive applications of modern repair drones, as well as the development of the incorruptible cyborg servants of tomorrow, available today."
/obj/structure/sign/plaques/deempisi
name = "Mr. Deempisi portrait"
name = "\improper Mr. Deempisi portrait"
desc = "Under the painting a plaque reads: 'While the meat grinder may not have spared you, fear not. Not one part of you has gone to waste... You were delicious.'"
icon_state = "monkey_painting"
+174 -119
View File
@@ -1,28 +1,44 @@
/obj/structure/sign
icon = 'icons/obj/decals.dmi'
icon_state = "backing"
name = "sign backing"
desc = "A plastic sign backing, use a pen to change the decal. It can be detached from the wall with a wrench."
anchored = TRUE
opacity = 0
density = FALSE
layer = SIGN_LAYER
custom_materials = list(/datum/material/plastic = 2000)
max_integrity = 100
armor = list("melee" = 50, "bullet" = 0, "laser" = 0, "energy" = 0, "bomb" = 0, "bio" = 0, "rad" = 0, "fire" = 50, "acid" = 50)
var/buildable_sign = 1 //unwrenchable and modifiable
///Determines if a sign is unwrenchable.
var/buildable_sign = TRUE
rad_flags = RAD_PROTECT_CONTENTS | RAD_NO_CONTAMINATE
resistance_flags = FLAMMABLE
///This determines if you can select this sign type when using a pen on a sign backing. False by default, set to true per sign type to override.
var/is_editable = FALSE
///sign_change_name is used to make nice looking, alphebetized and categorized names when you use a pen on a sign backing.
var/sign_change_name = "Sign - Blank" //If this is ever seen in game, something went wrong.
/obj/structure/sign/basic
name = "blank sign"
desc = "How can signs be real if our eyes aren't real? Use a pen to change the decal."
/obj/item/sign
name = "sign backing"
desc = "A plastic sign backing, use a pen to change the decal. It can be placed on a wall."
icon = 'icons/obj/decals.dmi'
icon_state = "backing"
w_class = WEIGHT_CLASS_NORMAL
custom_materials = list(/datum/material/plastic = 2000)
armor = list("melee" = 50, "bullet" = 0, "laser" = 0, "energy" = 0, "bomb" = 0, "bio" = 0, "rad" = 0, "fire" = 50, "acid" = 50)
resistance_flags = FLAMMABLE
max_integrity = 100
///The type of sign structure that will be created when placed on a turf, the default looks just like a sign backing item.
var/sign_path = /obj/structure/sign
///This determines if you can select this sign type when using a pen on a sign backing. False by default, set to true per sign type to override.
var/is_editable = TRUE
/obj/structure/sign/play_attack_sound(damage_amount, damage_type = BRUTE, damage_flag = 0)
switch(damage_type)
if(BRUTE)
if(damage_amount)
playsound(src.loc, 'sound/weapons/slash.ogg', 80, TRUE)
else
playsound(loc, 'sound/weapons/tap.ogg', 50, TRUE)
if(BURN)
playsound(loc, 'sound/items/welder.ogg', 80, TRUE)
/obj/item/sign/Initialize() //Signs not attached to walls are always rotated so they look like they're laying horizontal.
. = ..()
var/matrix/M = matrix()
M.Turn(90)
transform = M
/obj/structure/sign/attack_hand(mob/user)
. = ..()
@@ -30,125 +46,164 @@
return
user.examinate(src)
/**
* This proc populates GLOBAL_LIST_EMPTY(editable_sign_types)
*
* 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()
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.
/obj/structure/sign/wrench_act(mob/living/user, obj/item/wrench/I)
. = ..()
user.visible_message("<span class='notice'>[user] starts removing [src]...</span>", \
"<span class='notice'>You start unfastening [src].</span>")
I.play_tool_sound(src)
if(!I.use_tool(src, user, 4 SECONDS))
return TRUE
playsound(src, 'sound/items/deconstruct.ogg', 50, TRUE)
user.visible_message("<span class='notice'>[user] unfastens [src].</span>", \
"<span class='notice'>You unfasten [src].</span>")
var/obj/item/sign/unwrenched_sign = new (get_turf(user))
if(type != /obj/structure/sign) //If it's still just a basic sign backing, we can (and should) skip some of the below variable transfers.
unwrenched_sign.name = name //Copy over the sign structure variables to the sign item we're creating when we unwrench a sign.
unwrenched_sign.desc = "[desc] It can be placed on a wall."
unwrenched_sign.icon_state = icon_state
unwrenched_sign.sign_path = type
unwrenched_sign.obj_integrity = obj_integrity //Transfer how damaged it is.
unwrenched_sign.setDir(dir)
qdel(src) //The sign structure on the wall goes poof and only the sign item from unwrenching remains.
return TRUE
/obj/structure/sign/welder_act(mob/living/user, obj/item/I)
. = ..()
if(user.a_intent == INTENT_HARM)
return FALSE
if(obj_integrity == max_integrity)
to_chat(user, "<span class='warning'>This sign is already in perfect condition.</span>")
return TRUE
if(!I.tool_start_check(user, amount=0))
return TRUE
user.visible_message("<span class='notice'>[user] starts repairing [src]...</span>", \
"<span class='notice'>You start repairing [src].</span>")
if(!I.use_tool(src, user, 4 SECONDS, volume =50 ))
return TRUE
user.visible_message("<span class='notice'>[user] finishes repairing [src].</span>", \
"<span class='notice'>You finish repairing [src].</span>")
obj_integrity = max_integrity
return TRUE
/obj/item/sign/welder_act(mob/living/user, obj/item/I)
. = ..()
if(user.a_intent == INTENT_HARM)
return FALSE
if(obj_integrity == max_integrity)
to_chat(user, "<span class='warning'>This sign is already in perfect condition.</span>")
return TRUE
if(!I.tool_start_check(user, amount=0))
return TRUE
user.visible_message("<span class='notice'>[user] starts repairing [src]...</span>", \
"<span class='notice'>You start repairing [src].</span>")
if(!I.use_tool(src, user, 4 SECONDS, volume =50 ))
return TRUE
user.visible_message("<span class='notice'>[user] finishes repairing [src].</span>", \
"<span class='notice'>You finish repairing [src].</span>")
obj_integrity = max_integrity
return TRUE
/obj/structure/sign/attackby(obj/item/I, mob/user, params)
if(I.tool_behaviour == TOOL_WRENCH && buildable_sign)
user.visible_message("<span class='notice'>[user] starts removing [src]...</span>", \
"<span class='notice'>You start unfastening [src].</span>")
I.play_tool_sound(src)
if(I.use_tool(src, user, 40))
playsound(src, 'sound/items/deconstruct.ogg', 50, TRUE)
user.visible_message("<span class='notice'>[user] unfastens [src].</span>", \
"<span class='notice'>You unfasten [src].</span>")
var/obj/item/sign_backing/SB = new (get_turf(user))
SB.icon_state = icon_state
SB.sign_path = type
SB.setDir(dir)
qdel(src)
return
else if(istype(I, /obj/item/pen) && buildable_sign)
var/list/sign_types = list("Secure Area", "Biohazard", "High Voltage", "Radiation", "Hard Vacuum Ahead", "Disposal: Leads To Space", "Danger: Fire", "No Smoking", "Medbay", "Science", "Chemistry", \
"Hydroponics", "Xenobiology", "Test Chamber","Firing Range", "Extreme Cold", "Extreme Heat", "Gas Mask", "Nanites Lab", "Maintenance", "Reactive Chemicals")
var/obj/structure/sign/sign_type
switch(input(user, "Select a sign type.", "Sign Customization") as null|anything in sortList(sign_types))
if("Blank")
sign_type = /obj/structure/sign/basic
if("Secure Area")
sign_type = /obj/structure/sign/warning/securearea
if("Biohazard")
sign_type = /obj/structure/sign/warning/biohazard
if("High Voltage")
sign_type = /obj/structure/sign/warning/electricshock
if("Radiation")
sign_type = /obj/structure/sign/warning/radiation
if("Hard Vacuum Ahead")
sign_type = /obj/structure/sign/warning/vacuum
if("Disposal: Leads To Space")
sign_type = /obj/structure/sign/warning/deathsposal
if("Danger: Fire")
sign_type = /obj/structure/sign/warning/fire
if("No Smoking")
sign_type = /obj/structure/sign/warning/nosmoking/circle
if("Test Chamber")
sign_type = /obj/structure/sign/warning/testchamber
if("Firing Range")
sign_type = /obj/structure/sign/warning/firingrange
if("Extreme Cold")
sign_type = /obj/structure/sign/warning/coldtemp
if("Extreme Heat")
sign_type = /obj/structure/sign/warning/hottemp
if("Gas Mask")
sign_type = /obj/structure/sign/warning/gasmask
if("Reactive Chemicals")
sign_type = /obj/structure/sign/warning/chemdiamond
if("Medbay")
sign_type = /obj/structure/sign/departments/medbay/alt
if("Science")
sign_type = /obj/structure/sign/departments/science
if("Chemistry")
sign_type = /obj/structure/sign/departments/chemistry
if("Hydroponics")
sign_type = /obj/structure/sign/departments/botany
if("Xenobiology")
sign_type = /obj/structure/sign/departments/xenobio
if("Nanites Lab")
sign_type = /obj/structure/sign/departments/nanites
if("Maintenance")
sign_type = /obj/structure/sign/departments/mait
//Make sure user is adjacent still
if(!Adjacent(user))
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")
var/choice = input(user, "Select a sign type.", "Sign Customization") as null|anything in GLOB.editable_sign_types
if(!choice)
return
if(!sign_type)
if(!Adjacent(user)) //Make sure user is adjacent still.
to_chat(user, "<span class='warning'>You need to stand next to the sign to change it!</span>")
return
//It's import to clone the pixel layout information
user.visible_message("<span class='notice'>[user] begins changing [src].</span>", \
"<span class='notice'>You begin changing [src].</span>")
if(!do_after(user, 4 SECONDS, target = src)) //Small delay for changing signs instead of it being instant, so somebody could be shoved or stunned to prevent them from doing so.
return
var/sign_type = GLOB.editable_sign_types[choice]
//It's import to clone the pixel layout information.
//Otherwise signs revert to being on the turf and
//move jarringly
var/obj/structure/sign/newsign = new sign_type(get_turf(src))
newsign.pixel_x = pixel_x
newsign.pixel_y = pixel_y
//move jarringly.
var/obj/structure/sign/changedsign = new sign_type(get_turf(src))
changedsign.pixel_x = pixel_x
changedsign.pixel_y = pixel_y
changedsign.obj_integrity = obj_integrity
qdel(src)
else
return ..()
user.visible_message("<span class='notice'>[user] finishes changing the sign.</span>", \
"<span class='notice'>You finish changing the sign.</span>")
return
return ..()
/obj/item/sign_backing
name = "sign backing"
desc = "A sign with adhesive backing. Use a pen to change the decal once installed."
icon = 'icons/obj/decals.dmi'
icon_state = "backing"
w_class = WEIGHT_CLASS_NORMAL
custom_materials = list(/datum/material/plastic = 2000)
resistance_flags = FLAMMABLE
var/sign_path = /obj/structure/sign/basic //the type of sign that will be created when placed on a turf
/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")
var/choice = input(user, "Select a sign type.", "Sign Customization") as null|anything in GLOB.editable_sign_types
if(!choice)
return
if(!Adjacent(user)) //Make sure user is adjacent still.
to_chat(user, "<span class='warning'>You need to stand next to the sign to change it!</span>")
return
if(!choice)
return
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)
desc = "[initial(sign_type.desc)] It can be placed on a wall."
icon_state = initial(sign_type.icon_state)
sign_path = sign_type
user.visible_message("<span class='notice'>You finish changing the sign.</span>")
return
return ..()
/obj/item/sign_backing/afterattack(atom/target, mob/user, proximity)
/obj/item/sign/afterattack(atom/target, mob/user, proximity)
. = ..()
if(isturf(target) && proximity)
var/turf/T = target
user.visible_message("<span class='notice'>[user] fastens [src] to [T].</span>", \
"<span class='notice'>You attach the sign to [T].</span>")
playsound(T, 'sound/items/deconstruct.ogg', 50, TRUE)
var/obj/structure/sign/S = new sign_path(T)
S.setDir(dir)
qdel(src)
/obj/item/sign_backing/Move(atom/new_loc, direct = 0)
// pulling, throwing, or conveying a sign backing does not rotate it
var/old_dir = dir
. = ..()
setDir(old_dir)
/obj/item/sign_backing/attack_self(mob/user)
. = ..()
setDir(turn(dir, 90))
if(!iswallturf(target) || !proximity)
return
var/turf/target_turf = target
var/turf/user_turf = get_turf(user)
var/obj/structure/sign/placed_sign = new sign_path(user_turf) //We place the sign on the turf the user is standing, and pixel shift it to the target wall, as below.
//This is to mimic how signs and other wall objects are usually placed by mappers, and so they're only visible from one side of a wall.
var/dir = get_dir(user_turf, target_turf)
if(dir & NORTH)
placed_sign.pixel_y = 32
else if(dir & SOUTH)
placed_sign.pixel_y = -32
if(dir & EAST)
placed_sign.pixel_x = 32
else if(dir & WEST)
placed_sign.pixel_x = -32
user.visible_message("<span class='notice'>[user] fastens [src] to [target_turf].</span>", \
"<span class='notice'>You attach the sign to [target_turf].</span>")
playsound(target_turf, 'sound/items/deconstruct.ogg', 50, TRUE)
placed_sign.obj_integrity = obj_integrity
placed_sign.setDir(dir)
qdel(src)
/obj/structure/sign/nanotrasen
name = "\improper Nanotrasen logo"
name = "\improper Nanotrasen logo sign"
sign_change_name = "Corporate Logo - Nanotrasen"
desc = "A sign with the Nanotrasen logo on it. Glory to Nanotrasen!"
icon_state = "nanotrasen"
is_editable = TRUE
/obj/structure/sign/logo
name = "\improper Nanotrasen logo"
name = "\improper Nanotrasen logo sign"
desc = "The Nanotrasen corporate logo."
icon_state = "nanotrasen_sign1"
@@ -1,96 +1,163 @@
//departmental signs
/obj/structure/sign/departments/examroom
name = "\improper EXAM ROOM"
desc = "A guidance sign which reads 'EXAM ROOM'."
icon_state = "examroom"
/obj/structure/sign/departments/science //These 3 have multiple types, just var-edit the icon_state to whatever one you want on the map
name = "\improper SCIENCE"
desc = "A sign labelling an area where research and science is performed."
icon_state = "science1"
/obj/structure/sign/departments/chemistry
name = "\improper CHEMISTRY"
desc = "A sign labelling an area containing chemical equipment."
icon_state = "chemistry1"
/obj/structure/sign/departments/chemistry/pharmacy
name = "\improper PHARMACY"
desc = "A sign labelling an area containing pharmacy equipment."
icon_state = "pharmacy"
/obj/structure/sign/departments/botany
name = "\improper HYDROPONICS"
desc = "A sign labelling an area as a place where plants are grown."
icon_state = "hydro1"
/obj/structure/sign/departments/xenobio
name = "\improper XENOBIOLOGY"
desc = "A sign labelling an area as a place where xenobiological entities are researched."
icon_state = "xenobio"
/obj/structure/sign/departments/evac
name = "\improper EVACUATION"
desc = "A sign labelling an area where evacuation procedures take place."
icon_state = "evac"
/obj/structure/sign/departments/drop
name = "\improper DROP PODS"
desc = "A sign labelling an area where drop pod loading procedures take place."
icon_state = "drop"
/obj/structure/sign/departments/custodian
name = "\improper CUSTODIAN"
desc = "A sign labelling an area where the custodian works."
icon_state = "custodian"
/obj/structure/sign/departments/engineering
name = "\improper ENGINEERING"
desc = "A sign labelling an area where engineers work."
icon_state = "engine"
/obj/structure/sign/departments/cargo
name = "\improper CARGO"
desc = "A sign labelling an area where cargo ships dock."
icon_state = "cargo"
/obj/structure/sign/departments/security
name = "\improper SECURITY"
desc = "A sign labelling an area where the law is law."
icon_state = "security"
/obj/structure/sign/departments/holy
name = "\improper HOLY"
desc = "A sign labelling a religious area."
icon_state = "holy"
/obj/structure/sign/departments/restroom
name = "\improper RESTROOM"
desc = "A sign labelling a restroom."
icon_state = "restroom"
///////MEDBAY
/obj/structure/sign/departments/medbay
name = "\improper MEDBAY"
name = "\improper Medbay sign"
sign_change_name = "Department - Medbay"
desc = "The Intergalactic symbol of Medical institutions. You'll probably get help here."
icon_state = "bluecross"
is_editable = TRUE
/obj/structure/sign/departments/medbay/alt
name = "\improper Medbay sign"
sign_change_name = "Department - Medbay Alt"
desc = "The Intergalactic symbol of Medical institutions. You'll probably get help here."
icon_state = "bluecross2"
is_editable = TRUE
/obj/structure/sign/departments/mait
name = "\improper MAINTENANCE TUNNEL"
desc = "A sign labelling an area where the departments of the station are linked together."
icon_state = "mait1"
/obj/structure/sign/departments/examroom
name = "\improper Exam Room sign"
sign_change_name = "Department - Medbay: Exam Room"
desc = "A guidance sign which reads 'Exam Room'."
icon_state = "examroom"
is_editable = TRUE
/obj/structure/sign/departments/mait/alt
icon_state = "mait2"
/obj/structure/sign/departments/chemistry
name = "\improper Chemistry sign"
sign_change_name = "Department - Medbay: Chemistry"
desc = "A sign labelling an area containing chemical equipment."
icon_state = "chemistry1"
is_editable = TRUE
/obj/structure/sign/departments/nanites
name = "\improper NANITE LAB"
desc = "A sign labelling an area where testing and development of nanites is performed."
icon_state = "nanites"
/obj/structure/sign/departments/chemistry/pharmacy
name = "\improper Pharmacy sign"
sign_change_name = "Department - Medbay: Pharmacy"
desc = "A sign labelling an area containing pharmacy equipment."
icon_state = "pharmacy"
is_editable = TRUE
/obj/structure/sign/departments/psychology
name = "\improper PSYCHOLOGY"
name = "\improper Psychology sign"
sign_change_name = "Department - Medbay: Psychology"
desc = "A sign labelling where the Psychologist works, they can probably help you get your head straight."
icon_state = "psychology"
is_editable = TRUE
///////ENGINEERING
/obj/structure/sign/departments/engineering
name = "\improper Engineering sign"
sign_change_name = "Department - Engineering"
desc = "A sign labelling an area where engineers work."
icon_state = "engine"
is_editable = TRUE
///////SCIENCE
/obj/structure/sign/departments/science
name = "\improper Science sign"
sign_change_name = "Department - Science"
desc = "A sign labelling an area where research and science is performed."
icon_state = "science1"
is_editable = TRUE
/obj/structure/sign/departments/science/alt
name = "\improper Science sign"
sign_change_name = "Department - Science Alt"
desc = "A sign labelling an area where research and science is performed."
icon_state = "science2"
is_editable = TRUE
/obj/structure/sign/departments/xenobio
name = "\improper Xenobiolgoy sign"
sign_change_name = "Department - Science: Xenobiology"
desc = "A sign labelling an area as a place where xenobiological entities are researched."
icon_state = "xenobio"
is_editable = TRUE
/obj/structure/sign/departments/nanites
name = "\improper Nanite Lab sign"
sign_change_name = "Department - Science: Nanites"
desc = "A sign labelling an area where testing and development of nanites is performed."
icon_state = "nanites"
is_editable = TRUE
///////SERVICE
/obj/structure/sign/departments/botany
name = "\improper Botany sign"
sign_change_name = "Department - Botany"
desc = "A sign labelling an area as a place where plants are grown."
icon_state = "hydro1"
is_editable = TRUE
/obj/structure/sign/departments/custodian
name = "\improper Janitor sign"
sign_change_name = "Department - Janitor"
desc = "A sign labelling an area where the janitor works."
icon_state = "custodian"
is_editable = TRUE
/obj/structure/sign/departments/holy
name = "\improper Chapel sign"
sign_change_name = "Department - Chapel"
desc = "A sign labelling a religious area."
icon_state = "holy"
is_editable = TRUE
///////SUPPLY
/obj/structure/sign/departments/cargo
name = "\improper Cargo sign"
sign_change_name = "Department - Cargo"
desc = "A sign labelling an area where cargo ships dock."
icon_state = "cargo"
is_editable = TRUE
///////SECURITY
/obj/structure/sign/departments/security
name = "\improper Security sign"
sign_change_name = "Department - Security"
desc = "A sign labelling an area where the law is law."
icon_state = "security"
is_editable = TRUE
////MISC LOCATIONS
/obj/structure/sign/departments/restroom
name = "\improper Restroom sign"
sign_change_name = "Location - Restroom"
desc = "A sign labelling a restroom."
icon_state = "restroom"
is_editable = TRUE
/obj/structure/sign/departments/mait
name = "\improper Maintenance Tunnel sign"
sign_change_name = "Location - Maintenance"
desc = "A sign labelling an area where the departments of the station are linked together."
icon_state = "mait1"
is_editable = TRUE
/obj/structure/sign/departments/mait/alt
name = "\improper Maintenance Tunnel sign"
sign_change_name = "Location - Maintenance Alt"
desc = "A sign labelling an area where the departments of the station are linked together."
icon_state = "mait2"
is_editable = TRUE
/obj/structure/sign/departments/evac
name = "\improper Evacuation sign"
sign_change_name = "Location - Evacuation"
desc = "A sign labelling an area where evacuation procedures take place."
icon_state = "evac"
is_editable = TRUE
/obj/structure/sign/departments/drop
name = "\improper Drop Pods sign"
sign_change_name = "Location - Drop Pods"
desc = "A sign labelling an area where drop pod loading procedures take place."
icon_state = "drop"
is_editable = TRUE
@@ -2,7 +2,7 @@
/obj/structure/sign/map
name = "station map"
desc = "A framed picture of the station."
desc = "A navigational chart of the station."
max_integrity = 500
/obj/structure/sign/map/left
@@ -12,47 +12,47 @@
icon_state = "map-right"
/obj/structure/sign/directions/science
name = "science department"
name = "science department sign"
desc = "A direction sign, pointing out which way the Science department is."
icon_state = "direction_sci"
/obj/structure/sign/directions/engineering
name = "engineering department"
name = "engineering department sign"
desc = "A direction sign, pointing out which way the Engineering department is."
icon_state = "direction_eng"
/obj/structure/sign/directions/security
name = "security department"
name = "security department sign"
desc = "A direction sign, pointing out which way the Security department is."
icon_state = "direction_sec"
/obj/structure/sign/directions/medical
name = "medical bay"
desc = "A direction sign, pointing out which way the Medical Bay is."
name = "medbay sign"
desc = "A direction sign, pointing out which way the Medbay is."
icon_state = "direction_med"
/obj/structure/sign/directions/evac
name = "escape arm"
name = "evacuation sign"
desc = "A direction sign, pointing out which way the escape shuttle dock is."
icon_state = "direction_evac"
/obj/structure/sign/directions/supply
name = "cargo bay"
name = "cargo sign"
desc = "A direction sign, pointing out which way the Cargo Bay is."
icon_state = "direction_supply"
/obj/structure/sign/directions/command
name = "command department"
name = "command department sign"
desc = "A direction sign, pointing out which way the Command department is."
icon_state = "direction_bridge"
/obj/structure/sign/directions/vault
name = "vault directions"
name = "vault sign"
desc = "A direction sign, pointing out which way the station's Vault is."
icon_state = "direction_vault"
/obj/structure/sign/directions/upload
name = "upload directions"
name = "upload sign"
desc = "A direction sign, pointing out which way the station's AI Upload is."
icon_state = "direction_upload"
@@ -1,122 +1,181 @@
//warning signs
///////DANGEROUS THINGS
/obj/structure/sign/warning
name = "\improper WARNING"
name = "\improper WARNING sign"
sign_change_name = "Warning"
desc = "A warning sign."
icon_state = "securearea"
is_editable = TRUE
/obj/structure/sign/warning/securearea
name = "\improper SECURE AREA"
name = "\improper SECURE AREA sign"
sign_change_name = "Warning - Secure Area"
desc = "A warning sign which reads 'SECURE AREA'."
is_editable = TRUE
/obj/structure/sign/warning/docking
name = "\improper KEEP CLEAR: DOCKING AREA"
name = "\improper KEEP CLEAR: DOCKING AREA sign"
sign_change_name = "Warning - Docking Area"
desc = "A warning sign which reads 'KEEP CLEAR OF DOCKING AREA'."
is_editable = TRUE
/obj/structure/sign/warning/biohazard
name = "\improper BIOHAZARD"
name = "\improper BIOHAZARD sign"
sign_change_name = "Warning - Biohazard"
desc = "A warning sign which reads 'BIOHAZARD'."
icon_state = "bio"
is_editable = TRUE
/obj/structure/sign/warning/electricshock
name = "\improper HIGH VOLTAGE"
name = "\improper HIGH VOLTAGE sign"
sign_change_name = "Warning - High Voltage"
desc = "A warning sign which reads 'HIGH VOLTAGE'."
icon_state = "shock"
is_editable = TRUE
/obj/structure/sign/warning/vacuum
name = "\improper HARD VACUUM AHEAD"
name = "\improper HARD VACUUM AHEAD sign"
sign_change_name = "Warning - Hard Vacuum"
desc = "A warning sign which reads 'HARD VACUUM AHEAD'."
icon_state = "space"
is_editable = TRUE
/obj/structure/sign/warning/vacuum/external
name = "\improper EXTERNAL AIRLOCK"
name = "\improper EXTERNAL AIRLOCK sign"
sign_change_name = "Warning - External Airlock"
desc = "A warning sign which reads 'EXTERNAL AIRLOCK'."
layer = MOB_LAYER
is_editable = TRUE
/obj/structure/sign/warning/deathsposal
name = "\improper DISPOSAL: LEADS TO SPACE"
name = "\improper DISPOSAL: LEADS TO SPACE sign"
sign_change_name = "Warning - Disposals: Leads to Space"
desc = "A warning sign which reads 'DISPOSAL: LEADS TO SPACE'."
icon_state = "deathsposal"
is_editable = TRUE
/obj/structure/sign/warning/bodysposal
name = "\improper DISPOSAL: LEADS TO MORGUE"
name = "\improper DISPOSAL: LEADS TO MORGUE sign"
sign_change_name = "Warning - Disposals: Leads to Morgue"
desc = "A warning sign which reads 'DISPOSAL: LEADS TO MORGUE'."
icon_state = "bodysposal"
/obj/structure/sign/warning/pods
name = "\improper ESCAPE PODS"
desc = "A warning sign which reads 'ESCAPE PODS'."
icon_state = "pods"
is_editable = TRUE
/obj/structure/sign/warning/fire
name = "\improper DANGER: FIRE"
name = "\improper DANGER: FIRE sign"
sign_change_name = "Warning - Fire Hazard"
desc = "A warning sign which reads 'DANGER: FIRE'."
icon_state = "fire"
resistance_flags = FIRE_PROOF
is_editable = TRUE
/obj/structure/sign/warning/nosmoking
name = "\improper NO SMOKING"
name = "\improper NO SMOKING sign"
sign_change_name = "Warning - No Smoking"
desc = "A warning sign which reads 'NO SMOKING'."
icon_state = "nosmoking2"
resistance_flags = FLAMMABLE
is_editable = TRUE
/obj/structure/sign/warning/nosmoking/circle
name = "\improper NO SMOKING sign"
sign_change_name = "Warning - No Smoking Alt"
desc = "A warning sign which reads 'NO SMOKING'."
icon_state = "nosmoking"
is_editable = TRUE
/obj/structure/sign/warning/radiation
name = "\improper HAZARDOUS RADIATION"
name = "\improper HAZARDOUS RADIATION sign"
sign_change_name = "Warning - Radiation"
desc = "A warning sign alerting the user of potential radiation hazards."
icon_state = "radiation"
is_editable = TRUE
/obj/structure/sign/warning/radiation/rad_area
name = "\improper RADIOACTIVE AREA"
name = "\improper RADIOACTIVE AREA sign"
sign_change_name = "Warning - Radioactive Area"
desc = "A warning sign which reads 'RADIOACTIVE AREA'."
is_editable = TRUE
/obj/structure/sign/warning/xeno_mining
name = "\improper DANGEROUS ALIEN LIFE"
name = "\improper DANGEROUS ALIEN LIFE sign"
sign_change_name = "Warning - Xenos"
desc = "A sign that warns would-be travellers of hostile alien life in the vicinity."
icon = 'icons/obj/mining.dmi'
icon_state = "xeno_warning"
is_editable = TRUE
/obj/structure/sign/warning/enginesafety
name = "\improper ENGINEERING SAFETY"
name = "\improper ENGINEERING SAFETY sign"
sign_change_name = "Warning - Engineering Safety Protocols"
desc = "A sign detailing the various safety protocols when working on-site to ensure a safe shift."
icon_state = "safety"
is_editable = TRUE
/obj/structure/sign/warning/explosives
name = "\improper HIGH EXPLOSIVES"
name = "\improper HIGH EXPLOSIVES sign"
sign_change_name = "Warning - Explosives"
desc = "A warning sign which reads 'HIGH EXPLOSIVES'."
icon_state = "explosives"
is_editable = TRUE
/obj/structure/sign/warning/explosives/alt
name = "\improper HIGH EXPLOSIVES"
name = "\improper HIGH EXPLOSIVES sign"
sign_change_name = "Warning - Explosives Alt"
desc = "A warning sign which reads 'HIGH EXPLOSIVES'."
icon_state = "explosives2"
is_editable = TRUE
/obj/structure/sign/warning/testchamber
name = "\improper TESTING AREA"
desc = "A sign that warns of high-power testing equipment in the area. That's either a really powerful laser... or a satellite landing on some person's head."
name = "\improper TESTING AREA sign"
sign_change_name = "Warning - Testing Area"
desc = "A sign that warns of high-power testing equipment in the area."
icon_state = "testchamber"
is_editable = TRUE
/obj/structure/sign/warning/firingrange
name = "\improper FIRING RANGE"
name = "\improper FIRING RANGE sign"
sign_change_name = "Warning - Firing Range"
desc = "A sign reminding you to remain behind the firing line, and to wear ear protection."
icon_state = "firingrange"
is_editable = TRUE
/obj/structure/sign/warning/coldtemp
name = "\improper FREEZING AIR"
name = "\improper FREEZING AIR sign"
sign_change_name = "Warning - Temp: Cold"
desc = "A sign that warns of extremely cold air in the vicinity."
icon_state = "cold"
is_editable = TRUE
/obj/structure/sign/warning/hottemp
name = "\improper SUPERHEATED AIR"
name = "\improper SUPERHEATED AIR sign"
sign_change_name = "Warning - Temp: Hot"
desc = "A sign that warns of extremely hot air in the vicinity."
icon_state = "heat"
is_editable = TRUE
/obj/structure/sign/warning/gasmask
name = "\improper CONTAMINATED AIR"
desc = "A sign that warns of dangerous particulates in the air, instructing you to wear a filtration device."
name = "\improper CONTAMINATED AIR sign"
sign_change_name = "Warning - Contaminated Air"
desc = "A sign that warns of dangerous particulates or gasses in the air, instructing you to wear a filtration device."
icon_state = "gasmask"
is_editable = TRUE
/obj/structure/sign/warning/chemdiamond
name = "\improper REACTIVE CHEMICALS"
sign_change_name = "Warning - Hazardous Chemicals sign"
desc = "A sign that warns of potentially reactive chemicals nearby, be they explosive, flamable, or acidic."
icon_state = "chemdiamond"
is_editable = TRUE
////MISC LOCATIONS
/obj/structure/sign/warning/pods
name = "\improper ESCAPE PODS sign"
sign_change_name = "Location - Escape Pods"
desc = "A warning sign which reads 'ESCAPE PODS'."
icon_state = "pods"
is_editable = TRUE