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
+1 -1
View File
@@ -366,7 +366,7 @@
STR.max_combined_w_class = 200
STR.max_items = 50
STR.insert_preposition = "in"
STR.can_hold = typecacheof(list(/obj/item/reagent_containers/pill, /obj/item/reagent_containers/glass/beaker, /obj/item/reagent_containers/glass/bottle))
STR.can_hold = typecacheof(list(/obj/item/reagent_containers/pill, /obj/item/reagent_containers/glass/beaker, /obj/item/reagent_containers/glass/bottle, /obj/item/reagent_containers/syringe/dart))
/*
* Biowaste bag (mostly for xenobiologists)
+22
View File
@@ -620,6 +620,9 @@
GET_COMPONENT(STR, /datum/component/storage)
STR.max_items = 15
STR.display_numerical_stacking = FALSE
STR.allow_quick_gather = TRUE
STR.allow_quick_empty = TRUE
STR.click_gather = TRUE
STR.can_hold = typecacheof(list(
/obj/item/reagent_containers/syringe/dart
))
@@ -628,6 +631,25 @@
for(var/i in 1 to 16)
new /obj/item/reagent_containers/syringe/dart/(src)
/obj/item/storage/belt/medolier/afterattack(obj/target, mob/user , proximity)
if(!(istype(target, /obj/item/reagent_containers/glass/beaker)))
return
if(!proximity)
return
if(!target.reagents)
return
for(var/obj/item/reagent_containers/syringe/dart/D in contents)
if(round(target.reagents.total_volume, 1) <= 0)
to_chat(user, "<span class='notice'>You soak as many of the darts as you can with the contents from [target].</span>")
return
if(D.mode == SYRINGE_INJECT)
continue
D.afterattack(target, user, proximity)
..()
/obj/item/storage/belt/holster
name = "shoulder holster"
desc = "A holster to carry a handgun and ammo. WARNING: Badasses only."
+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]"
Binary file not shown.

Before

Width:  |  Height:  |  Size: 35 KiB

After

Width:  |  Height:  |  Size: 35 KiB

+1 -1
View File
File diff suppressed because one or more lines are too long
+13 -13
View File
File diff suppressed because one or more lines are too long
+5
View File
@@ -81,6 +81,11 @@
<br/>
<ui-button action='createVial' params='{"many": 1}' state='{{data.bufferContents ? null : "disabled"}}' >Dispense Buffer to Hypo vials </ui-button>
<br/>
<br/>
<ui-button action='createDart' params='{"many": 0}' state='{{data.bufferContents ? null : "disabled"}}' >Create SmartDart (max 20µ)</ui-button>
<br/>
<ui-button action='createDart' params='{"many": 1}' state='{{data.bufferContents ? null : "disabled"}}' >Create Multiple SmartDarts </ui-button>
<br/>
</ui-display>