mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-29 08:08:49 +01:00
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:
@@ -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)
|
||||
@@ -0,0 +1,49 @@
|
||||
//These are static plaques, they are made of gold and start engraved with a title and description.
|
||||
|
||||
/obj/structure/plaque/static_plaque
|
||||
engraved = TRUE
|
||||
|
||||
/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/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/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/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\"."
|
||||
icon_state = "kiddieplaque"
|
||||
|
||||
/obj/structure/sign/plaques/kiddie/badger
|
||||
name = "\improper Remembrance Plaque"
|
||||
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 = "\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
|
||||
name = "\improper 'Perfect Man' sign"
|
||||
desc = "A guide to the exhibit, explaining how recent developments in mindshield implant and cloning technologies by Nanotrasen Corporation have led to the development and the effective immortality of the 'perfect man', the loyal Nanotrasen Employee."
|
||||
|
||||
/obj/structure/sign/plaques/kiddie/perfect_drone
|
||||
name = "\improper 'Perfect Drone' sign"
|
||||
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 = "\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"
|
||||
Reference in New Issue
Block a user