From 5916458d2ddaaafa0275c5804db4aefaf08a7aa8 Mon Sep 17 00:00:00 2001 From: Migratingcocofruit <69551563+Migratingcocofruit@users.noreply.github.com> Date: Tue, 25 Mar 2025 12:21:18 +0200 Subject: [PATCH] Atomic Gardening (#28657) * adds rad_act to hydro trays * small adjustments --- code/modules/hydroponics/hydroponics_tray.dm | 25 ++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/code/modules/hydroponics/hydroponics_tray.dm b/code/modules/hydroponics/hydroponics_tray.dm index 09c0b3c7f0f..ba7c6a6bc81 100644 --- a/code/modules/hydroponics/hydroponics_tray.dm +++ b/code/modules/hydroponics/hydroponics_tray.dm @@ -5,6 +5,8 @@ density = TRUE anchored = TRUE pixel_y = 8 + rad_insulation_beta = RAD_MOB_INSULATION + rad_insulation_gamma = RAD_MOB_INSULATION /// The amount of water in the tray (max 100) var/waterlevel = 100 /// The maximum amount of water in the tray @@ -1112,3 +1114,26 @@ return if(user.plant_analyzer) send_plant_details(user) + +/obj/machinery/hydroponics/rad_act(atom/source, amount, emission_type) + if(!myseed) + return + // adjust radiation value according to type + switch(emission_type) + if(GAMMA_RAD) + amount /= ((1 - rad_insulation_gamma) / 2) + if(BETA_RAD) + amount /= (1 - rad_insulation_beta) + if(ALPHA_RAD) + amount /= 2 + + var/top_range = 100 * amount / (amount + 50) + var/roll = rand(0, top_range) + + // Do the rad stuff + if(prob(roll / 20)) + adjustHealth(-roll / 20) + if(prob(roll / 7)) + myseed.mutate(roll / 2, get_mutation_focus()) + if(top_range > 30 && prob(roll / 10)) + mut_beamed = TRUE