Skip to content

Commit

Permalink
Chem dispenser and chemmaster sprite update. (#557)
Browse files Browse the repository at this point in the history
* chem equipment sprite update

* Update chem_master.dm
  • Loading branch information
Helg2 authored Oct 18, 2024
1 parent 117b5c7 commit cdfd28c
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 9 deletions.
33 changes: 24 additions & 9 deletions code/modules/reagents/machinery/chem_master.dm
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
layer = BELOW_OBJ_LAYER //So bottles/pills reliably appear above it
use_power = IDLE_POWER_USE
idle_power_usage = 20
light_range = 1
light_power = 0.5
light_color = LIGHT_COLOR_ELECTRIC_CYAN

var/obj/item/reagent_containers/beaker = null
var/obj/item/storage/pill_bottle/loaded_pill_bottle = null
Expand Down Expand Up @@ -84,12 +87,13 @@
updateUsrDialog()

/obj/machinery/chem_master/proc/transfer_chemicals(obj/dest, obj/source, amount, reagent_id)
if(istype(source))
if(amount > 0 && source.reagents && amount <= source.reagents.maximum_volume)
if(!istype(dest))
source.reagents.remove_reagent(reagent_id, amount)
else if(dest.reagents)
source.reagents.trans_id_to(dest, reagent_id, amount)
if(!istype(source))
return
if(amount > 0 && source.reagents && amount <= source.reagents.maximum_volume)
if(!istype(dest))
source.reagents.remove_reagent(reagent_id, amount)
else if(dest.reagents)
source.reagents.trans_id_to(dest, reagent_id, amount)

/obj/machinery/chem_master/proc/replace_beaker(mob/user)
if(beaker)
Expand All @@ -102,7 +106,6 @@
icon_state = "mixer0"
return TRUE


/obj/machinery/chem_master/Topic(href, href_list)
. = ..()
if(.)
Expand All @@ -112,12 +115,10 @@

var/mob/living/user = usr

//RUTGMC edit start - marines can use chem machines once again
if(user.skills.getRating("medical") < SKILL_MEDICAL_NOVICE)
to_chat(user, span_notice("You start fiddling with \the [src]..."))
if(!do_after(user, SKILL_TASK_EASY, IGNORE_HELD_ITEM, src, BUSY_ICON_UNSKILLED))
return
//RUTGMC edit end

if (href_list["ejectp"])
if(loaded_pill_bottle)
Expand Down Expand Up @@ -406,6 +407,13 @@
popup.set_content(dat)
popup.open()

/obj/machinery/chem_master/update_icon()
. = ..()
if(machine_stat & (NOPOWER))
set_light(0)
else
set_light(initial(light_range))

/obj/machinery/chem_master/update_icon_state()
. = ..()
if(machine_stat & BROKEN)
Expand All @@ -415,6 +423,13 @@
else
icon_state = (beaker?"[base_state]1":"[base_state]0")

/obj/machinery/chem_master/update_overlays()
. = ..()
if(machine_stat & (NOPOWER))
return
. += emissive_appearance(icon, "[icon_state]_emissive", alpha = src.alpha)
. += mutable_appearance(icon, "[icon_state]_emissive", alpha = src.alpha)

/obj/machinery/chem_master/condimaster
name = "CondiMaster 3000"
condi = TRUE
Expand Down
Binary file modified icons/obj/machines/chemical_machines.dmi
Binary file not shown.

0 comments on commit cdfd28c

Please sign in to comment.