Merge pull request #9505 from Thalpy/Smartdart-QoL

[READY] Tweaks smartdarts with a few quality of life functions, and add a few new things.
This commit is contained in:
kevinz000
2019-10-17 13:23:33 -07:00
committed by GitHub
10 changed files with 126 additions and 24 deletions
+19 -6
View File
@@ -899,16 +899,30 @@
/datum/crafting_recipe/smartdartgun
name = "Smart dartgun"
result = /obj/item/gun/syringe/dart
reqs = list(/obj/item/stack/sheet/metal = 15,
/obj/item/stack/sheet/glass = 10,
reqs = list(/obj/item/stack/sheet/metal = 10,
/obj/item/stack/sheet/glass = 5,
/obj/item/tank/internals = 1,
/obj/item/reagent_containers/glass/beaker = 1,
/obj/item/stack/sheet/plastic = 10,
/obj/item/stack/cable_coil = 2)
/obj/item/stack/sheet/plastic = 5,
/obj/item/stack/cable_coil = 1)
time = 150 //It's a gun
category = CAT_WEAPONRY
subcategory = CAT_WEAPON
/datum/crafting_recipe/rapiddartgun
name = "Rapid Smart dartgun"
result = /obj/item/gun/syringe/dart/rapiddart
reqs = list(
/obj/item/gun/syringe/dart = 1,
/obj/item/stack/sheet/plastic = 5,
/obj/item/stack/cable_coil = 1,
/obj/item/reagent_containers/glass/beaker = 1
)
parts = list(/obj/item/reagent_containers/glass/beaker = 1)
time = 120 //Modifying your gun
category = CAT_WEAPONRY
subcategory = CAT_WEAPON
/datum/crafting_recipe/durathread_duffelbag
name = "Durathread Dufflebag"
result = /obj/item/storage/backpack/duffelbag/durathread
@@ -932,7 +946,7 @@
/obj/item/stack/sheet/leather = 2)
time = 50
category = CAT_CLOTHING
/datum/crafting_recipe/durathread_helmet
name = "Makeshift Durathread Helmet"
result = /obj/item/clothing/head/helmet/durathread
@@ -948,4 +962,3 @@
/obj/item/stack/sheet/leather = 3)
time = 50
category = CAT_CLOTHING
@@ -122,3 +122,32 @@
else
to_chat(user, "<span class='notice'>You can't put the [A] into \the [src]!</span>")
return FALSE
/obj/item/gun/syringe/dart/rapiddart
name = "Repeating dart gun"
icon_state = "rapiddartgun"
item_state = "rapiddartgun"
/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
if(istype(B, /obj/item/reagent_containers/glass/beaker/large))
desc = "[initial(desc)] A modification of the dart gun's pressure chamber has been perfomed using a [B], extending it's holding size to [max_syringes]."
max_syringes = 2
return
else if(istype(B, /obj/item/reagent_containers/glass/beaker/plastic))
desc = "[initial(desc)] A modification of the dart gun's pressure chamber has been perfomed using a [B], extending it's holding size to [max_syringes]."
max_syringes = 3
return
else if(istype(B, /obj/item/reagent_containers/glass/beaker/meta))
desc = "[initial(desc)] A modification of the dart gun's pressure chamber has been perfomed using a [B], extending it's holding size to [max_syringes]."
max_syringes = 4
return
else if(istype(B, /obj/item/reagent_containers/glass/beaker/bluespace))
desc = "[initial(desc)] A modification of the dart gun's pressure chamber has been perfomed using a [B], extending it's holding size to [max_syringes]."
max_syringes = 6
return
else
max_syringes = 1
desc = "[initial(desc)] It has a [B] strapped to it, but it doesn't seem to be doing anything."
..()
@@ -384,6 +384,38 @@
adjust_item_drop_location(P)
reagents.trans_to(P, vol_part)
. = TRUE
if("createDart")
for(var/datum/reagent/R in reagents.reagent_list)
if(!(istype(R, /datum/reagent/medicine)))
visible_message("<b>The [src]</b> beeps, \"<span class='warning'>SmartDarts are insoluble with non-medicinal compounds.\"</span>")
return
var/many = params["many"]
if(reagents.total_volume == 0)
return
var/amount = 1
var/vol_each = min(reagents.total_volume, 20)
if(text2num(many))
amount = CLAMP(round(input(usr, "Max 10. Buffer content will be split evenly.", "How many darts?", amount) as num|null), 0, 10)
if(!amount)
return
vol_each = min(reagents.total_volume / amount, 20)
var/name = stripped_input(usr,"Name:","Name your SmartDart!", "[reagents.get_master_reagent_name()] ([vol_each]u)", MAX_NAME_LEN)
if(!name || !reagents.total_volume || !src || QDELETED(src) || !usr.canUseTopic(src, !issilicon(usr)))
return
var/obj/item/reagent_containers/syringe/dart/D
for(var/i = 0; i < amount; i++)
D = new /obj/item/reagent_containers/syringe/dart(drop_location())
D.name = trim("[name] SmartDart")
adjust_item_drop_location(D)
reagents.trans_to(D, vol_each)
D.mode=!mode
D.update_icon()
. = TRUE
//END CITADEL ADDITIONS
if("analyzeBeak")
var/datum/reagent/R = GLOB.chemical_reagents_list[params["id"]]
@@ -104,7 +104,7 @@
var/trans = target.reagents.trans_to(src, amount_per_transfer_from_this) // transfer from, transfer to - who cares?
to_chat(user, "<span class='notice'>You fill [src] with [trans] units of the solution. It now contains [reagents.total_volume] units.</span>")
if (reagents.total_volume >= reagents.maximum_volume)
if (round(reagents.total_volume, 0.1) >= reagents.maximum_volume)
mode=!mode
update_icon()
@@ -307,7 +307,7 @@
var/trans = target.reagents.trans_to(src, amount_per_transfer_from_this)
to_chat(user, "<span class='notice'>You soak the [src] with [trans] units of the solution. It now contains [reagents.total_volume] units.</span>")
if (reagents.total_volume >= reagents.maximum_volume)
if (round(reagents.total_volume,1) >= reagents.maximum_volume)
mode=!mode
update_icon()
@@ -323,8 +323,9 @@
rounded_vol = "empty"
if(reagents && reagents.total_volume)
if(volume/reagents.total_volume == 1)
if(volume/round(reagents.total_volume, 1) == 1)
rounded_vol="full"
mode = SYRINGE_INJECT
icon_state = "[rounded_vol]"
item_state = "syringe_[rounded_vol]"