Merge pull request #15320 from shellspeed1/working-on-new-fancy-syringe-guns

Improvements to the reagent gun and brand new smart dart repeater. [Ready]
This commit is contained in:
Putnam3145
2021-11-17 17:09:23 -08:00
committed by GitHub
6 changed files with 106 additions and 12 deletions
@@ -24,9 +24,10 @@
/obj/item/ammo_casing/chemgun
name = "dart synthesiser"
desc = "A high-power spring, linked to an energy-based dart synthesiser."
desc = "A high-power spring, linked to an energy-based piercing dart synthesiser."
projectile_type = /obj/item/projectile/bullet/dart/piercing
firing_effect_type = null
var/dartvolume = 10
/obj/item/ammo_casing/chemgun/ready_proj(atom/target, mob/living/user, quiet, zone_override = "")
if(!BB)
@@ -35,11 +36,23 @@
var/obj/item/gun/chem/CG = loc
if(CG.syringes_left <= 0)
return
CG.reagents.trans_to(BB, 10)
if (!CG.vial)
CG.syringes_left--
return
CG.vial.reagents.trans_to(BB, dartvolume)
BB.name = "chemical dart"
CG.syringes_left--
..()
//Smart dart version of reagent launcher.
/obj/item/ammo_casing/chemgun/smart
name = "smartdart synthesiser"
desc = "A high-power spring, linked to an energy-based smartdart synthesiser."
projectile_type = /obj/item/projectile/bullet/dart/syringe/dart
firing_effect_type = null
harmful = FALSE
dartvolume = 20
/obj/item/ammo_casing/dnainjector
name = "rigged syringe gun spring"
desc = "A high-power spring that throws DNA injectors."
+76 -6
View File
@@ -1,8 +1,8 @@
//his isn't a subtype of the syringe gun because the syringegun subtype is made to hold syringes
//this is meant to hold reagents/obj/item/gun/syringe
/obj/item/gun/chem
name = "reagent gun"
desc = "A Nanotrasen syringe gun, modified to automatically synthesise chemical darts, and instead hold reagents."
name = "Reagent Repeater"
desc = "A Nanotrasen smartdart repeater rifle, modified to automatically synthesize piercing darts."
icon_state = "chemgun"
item_state = "chemgun"
w_class = WEIGHT_CLASS_NORMAL
@@ -13,21 +13,79 @@
custom_materials = list(/datum/material/iron=2000)
clumsy_check = FALSE
fire_sound = 'sound/items/syringeproj.ogg'
var/time_per_syringe = 300
var/syringes_left = 5
var/max_syringes = 5
var/time_per_syringe = 200
var/syringes_left = 3
var/max_syringes = 6
var/last_synth = 0
var/obj/item/reagent_containers/glass/bottle/vial/vial
var/list/allowed_containers = list(/obj/item/reagent_containers/glass/bottle/vial/small, /obj/item/reagent_containers/glass/bottle/vial/large)
var/quickload = TRUE
/obj/item/gun/chem/Initialize()
. = ..()
chambered = new /obj/item/ammo_casing/chemgun(src)
START_PROCESSING(SSobj, src)
create_reagents(100, OPENCONTAINER)
/obj/item/gun/chem/Destroy()
. = ..()
STOP_PROCESSING(SSobj, src)
//bunch of hypospray copy paste
/obj/item/gun/chem/examine(mob/user)
. = ..()
if(vial)
. += "[vial] has [vial.reagents.total_volume]u remaining."
else
. += "It has no vial loaded in."
/obj/item/gun/chem/proc/unload_hypo(obj/item/I, mob/user)
if((istype(I, /obj/item/reagent_containers/glass/bottle/vial)))
var/obj/item/reagent_containers/glass/bottle/vial/V = I
V.forceMove(user.loc)
user.put_in_hands(V)
to_chat(user, "<span class='notice'>You remove [vial] from [src].</span>")
vial = null
update_icon()
playsound(loc, 'sound/weapons/empty.ogg', 50, 1)
else
to_chat(user, "<span class='notice'>The weapon isn't loaded!</span>")
return
/obj/item/gun/chem/attackby(obj/item/I, mob/living/user)
if((istype(I, /obj/item/reagent_containers/glass/bottle/vial)))
if(vial)
if(!quickload)
to_chat(user, "<span class='warning'>[src] can not hold more than one vial!</span>")
return FALSE
unload_hypo(vial, user)
var/obj/item/reagent_containers/glass/bottle/vial/V = I
if(!is_type_in_list(V, allowed_containers))
to_chat(user, "<span class='notice'>[src] doesn't accept this type of vial.</span>")
return FALSE
if(!user.transferItemToLoc(V,src))
return FALSE
vial = V
user.visible_message("<span class='notice'>[user] has loaded a vial into [src].</span>","<span class='notice'>You have loaded [vial] into [src].</span>")
update_icon()
playsound(loc, 'sound/weapons/autoguninsert.ogg', 35, 1)
return TRUE
else
to_chat(user, "<span class='notice'>This doesn't fit in [src].</span>")
return FALSE
/obj/item/gun/chem/on_attack_hand(mob/user, act_intent = user.a_intent, unarmed_attack_flags)
. = ..() //Don't bother changing this or removing it from containers will break.
/obj/item/gun/chem/attack_self(mob/living/user)
if(user && !user.incapacitated())
if(!vial)
to_chat(user, "This Hypo needs to be loaded first!")
else
unload_hypo(vial,user)
/obj/item/gun/chem/attack(obj/item/I, mob/user, params)
return
/obj/item/gun/chem/can_shoot()
return syringes_left
@@ -45,3 +103,15 @@
if(chambered && !chambered.BB)
chambered.newshot()
last_synth = world.time
//Smart dart version of the reagent launcher
/obj/item/gun/chem/smart
name = "Smartdart repeater rifle"
desc = "An experimental improved version of the smartdart rifle. It synthesizes medicinal smart darts which it fills using an inserted hypovial. It can accommodate both large and small hypovials."
icon_state = "chemgunrepeater"
item_state = "syringegun"
obj/item/gun/chem/smart/Initialize()
. = ..()
chambered = new /obj/item/ammo_casing/chemgun/smart(src)
@@ -127,7 +127,7 @@
/obj/item/gun/syringe/dart/rapiddart
name = "Repeating dart gun"
icon_state = "rapiddartgun"
item_state = "rapiddartgun"
item_state = "syringegun"
/obj/item/gun/syringe/dart/rapiddart/CheckParts(list/parts_list)
var/obj/item/reagent_containers/glass/beaker/B = locate(/obj/item/reagent_containers/glass/beaker) in parts_list
@@ -157,7 +157,7 @@
name = "blowgun"
desc = "Fire syringes at a short distance."
icon_state = "blowgun"
item_state = "blowgun"
item_state = "syringegun"
fire_sound = 'sound/items/syringeproj.ogg'
/obj/item/gun/syringe/blowgun/process_fire(atom/target, mob/living/user, message = TRUE, params = null, zone_override = "", bonus_spread = 0, stam_cost = 0)
@@ -122,6 +122,17 @@
category = list("Medical Designs")
departmental_flags = DEPARTMENTAL_FLAG_MEDICAL
/datum/design/smartdartrepeater
name = "Smartdart Repeater"
desc = "An experimental smartdart rifle. It can make its own smart darts and is loaded with a hypovial."
id = "smartdartrepeater"
build_type = PROTOLATHE
materials = list(/datum/material/glass = 2000, /datum/material/plastic = 1000, /datum/material/iron = 2000,/datum/material/titanium = 1000 )
build_path = /obj/item/gun/chem/smart
category = list("Medical Designs")
departmental_flags = DEPARTMENTAL_FLAG_MEDICAL
/datum/design/plasmarefiller
name = "Plasma-Man Jumpsuit Refill"
desc = "A refill pack for the auto-extinguisher on Plasma-man suits."
@@ -201,7 +212,7 @@
build_path = /obj/item/storage/hypospraykit // let's not summon new hyposprays thanks
category = list("Medical Designs")
departmental_flags = DEPARTMENTAL_FLAG_MEDICAL | DEPARTMENTAL_FLAG_SCIENCE
/datum/design/hypospray/mkii
name = "Hypospray Mk. II"
id = "hypospray_mkii"
@@ -45,7 +45,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","smartdartrepeater")
research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 2000)
/datum/techweb_node/beam_weapons