Merge branch 'master' into Dispencer-UI-change

This commit is contained in:
Fermi
2021-01-17 22:19:45 +00:00
218 changed files with 2223 additions and 819 deletions
@@ -272,6 +272,7 @@
say("Not enough energy to complete operation!")
return
R.add_reagent(reagent, actual)
log_reagent("DISPENSER: ([COORD(src)]) ([REF(src)]) [key_name(usr)] dispensed [actual] of [reagent] to [beaker] ([REF(beaker)]).")
work_animation()
else
@@ -293,11 +294,14 @@
var/list/chemicals_to_dispense = saved_recipes[params["recipe"]]
if(!LAZYLEN(chemicals_to_dispense))
return
var/list/logstring = list()
var/earlyabort = FALSE
for(var/key in chemicals_to_dispense)
var/reagent = GLOB.name2reagent[translate_legacy_chem_id(key)]
var/dispense_amount = chemicals_to_dispense[key]
logstring += "[reagent] = [dispense_amount]"
if(!dispensable_reagents.Find(reagent))
return
break
if(!recording_recipe)
if(!beaker)
return
@@ -307,11 +311,15 @@
if(actual)
if(!cell.use(actual / powerefficiency))
say("Not enough energy to complete operation!")
return
earlyabort = TRUE
break
R.add_reagent(reagent, actual)
work_animation()
else
recording_recipe[key] += dispense_amount
logstring = logstring.Join(", ")
if(!recording_recipe)
log_reagent("DISPENSER: [key_name(usr)] dispensed recipe [params["recipe"]] with chemicals [logstring] to [beaker] ([REF(beaker)])[earlyabort? " (aborted early)":""]")
. = TRUE
if("clear_recipes")
if(!is_operational())
@@ -334,15 +342,19 @@
if(saved_recipes[name] && alert("\"[name]\" already exists, do you want to overwrite it?",, "Yes", "No") == "No")
return
if(name && recording_recipe)
var/list/logstring = list()
for(var/reagent in recording_recipe)
var/reagent_id = GLOB.name2reagent[translate_legacy_chem_id(reagent)]
logstring += "[reagent_id] = [recording_recipe[reagent]]"
if(!dispensable_reagents.Find(reagent_id))
visible_message("<span class='warning'>[src] buzzes.</span>", "<span class='hear'>You hear a faint buzz.</span>")
to_chat(usr, "<span class ='danger'>[src] cannot find <b>[reagent]</b>!</span>")
playsound(src, 'sound/machines/buzz-two.ogg', 50, TRUE)
return
saved_recipes[name] = recording_recipe
logstring = logstring.Join(", ")
recording_recipe = null
log_reagent("DISPENSER: [key_name(usr)] recorded recipe [name] with chemicals [logstring]")
. = TRUE
if("cancel_recording")
if(!is_operational())
@@ -1126,7 +1126,7 @@
if(istype(O, /obj/item/stack/medical/gauze))
var/obj/item/stack/medical/gauze/G = O
reac_volume = min((reac_volume / 10), G.amount)
new/obj/item/stack/medical/gauze/adv(get_turf(G), reac_volume)
new /obj/item/stack/medical/gauze/adv(get_turf(G), reac_volume)
G.use(reac_volume)