Atomic Gardening (#28657)

* adds rad_act to hydro trays

* small adjustments
This commit is contained in:
Migratingcocofruit
2025-03-25 10:21:18 +00:00
committed by GitHub
parent e8265a59f2
commit 5916458d2d
@@ -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