Files
fulpstation/code/modules/projectiles/guns/misc/chem_gun.dm
Qustinnus a394ccdc2b Material datum chairs & tables and applies materials to all items (Now with less pain for mining & RnD) (#46525)
removes materials list from items, uses custom_materials instead. This might introduce some bugs so we should testmerge this for a while (and Ill test stuff locally as much as I can)

this also adds material crafting to sheets. Test case being chairs. In the future we can add stuff like tables, walls, doors etc.

also applies materials to everything, with fixes, which can close #46299
2019-10-08 11:06:02 -04:00

47 lines
1.4 KiB
Plaintext

//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."
icon_state = "chemgun"
item_state = "chemgun"
w_class = WEIGHT_CLASS_NORMAL
throw_speed = 3
throw_range = 7
force = 4
custom_materials = list(/datum/material/iron=2000)
clumsy_check = FALSE
fire_sound = 'sound/items/syringeproj.ogg'
var/time_per_syringe = 250
var/syringes_left = 4
var/max_syringes = 4
var/last_synth = 0
/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)
/obj/item/gun/chem/can_shoot()
return syringes_left
/obj/item/gun/chem/process_chamber()
if(chambered && !chambered.BB && syringes_left)
chambered.newshot()
/obj/item/gun/chem/process()
if(syringes_left >= max_syringes)
return
if(world.time < last_synth+time_per_syringe)
return
to_chat(loc, "<span class='warning'>You hear a click as [src] synthesizes a new dart.</span>")
syringes_left++
if(chambered && !chambered.BB)
chambered.newshot()
last_synth = world.time