diff --git a/code/game/objects/items/weapons/material/gravemarker.dm b/code/game/objects/items/weapons/material/gravemarker.dm new file mode 100644 index 0000000000..f04e7f5e1b --- /dev/null +++ b/code/game/objects/items/weapons/material/gravemarker.dm @@ -0,0 +1,74 @@ +/obj/item/weapon/material/gravemarker + name = "grave marker" + desc = "An object used in marking graves." + icon_state = "gravestone" + w_class = ITEMSIZE_LARGE + fragile = 1 + force_divisor = 0.65 + thrown_force_divisor = 0.25 + + var/icon_changes = 0 //Does the sprite change when you put words on it? + var/grave_name = "" //Name of the intended occupant + var/epitaph = "" //A quick little blurb + +/obj/item/weapon/material/gravemarker/attackby(obj/item/weapon/W, mob/user as mob) + if(istype(W, /obj/item/weapon/screwdriver)) + var/carving_1 = sanitizeSafe(input(user, "Who is \the [src.name] for?", "Gravestone Naming", null) as text, MAX_NAME_LEN) + if(carving_1) + user.visible_message() + if(do_after(user, material.hardness * W.toolspeed)) + user.visible_message("[user] carves something into \the [src.name].", "You carve your message into \the [src.name].") + grave_name += carving_1 + update_icon() + var/carving_2 = sanitizeSafe(input(user, "What message should \the [src.name] have?", "Epitaph Carving", null) as text, MAX_NAME_LEN) + if(carving_2) + user.visible_message() + if(do_after(user, material.hardness * W.toolspeed)) + user.visible_message("[user] carves something into \the [src.name].", "You carve your message into \the [src.name].") + epitaph += carving_2 + update_icon() + + ..() + +/obj/item/weapon/material/gravemarker/examine(mob/user) + ..() + if(get_dist(src, user) < 4) + if(grave_name) + to_chat(user, "Here Lies [grave_name]") + if(get_dist(src, user) < 2) + if(epitaph) + to_chat(user, epitaph) + +/obj/item/weapon/material/gravemarker/update_icon() + if(icon_changes) + if(grave_name && epitaph) + icon_state = "[initial(icon_state)]_3" + else if(grave_name) + icon_state = "[initial(icon_state)]_1" + else if(epitaph) + icon_state = "[initial(icon_state)]_2" + else + icon_state = initial(icon_state) + + ..() + +/obj/item/weapon/material/gravemarker/attack_self(mob/user) + src.add_fingerprint(user) + + if(!isturf(user.loc)) + return 0 + + if(locate(/obj/structure/gravemarker, user.loc)) + to_chat(user, "There's already something there.") + return 0 + else + to_chat(user, "You begin to place \the [src.name].") + if(!do_after(usr, 10)) + return 0 + var/obj/structure/gravemarker/G = new /obj/structure/gravemarker/(user.loc, src.get_material()) + to_chat(user, "You place \the [src.name].") + G.grave_name = grave_name + G.epitaph = epitaph + G.add_fingerprint(usr) + qdel_null(src) + return \ No newline at end of file diff --git a/code/game/objects/structures/gravemarker.dm b/code/game/objects/structures/gravemarker.dm new file mode 100644 index 0000000000..117e28898d --- /dev/null +++ b/code/game/objects/structures/gravemarker.dm @@ -0,0 +1,117 @@ +/obj/structure/gravemarker + name = "grave marker" + desc = "An object used in marking graves." + icon_state = "gravestone" + + density = 1 + anchored = 1 + + //Maybe make these calculate based on material? + var/health = 100 + + var/grave_name = "" //Name of the intended occupant + var/epitaph = "" //A quick little blurb +// var/dir_locked = 0 //Can it be spun? Not currently implemented + + var/material/material + +/obj/structure/gravemarker/New(var/newloc, var/material_name) + ..(newloc) + if(!material_name) + material_name = "wood" + material = get_material_by_name("[material_name]") + if(!material) + qdel(src) + return + color = material.icon_colour + +/obj/structure/gravemarker/examine(mob/user) + ..() + if(get_dist(src, user) < 4) + if(grave_name) + to_chat(user, "Here Lies [grave_name]") + if(get_dist(src, user) < 2) + if(epitaph) + to_chat(user, epitaph) + +/obj/structure/gravemarker/attackby(obj/item/weapon/W, mob/user as mob) + if(istype(W, /obj/item/weapon/screwdriver)) + var/carving_1 = sanitizeSafe(input(user, "Who is \the [src.name] for?", "Gravestone Naming", null) as text, MAX_NAME_LEN) + if(carving_1) + user.visible_message("[user] starts carving \the [src.name].", "You start carving \the [src.name].") + if(do_after(user, material.hardness * W.toolspeed)) + user.visible_message("[user] carves something into \the [src.name].", "You carve your message into \the [src.name].") + grave_name += carving_1 + update_icon() + var/carving_2 = sanitizeSafe(input(user, "What message should \the [src.name] have?", "Epitaph Carving", null) as text, MAX_NAME_LEN) + if(carving_2) + user.visible_message("[user] starts carving \the [src.name].", "You start carving \the [src.name].") + if(do_after(user, material.hardness * W.toolspeed)) + user.visible_message("[user] carves something into \the [src.name].", "You carve your message into \the [src.name].") + epitaph += carving_2 + update_icon() + return + if(istype(W, /obj/item/weapon/wrench)) + user.visible_message("[user] starts taking down \the [src.name].", "You start taking down \the [src.name].") + if(do_after(user, 50 * W.toolspeed)) + user.visible_message("[user] takes down \the [src.name].", "You take down \the [src.name].") + dismantle() + ..() + +/obj/structure/gravemarker/bullet_act(var/obj/item/projectile/Proj) + var/proj_damage = Proj.get_structure_damage() + if(!proj_damage) + return + + ..() + damage(proj_damage) + + return + +/obj/structure/gravemarker/ex_act(severity) + switch(severity) + if(1.0) + visible_message("\The [src] is blown apart!") + qdel(src) + return + if(2.0) + visible_message("\The [src] is blown apart!") + if(prob(50)) + dismantle() + else + qdel(src) + return + +/obj/structure/gravemarker/proc/damage(var/damage) + health -= damage + if(health <= 0) + visible_message("\The [src] falls apart!") + dismantle() + +/obj/structure/gravemarker/proc/dismantle() + material.place_dismantled_product(get_turf(src)) + qdel(src) + return + +/* //Need Directional Sprites +/obj/structure/gravemarker/verb/rotate() + set name = "Rotate Grave Marker" + set category = "Object" + set src in oview(1) + + if(dir_locked) + return + if(config.ghost_interaction) + src.set_dir(turn(src.dir, 90)) + return + else + if(istype(usr,/mob/living/simple_animal/mouse)) + return + if(!usr || !isturf(usr.loc)) + return + if(usr.stat || usr.restrained()) + return + + src.set_dir(turn(src.dir, 90)) + return +*/ \ No newline at end of file diff --git a/code/modules/materials/material_recipes.dm b/code/modules/materials/material_recipes.dm index 12e264135e..99abbe2e12 100644 --- a/code/modules/materials/material_recipes.dm +++ b/code/modules/materials/material_recipes.dm @@ -11,6 +11,7 @@ recipes += new/datum/stack_recipe("[display_name] ashtray", /obj/item/weapon/material/ashtray, 2, one_per_turf = 1, on_floor = 1, supplied_material = "[name]") recipes += new/datum/stack_recipe("[display_name] spoon", /obj/item/weapon/material/kitchen/utensil/spoon/plastic, 1, on_floor = 1, supplied_material = "[name]") recipes += new/datum/stack_recipe("[display_name] armor plate", /obj/item/weapon/material/armor_plating, 1, time = 20, on_floor = 1, supplied_material = "[name]") + recipes += new/datum/stack_recipe("[display_name] grave marker", /obj/item/weapon/material/gravemarker, 5, time = 50, supplied_material = "[name]") if(integrity>=50) recipes += new/datum/stack_recipe("[display_name] door", /obj/structure/simple_door, 10, one_per_turf = 1, on_floor = 1, supplied_material = "[name]") diff --git a/icons/obj/structures.dmi b/icons/obj/structures.dmi index 341f5a33c0..f78d4f8b1f 100644 Binary files a/icons/obj/structures.dmi and b/icons/obj/structures.dmi differ diff --git a/icons/obj/weapons.dmi b/icons/obj/weapons.dmi index 5f38ccd3a3..bb78283095 100644 Binary files a/icons/obj/weapons.dmi and b/icons/obj/weapons.dmi differ diff --git a/polaris.dme b/polaris.dme index 5fcf40ea94..efe288ea15 100644 --- a/polaris.dme +++ b/polaris.dme @@ -922,6 +922,7 @@ #include "code\game\objects\items\weapons\material\ashtray.dm" #include "code\game\objects\items\weapons\material\bats.dm" #include "code\game\objects\items\weapons\material\foam.dm" +#include "code\game\objects\items\weapons\material\gravemarker.dm" #include "code\game\objects\items\weapons\material\kitchen.dm" #include "code\game\objects\items\weapons\material\knives.dm" #include "code\game\objects\items\weapons\material\material_armor.dm" @@ -967,6 +968,7 @@ #include "code\game\objects\structures\flora.dm" #include "code\game\objects\structures\ghost_pods.dm" #include "code\game\objects\structures\girders.dm" +#include "code\game\objects\structures\gravemarker.dm" #include "code\game\objects\structures\grille.dm" #include "code\game\objects\structures\inflatable.dm" #include "code\game\objects\structures\janicart.dm"