forked from MrMelbert/MapleStationCode
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Halfs the nutriment drain / doubles water capacity of hydroponics to …
…allow botanists to RP (MrMelbert#99) It's halves but no one will see this
- Loading branch information
Showing
2 changed files
with
32 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
jollystation_modules/code/modules/hydroponics/hydroponics.dm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |