mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-22 12:41:09 +01:00
[MIRROR] Cargo boxcutter [MDB IGNORE] (#16582)
* Cargo boxcutter (#70170) Co-authored-by: Mothblocks <35135081+Mothblocks@ users.noreply.github.com> * Cargo boxcutter Co-authored-by: Shadyyy66 <114319683+Shadyyy66@users.noreply.github.com> Co-authored-by: Mothblocks <35135081+Mothblocks@ users.noreply.github.com>
This commit is contained in:
co-authored by
Mothblocks
Shadyyy66
parent
797bf51117
commit
2b60c5d7a3
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 ..()
|
||||
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -170,6 +170,7 @@
|
||||
design_ids = list(
|
||||
"airlock_painter",
|
||||
"analyzer",
|
||||
"boxcutter",
|
||||
"cable_coil",
|
||||
"cable_coil",
|
||||
"crowbar",
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 406 B |
Binary file not shown.
|
After Width: | Height: | Size: 381 B |
Binary file not shown.
|
After Width: | Height: | Size: 684 B |
Binary file not shown.
Binary file not shown.
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user