Ohh I'm fixing
This commit is contained in:
@@ -910,12 +910,13 @@
|
||||
subcategory = CAT_WEAPON
|
||||
|
||||
/datum/crafting_recipe/rapiddartgun
|
||||
name = "Rapid Smart dartgun - larger size beaker = larger mag."
|
||||
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/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
|
||||
|
||||
@@ -130,11 +130,12 @@
|
||||
max_syringes = 1
|
||||
|
||||
/obj/item/gun/syringe/dart/rapiddart/Initialize()
|
||||
.=..()
|
||||
update_capacity()
|
||||
.=..()
|
||||
|
||||
/obj/item/gun/syringe/dart/rapiddart/proc/update_capacity()
|
||||
var/obj/item/reagent_containers/glass/beaker/B = locate(/obj/item/reagent_containers/glass/beaker) in src
|
||||
message_admins("found[B]")
|
||||
|
||||
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]."
|
||||
|
||||
@@ -386,38 +386,32 @@
|
||||
. = TRUE
|
||||
|
||||
if("createDart")
|
||||
var/many = params["many"]
|
||||
if(reagents.total_volume == 0)
|
||||
return
|
||||
|
||||
for(var/datum/reagent/R in beaker.reagents.reagent_list)
|
||||
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/amount_full = 0
|
||||
var/vol_part = min(reagents.total_volume, 20)
|
||||
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_full = round(reagents.total_volume / 20)
|
||||
vol_part = reagents.total_volume % 20
|
||||
var/name = stripped_input(usr, "Name:","Name your SmartDart!", (reagents.total_volume ? reagents.get_master_reagent_name() : " "), MAX_NAME_LEN)
|
||||
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_full; i++)
|
||||
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, 20)
|
||||
D.mode=!mode
|
||||
D.update_icon()
|
||||
|
||||
if(vol_part)
|
||||
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_part)
|
||||
reagents.trans_to(D, vol_each)
|
||||
D.mode=!mode
|
||||
D.update_icon()
|
||||
. = TRUE
|
||||
|
||||
@@ -323,7 +323,7 @@
|
||||
|
||||
rounded_vol = "empty"
|
||||
if(reagents && reagents.total_volume)
|
||||
if(round(volume,1)/reagents.total_volume == 1)
|
||||
if(volume/round(reagents.total_volume, 1) == 1)
|
||||
rounded_vol="full"
|
||||
mode = SYRINGE_INJECT
|
||||
|
||||
|
||||
@@ -84,7 +84,7 @@
|
||||
<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"}}' >Dispense Buffer to SmartDarts </ui-button>
|
||||
<ui-button action='createDart' params='{"many": 1}' state='{{data.bufferContents ? null : "disabled"}}' >Create multiple SmartDarts </ui-button>
|
||||
<br/>
|
||||
|
||||
</ui-display>
|
||||
|
||||
Reference in New Issue
Block a user