modular chemical reactions for hydroponics trays

This commit is contained in:
DragonTrance
2021-03-01 09:00:51 -07:00
parent 8dee9d844a
commit 26937f3bde
4 changed files with 144 additions and 138 deletions
+5 -1
View File
@@ -534,8 +534,12 @@
if(istype(reagent_source, /obj/item/reagent_containers/food/snacks) || istype(reagent_source, /obj/item/reagent_containers/pill))
qdel(reagent_source)
if(S.on_tray(H, split, user) >= 1)
if(myseed)
myseed.on_chem_reaction(S)
lastuser = user
for(var/datum/reagent/R in S.reagent_list)
if(R.on_tray(H, R.volume, user) >= 1)
lastuser = user
S.clear_reagents()
qdel(S)
@@ -36,10 +36,11 @@
for(var/obj/machinery/hydroponics/H in trays)
var/datum/reagents/temp_reagents = new /datum/reagents()
temp_reagents.my_atom = H
source.reagents.trans_to(temp_reagents, split)
H.applyChemicals(temp_reagents)
for(var/datum/reagent/R in temp_reagents.reagent_list)
if(R.on_tray(H, R.volume, src) >= 1)
tray.lastuser = src
temp_reagents.clear_reagents()
qdel(temp_reagents)
+2 -2
View File
@@ -78,8 +78,8 @@ GLOBAL_LIST_INIT(name2reagent, build_name2reagent())
return
//Hyperstation Edit: Hydroponics trays reactions, idea stolen from citadel but not directly referenced
/datum/reagent/proc/on_tray(/obj/machinery/hydroponics/T, volume, mob/user, override = FALSE) //See hyperstation's reagent module
if(!tray.myseed)
/datum/reagent/proc/on_tray(obj/machinery/hydroponics/T, volume, mob/user) //See hyperstation's reagent module
if(!T.myseed)
return 0
return -1