diff --git a/code/modules/projectiles/ammunition/ballistic/shotgun.dm b/code/modules/projectiles/ammunition/ballistic/shotgun.dm index 6f5e38ffbc38..a8f463e4ca5a 100644 --- a/code/modules/projectiles/ammunition/ballistic/shotgun.dm +++ b/code/modules/projectiles/ammunition/ballistic/shotgun.dm @@ -133,12 +133,30 @@ name = "shotgun dart" desc = "A dart for use in shotguns. Can be injected with up to 30 units of any chemical." icon_state = "cshell" - projectile_type = /obj/item/projectile/bullet/dart + projectile_type = /obj/item/projectile/bullet/reusable/dart var/reagent_amount = 30 + var/no_react = FALSE /obj/item/ammo_casing/shotgun/dart/Initialize() . = ..() create_reagents(reagent_amount, OPENCONTAINER) + if(no_react) + ENABLE_BITFIELD(reagents.flags, NO_REACT) + +/obj/item/ammo_casing/shotgun/dart/ready_proj(atom/target, mob/living/user, quiet, zone_override = "") + if(!BB) + return + if(reagents.total_volume < 0) + return + var/obj/item/projectile/bullet/reusable/dart/D = BB + var/obj/item/reagent_containers/syringe/dart/temp/new_dart = new(D) + + new_dart.volume = reagents.total_volume + if(no_react) + new_dart.reagent_flags |= NO_REACT + reagents.trans_to(new_dart, reagents.total_volume, transfered_by = user) + D.add_dart(new_dart) + ..() /obj/item/ammo_casing/shotgun/dart/attackby() return @@ -148,10 +166,7 @@ desc = "A dart for use in shotguns, using similar technology as cryostatis beakers to keep internal reagents from reacting. Can be injected with up to 10 units of any chemical." icon_state = "cnrshell" reagent_amount = 10 - -/obj/item/ammo_casing/shotgun/dart/noreact/Initialize() - . = ..() - ENABLE_BITFIELD(reagents.flags, NO_REACT) + no_react = TRUE /obj/item/ammo_casing/shotgun/dart/bioterror desc = "A shotgun dart filled with deadly toxins." diff --git a/code/modules/projectiles/ammunition/special/syringe.dm b/code/modules/projectiles/ammunition/special/syringe.dm index b4f6f4397fd5..2762b7c1598f 100644 --- a/code/modules/projectiles/ammunition/special/syringe.dm +++ b/code/modules/projectiles/ammunition/special/syringe.dm @@ -1,7 +1,7 @@ /obj/item/ammo_casing/syringegun name = "syringe gun spring" desc = "A high-power spring that throws syringes." - projectile_type = /obj/item/projectile/bullet/dart/syringe + projectile_type = /obj/item/projectile/bullet/reusable/dart/syringe firing_effect_type = null /obj/item/ammo_casing/syringegun/ready_proj(atom/target, mob/living/user, quiet, zone_override = "") @@ -9,23 +9,21 @@ return if(istype(loc, /obj/item/gun/syringe)) var/obj/item/gun/syringe/SG = loc + var/obj/item/projectile/bullet/reusable/dart/D = BB if(!SG.syringes.len) return var/obj/item/reagent_containers/syringe/S = SG.syringes[1] S.reagents.trans_to(BB, S.reagents.total_volume, transfered_by = user) - BB.name = S.name - var/obj/item/projectile/bullet/dart/D = BB - D.piercing = S.proj_piercing + D.add_dart(S) SG.syringes.Remove(S) - qdel(S) ..() /obj/item/ammo_casing/chemgun name = "dart synthesiser" desc = "A high-power spring, linked to an energy-based dart synthesiser." - projectile_type = /obj/item/projectile/bullet/dart + projectile_type = /obj/item/projectile/bullet/reusable/dart firing_effect_type = null /obj/item/ammo_casing/chemgun/ready_proj(atom/target, mob/living/user, quiet, zone_override = "") @@ -35,8 +33,11 @@ var/obj/item/gun/chem/CG = loc if(CG.syringes_left <= 0) return - CG.reagents.trans_to(BB, 15, transfered_by = user) - BB.name = "chemical dart" + var/obj/item/projectile/bullet/reusable/dart/D = BB + var/obj/item/reagent_containers/syringe/dart/temp/new_dart = new(D) + + CG.reagents.trans_to(new_dart, 15, transfered_by = user) + D.add_dart(new_dart) CG.syringes_left-- ..() diff --git a/code/modules/projectiles/projectile/bullets/dart_syringe.dm b/code/modules/projectiles/projectile/bullets/dart_syringe.dm index b8f3782a8a5f..824ca0c88040 100644 --- a/code/modules/projectiles/projectile/bullets/dart_syringe.dm +++ b/code/modules/projectiles/projectile/bullets/dart_syringe.dm @@ -1,38 +1,42 @@ -/obj/item/projectile/bullet/dart +/obj/item/projectile/bullet/reusable/dart name = "dart" icon_state = "cbbolt" damage = 6 + var/obj/item/reagent_containers/container var/piercing = FALSE -/obj/item/projectile/bullet/dart/Initialize() +/obj/item/projectile/bullet/reusable/dart/Initialize() . = ..() - create_reagents(50, NO_REACT) -/obj/item/projectile/bullet/dart/on_hit(atom/target, blocked = FALSE) +/obj/item/projectile/bullet/reusable/dart/on_hit(atom/target, blocked = FALSE) if(iscarbon(target)) - var/mob/living/carbon/M = target + var/mob/living/carbon/C = target if(blocked != 100) // not completely blocked - if(M.can_inject(null, FALSE, def_zone, piercing)) // Pass the hit zone to see if it can inject by whether it hit the head or the body. + if(C.embed_object(container, def_zone, FALSE)) + dropped = TRUE ..() - reagents.reaction(M, INJECT) - reagents.trans_to(M, reagents.total_volume) return BULLET_ACT_HIT else blocked = 100 - target.visible_message(span_danger("\The [src] was deflected!"), \ - span_userdanger("You were protected against \the [src]!")) + target.visible_message(span_danger("\The [container] was deflected!"), \ + span_userdanger("You were protected against \the [container]!")) ..(target, blocked) - DISABLE_BITFIELD(reagents.flags, NO_REACT) - reagents.handle_reactions() return BULLET_ACT_HIT -/obj/item/projectile/bullet/dart/metalfoam/Initialize() - . = ..() - reagents.add_reagent(/datum/reagent/aluminium, 15) - reagents.add_reagent(/datum/reagent/foaming_agent, 5) - reagents.add_reagent(/datum/reagent/toxin/acid/fluacid, 5) +/obj/item/projectile/bullet/reusable/dart/handle_drop() + if(!dropped) + container.forceMove(get_turf(src)) + dropped = TRUE -/obj/item/projectile/bullet/dart/syringe +/obj/item/projectile/bullet/reusable/dart/proc/add_dart(obj/item/reagent_containers/new_dart) + container = new_dart + new_dart.forceMove(src) + name = new_dart.name + if(istype(new_dart, /obj/item/reagent_containers/syringe)) + var/obj/item/reagent_containers/syringe/syringe + piercing = syringe.proj_piercing + +/obj/item/projectile/bullet/reusable/dart/syringe name = "syringe" icon_state = "syringeproj" diff --git a/code/modules/reagents/reagent_containers/syringes.dm b/code/modules/reagents/reagent_containers/syringes.dm index 34f60617b199..6a7c441e9d99 100644 --- a/code/modules/reagents/reagent_containers/syringes.dm +++ b/code/modules/reagents/reagent_containers/syringes.dm @@ -15,6 +15,7 @@ materials = list(/datum/material/iron=10, /datum/material/glass=20) reagent_flags = TRANSPARENT sharpness = SHARP_POINTY + embedding = list("embedded_pain_chance" = 0, "embedded_pain_multiplier" = 0, "embedded_unsafe_removal_time" = 0.25 SECONDS, "embedded_unsafe_removal_pain_multiplier" = 0, "embed_chance" = 15, "embedded_fall_chance" = 5) /obj/item/reagent_containers/syringe/Initialize() . = ..() @@ -193,6 +194,12 @@ injoverlay = "inject" add_overlay(injoverlay) M.update_inv_hands() + +/obj/item/reagent_containers/syringe/on_embed(mob/living/carbon/human/embedde, obj/item/bodypart/part) + reagents.trans_to(embedde, amount_per_transfer_from_this) + +/obj/item/reagent_containers/syringe/embed_tick(embedde, part) + reagents.trans_to(embedde, amount_per_transfer_from_this * 0.2) /obj/item/reagent_containers/syringe/epinephrine name = "syringe (epinephrine)" @@ -286,7 +293,6 @@ desc = "A diamond-tipped syringe that pierces armor when launched at high velocity. It can hold up to 10 units." volume = 10 proj_piercing = 1 - /obj/item/reagent_containers/syringe/crude name = "crude syringe" desc = "A crudely made syringe. The flimsy wooden construction makes it hold up minimal amounts of reagents." @@ -296,3 +302,15 @@ name = "spider extract syringe" desc = "Contains crikey juice - makes any gold core create the most deadly companions in the world." list_reagents = list(/datum/reagent/spider_extract = 1) + +/obj/item/reagent_containers/syringe/dart + name = "reagent dart" + amount_per_transfer_from_this = 10 + embedding = list("embed_chance" = 15, "embedded_fall_chance" = 0) + +/obj/item/reagent_containers/syringe/dart/temp + item_flags = DROPDEL + +/obj/item/reagent_containers/syringe/dart/temp/on_embed_removal(mob/living/carbon/human/embedde) + qdel(src) + \ No newline at end of file diff --git a/code/modules/research/designs/medical_designs.dm b/code/modules/research/designs/medical_designs.dm index 0e2910cdf84a..349eacbf9eb1 100644 --- a/code/modules/research/designs/medical_designs.dm +++ b/code/modules/research/designs/medical_designs.dm @@ -102,6 +102,16 @@ category = list("Medical Designs") departmental_flags = DEPARTMENTAL_FLAG_MEDICAL +/datum/design/dartsyringe + name = "Reagent Dart" + desc = "A specialized syringe that quickly inject reagent. It can hold up to 15 units." + id = "dartsyringe" + build_type = PROTOLATHE + materials = list(/datum/material/glass = 2500) + build_path = /obj/item/reagent_containers/syringe/dart + category = list("Medical Designs") + departmental_flags = DEPARTMENTAL_FLAG_MEDICAL + /datum/design/bluespacebodybag name = "Bluespace Body Bag" desc = "A bluespace body bag, powered by experimental bluespace technology. It can hold loads of bodies and the largest of creatures." diff --git a/code/modules/research/techweb/all_nodes.dm b/code/modules/research/techweb/all_nodes.dm index f536cdef4f63..379a85fd275e 100644 --- a/code/modules/research/techweb/all_nodes.dm +++ b/code/modules/research/techweb/all_nodes.dm @@ -733,7 +733,7 @@ display_name = "Medical Weaponry" description = "Weapons using medical technology." prereq_ids = list("adv_biotech", "adv_weaponry") - design_ids = list("rapidsyringe", "shotgundartcryostatis") + design_ids = list("rapidsyringe", "shotgundartcryostatis", "dartsyringe") research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 2500) export_price = 5000