diff --git a/code/game/objects/items/boxcutter.dm b/code/game/objects/items/boxcutter.dm new file mode 100644 index 00000000000..cb03fde682f --- /dev/null +++ b/code/game/objects/items/boxcutter.dm @@ -0,0 +1,48 @@ +/obj/item/boxcutter + name = "boxcutter" + desc = "A tool for cutting boxes, or throats." + icon = 'icons/obj/boxcutter.dmi' + icon_state = "boxcutter" + base_icon_state = "boxcutter" + lefthand_file = 'icons/mob/inhands/equipment/boxcutter_lefthand.dmi' + righthand_file = 'icons/mob/inhands/equipment/boxcutter_righthand.dmi' + inhand_icon_state = null + attack_verb_continuous = list("prods", "pokes") + attack_verb_simple = list("prod", "poke") + w_class = WEIGHT_CLASS_SMALL + resistance_flags = FIRE_PROOF + force = 0 + var/start_extended = FALSE + /// Whether or not the boxcutter has been readied + var/on = FALSE + var/on_sound = 'sound/items/boxcutter_activate.ogg' + +/obj/item/boxcutter/Initialize(mapload) + . = ..() + AddElement(/datum/element/update_icon_updates_onmob, ITEM_SLOT_HANDS) + AddComponent(/datum/component/butchering, \ + speed = 7 SECONDS, \ + effectiveness = 100, \ + ) + tool_behaviour = TOOL_KNIFE + AddComponent(/datum/component/transforming, \ + start_transformed = start_extended, \ + force_on = 10, \ + throwforce_on = 4, \ + throw_speed_on = throw_speed, \ + sharpness_on = SHARP_EDGED, \ + hitsound_on = 'sound/weapons/bladeslice.ogg', \ + w_class_on = WEIGHT_CLASS_NORMAL, \ + attack_verb_continuous_on = list("cuts", "stabs", "slashes"), \ + attack_verb_simple_on = list("cut", "stab", "slash"), \ + ) + + RegisterSignal(src, COMSIG_TRANSFORMING_ON_TRANSFORM, .proc/on_transform) + +/obj/item/boxcutter/proc/on_transform(obj/item/source, mob/user, active) + SIGNAL_HANDLER + + on = active + playsound(src, on_sound, 50) + return COMPONENT_NO_DEFAULT_MESSAGE + diff --git a/code/modules/jobs/job_types/cargo_technician.dm b/code/modules/jobs/job_types/cargo_technician.dm index 37d275aa00d..c6f201a17a1 100644 --- a/code/modules/jobs/job_types/cargo_technician.dm +++ b/code/modules/jobs/job_types/cargo_technician.dm @@ -39,6 +39,9 @@ name = "Cargo Technician" jobtype = /datum/job/cargo_technician + backpack_contents = list( + /obj/item/boxcutter = 1, + ) id_trim = /datum/id_trim/job/cargo_technician uniform = /obj/item/clothing/under/rank/cargo/tech belt = /obj/item/modular_computer/tablet/pda/cargo diff --git a/code/modules/recycling/sortingmachinery.dm b/code/modules/recycling/sortingmachinery.dm index 3f1fadc05cf..7880ef8390e 100644 --- a/code/modules/recycling/sortingmachinery.dm +++ b/code/modules/recycling/sortingmachinery.dm @@ -12,9 +12,9 @@ /** * Initial check if manually unwrapping */ -/obj/item/delivery/proc/attempt_pre_unwrap_contents(mob/user) +/obj/item/delivery/proc/attempt_pre_unwrap_contents(mob/user, time = 1.5 SECONDS) to_chat(user, span_notice("You start to unwrap the package...")) - return do_after(user, 15, target = user) + return do_after(user, time, target = user) /** * Signals for unwrapping. @@ -28,11 +28,14 @@ /** * Effects after completing unwrapping */ -/obj/item/delivery/proc/post_unwrap_contents(mob/user) +/obj/item/delivery/proc/post_unwrap_contents(mob/user, rip_open = TRUE) var/turf/turf_loc = get_turf(user || src) - playsound(loc, 'sound/items/poster_ripped.ogg', 50, TRUE) - new /obj/effect/decal/cleanable/wrapping(turf_loc) - + if(rip_open) + playsound(loc, 'sound/items/poster_ripped.ogg', 50, TRUE) + new /obj/effect/decal/cleanable/wrapping(turf_loc) + else + playsound(loc, 'sound/items/box_cut.ogg', 50, TRUE) + new /obj/item/stack/package_wrap(turf_loc, 1) for(var/atom/movable/movable_content as anything in contents) movable_content.forceMove(turf_loc) @@ -185,6 +188,17 @@ wrapped_item.AddComponent(/datum/component/pricetag, sticker.payments_acc, sticker.cut_multiplier) update_appearance() + else if(istype(item, /obj/item/boxcutter)) + var/obj/item/boxcutter/boxcutter_item = item + if(boxcutter_item.on) + if(!attempt_pre_unwrap_contents(user, time = 0.5 SECONDS)) + return + unwrap_contents() + balloon_alert(user, "cutting open package...") + post_unwrap_contents(user, rip_open = FALSE) + else + balloon_alert(user, "prime the boxcutter!") + else return ..() diff --git a/code/modules/research/designs/autolathe_designs.dm b/code/modules/research/designs/autolathe_designs.dm index 45317e74914..dfde6740c66 100644 --- a/code/modules/research/designs/autolathe_designs.dm +++ b/code/modules/research/designs/autolathe_designs.dm @@ -327,6 +327,15 @@ category = list(RND_CATEGORY_INITIAL, RND_CATEGORY_MISC, RND_CATEGORY_EQUIPMENT) departmental_flags = DEPARTMENT_BITFLAG_ENGINEERING | DEPARTMENT_BITFLAG_CARGO +/datum/design/boxcutter + name = "Boxcutter" + id = "boxcutter" + build_type = AUTOLATHE | PROTOLATHE + materials = list(/datum/material/iron = 4000, /datum/material/plastic = 500) + build_path = /obj/item/boxcutter + category = list(RND_CATEGORY_INITIAL, RND_CATEGORY_TOOLS, RND_CATEGORY_EQUIPMENT, RND_CATEGORY_MISC) + departmental_flags = DEPARTMENT_BITFLAG_CARGO + /datum/design/iron name = "Iron" id = "iron" diff --git a/code/modules/research/techweb/all_nodes.dm b/code/modules/research/techweb/all_nodes.dm index 583eedcfc00..c2a41343517 100644 --- a/code/modules/research/techweb/all_nodes.dm +++ b/code/modules/research/techweb/all_nodes.dm @@ -170,6 +170,7 @@ design_ids = list( "airlock_painter", "analyzer", + "boxcutter", "cable_coil", "cable_coil", "crowbar", diff --git a/icons/mob/inhands/equipment/boxcutter_lefthand.dmi b/icons/mob/inhands/equipment/boxcutter_lefthand.dmi new file mode 100644 index 00000000000..73f563d66d6 Binary files /dev/null and b/icons/mob/inhands/equipment/boxcutter_lefthand.dmi differ diff --git a/icons/mob/inhands/equipment/boxcutter_righthand.dmi b/icons/mob/inhands/equipment/boxcutter_righthand.dmi new file mode 100644 index 00000000000..d83a9f2fe65 Binary files /dev/null and b/icons/mob/inhands/equipment/boxcutter_righthand.dmi differ diff --git a/icons/obj/boxcutter.dmi b/icons/obj/boxcutter.dmi new file mode 100644 index 00000000000..dd920507563 Binary files /dev/null and b/icons/obj/boxcutter.dmi differ diff --git a/sound/items/box_cut.ogg b/sound/items/box_cut.ogg new file mode 100644 index 00000000000..32637b2a3dd Binary files /dev/null and b/sound/items/box_cut.ogg differ diff --git a/sound/items/boxcutter_activate.ogg b/sound/items/boxcutter_activate.ogg new file mode 100644 index 00000000000..6700c6d03fd Binary files /dev/null and b/sound/items/boxcutter_activate.ogg differ diff --git a/tgstation.dme b/tgstation.dme index 61c76056257..99fcbbad3e1 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -1621,6 +1621,7 @@ #include "code\game\objects\items\body_egg.dm" #include "code\game\objects\items\bodybag.dm" #include "code\game\objects\items\bouquets.dm" +#include "code\game\objects\items\boxcutter.dm" #include "code\game\objects\items\broom.dm" #include "code\game\objects\items\candle.dm" #include "code\game\objects\items\cardboard_cutouts.dm"