Allows chemical presses to customize pill duration, chemmasters can now produce instant pills without the need for water (#90428)

## About The Pull Request

Chemical presses now have a setting to customize pill duration, at 3s by
default (like chemmasters). Both presses and chemmasters now have a
setting for 0s pills, previously the cap was 1 as allowing to completely
dissolve the coating with water was something I only implemented down
the line.
Also slightly cleaned up both chemmaster and chem press files so they
pass linters now.

- Closes #90427

## Why It's Good For The Game

Presses not being able to customize pill durations is kinda silly and
was an oversight on my part, same with 0s pills - you can achieve the
same result, and ideally you should be able to produce those with
presses, at which point there's no reason to not add them to
chemmasters.

## Changelog
🆑
add: You can now customize pill duration in chemical presses
balance: ChemMasters and chemical presses can now create 0s duration
pills.
/🆑
This commit is contained in:
SmArtKar
2025-04-29 17:44:07 -06:00
committed by Shadow-Quill
parent 91aac74fad
commit cabec4e11d
3 changed files with 48 additions and 7 deletions
@@ -15,6 +15,8 @@
var/max_volume = 100 // BUBBER EDIT CHANGE - Original: 50
/// prefix for the product name
var/product_name = "factory"
/// Selected duration of produced pills, if they're selected
var/pill_duration = 3
/// All packaging types wrapped up in 1 big list
var/static/list/packaging_types = null
///The type of packaging to use
@@ -87,6 +89,9 @@
suffix = "Bottle"
container.name = "[product_name] [suffix]"
reagents.trans_to(container, current_volume)
if (istype(container, /obj/item/reagent_containers/applicator/pill))
var/obj/item/reagent_containers/applicator/pill/pill = container
pill.layers_remaining = pill_duration
stored_products += container
//dispense stored products on the floor
@@ -126,7 +131,9 @@
var/list/data = list()
data["current_volume"] = current_volume
data["pill_duration"] = pill_duration
data["max_volume"] = max_volume
data["max_duration"] = PILL_MAX_LAYERS
data["product_name"] = product_name
data["packaging_type"] = REF(packaging_type)
data["packaging_category"] = packaging_category
@@ -151,6 +158,18 @@
current_volume = clamp(value, MIN_VOLUME, max_volume)
return TRUE
if("change_pill_duraton")
var/value = params["duration"]
if(isnull(value))
return FALSE
value = text2num(value)
if(isnull(value))
return FALSE
pill_duration = clamp(value, 0, PILL_MAX_LAYERS)
return TRUE
if("change_product_name")
var/formatted_name = html_encode(params["name"])
if (length(formatted_name) > MAX_NAME_LEN)