Skip to content

Commit

Permalink
Halfs the nutriment drain / doubles water capacity of hydroponics to …
Browse files Browse the repository at this point in the history
…allow botanists to RP (MrMelbert#99)

It's halves but no one will see this
  • Loading branch information
MrMelbert authored Oct 22, 2021
1 parent 9e13df8 commit d3a13c4
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
1 change: 1 addition & 0 deletions jollystation.dme
Original file line number Diff line number Diff line change
Expand Up @@ -4050,6 +4050,7 @@
#include "jollystation_modules\code\modules\events\resource_drift.dm"
#include "jollystation_modules\code\modules\events\resource_pods.dm"
#include "jollystation_modules\code\modules\food_and_drinks\recipes\drinks_recipes.dm"
#include "jollystation_modules\code\modules\hydroponics\hydroponics.dm"
#include "jollystation_modules\code\modules\hydroponics\grown\beans.dm"
#include "jollystation_modules\code\modules\jobs\access.dm"
#include "jollystation_modules\code\modules\jobs\job_types\_job.dm"
Expand Down
31 changes: 31 additions & 0 deletions jollystation_modules/code/modules/hydroponics/hydroponics.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
// -- Hydroponics tray additions --
#define TRAY_MODIFIED_BASE_NUTRIDRAIN 0.5
#define TRAY_MODIFIED_BASE_MAXWATER 200

/obj/machinery/hydroponics/constructable
// Max water is doubled so they don't need to rely on autogrow for all their trays
maxwater = TRAY_MODIFIED_BASE_MAXWATER
// Nutriment drain is halved so they can not worry about fertilizer as much
nutridrain = TRAY_MODIFIED_BASE_NUTRIDRAIN

/obj/machinery/hydroponics/constructable/RefreshParts()
. = ..()
// Dehardcodes the nutridrain scaling factor
calculate_nutridrain()

/obj/machinery/hydroponics/constructable/CtrlClick(mob/user)
var/curr_sustain = self_sustaining
. = ..()
// Hacky check to see if we actually toggled sustaining or not
// because I don't want to touch the main file
if(curr_sustain != self_sustaining)
calculate_nutridrain()

/// Future melbert todo: Move this to a setter for when self-sustaining is made into one.
/// Updates the nutridrain of the tray based on self sustaining status.
/obj/machinery/hydroponics/constructable/proc/calculate_nutridrain()
var/sustaining_mod = self_sustaining ? 2 : 1
nutridrain = initial(nutridrain) / (sustaining_mod * rating)

#undef TRAY_MODIFIED_BASE_NUTRIDRAIN
#undef TRAY_MODIFIED_BASE_MAXWATER

0 comments on commit d3a13c4

Please sign in to comment.