Files
Bubberstation/code/modules/hydroponics/hydroponics_chemreact.dm
Watermelon914 375a20e49b Refactors most spans into span procs (#59645)
Converts most spans into span procs. Mostly used regex for this and sorted out any compile time errors afterwards so there could be some bugs.
Was initially going to do defines, but ninja said to make it into a proc, and if there's any overhead, they can easily be changed to defines.

Makes it easier to control the formatting and prevents typos when creating spans as it'll runtime if you misspell instead of silently failing.
Reduces the code you need to write when writing spans, as you don't need to close the span as that's automatically handled by the proc.

(Note from Lemon: This should be converted to defines once we update the minimum version to 514. Didn't do it now because byond pain and such)
2021-06-14 13:03:53 -07:00

33 lines
1.2 KiB
Plaintext

/**
*This is NOW the gradual affects that each chemical applies on every process() proc. Nutrients now use a more robust reagent holder in order to apply less insane
* stat changes as opposed to 271 lines of individual statline effects. Shoutout to the original comments on chems, I just cleaned a few up.
*/
/obj/machinery/hydroponics/proc/apply_chemicals(mob/user)
///Contains the reagents within the tray.
if(myseed)
myseed.on_chem_reaction(reagents) //In case seeds have some special interactions with special chems, currently only used by vines
for(var/c in reagents.reagent_list)
var/datum/reagent/chem = c
chem.on_hydroponics_apply(myseed, reagents, src, user)
/obj/machinery/hydroponics/proc/mutation_roll(mob/user)
switch(rand(100))
if(91 to 100)
adjustHealth(-10)
visible_message(span_warning("\The [myseed.plantname] starts to wilt and burn!"))
return
if(41 to 90)
if(myseed && !self_sustaining) //Stability
myseed.adjust_instability(5)
return
if(21 to 40)
visible_message(span_notice("\The [myseed.plantname] appears unusually reactive..."))
return
if(11 to 20)
mutateweed()
return
if(1 to 10)
mutatepest(user)
return