Revert "More adjustments. Implemented gas exuding/consumption (currently unused). Implemented cuttings, fixed some issues."

This reverts commit 95b069b7d4.
This commit is contained in:
ZomgPonies
2014-07-30 00:16:53 -04:00
parent ac3c812f28
commit 1bd2acf0d0
4 changed files with 20 additions and 71 deletions
+6 -55
View File
@@ -119,7 +119,7 @@
/obj/machinery/portable_atmospherics/hydroponics/bullet_act(var/obj/item/projectile/Proj)
//Don't act on seeds like dionaea that shouldn't change.
if(seed && seed.immutable > 0)
if(seed && seed.immutable)
return
//Override for somatoray projectiles.
@@ -169,11 +169,6 @@
// Advance plant age.
if(prob(25)) age += 1 * HYDRO_SPEED_MULTIPLIER
//Highly mutable plants have a chance of mutating every tick.
if(seed.immutable == -1)
var/mut_prob = rand(1,100)
if(mut_prob <= 5) mutate(mut_prob == 1 ? 2 : 1)
// Maintain tray nutrient and water levels.
if(seed.nutrient_consumption > 0 && nutrilevel > 0 && prob(25))
nutrilevel -= max(0,seed.nutrient_consumption * HYDRO_SPEED_MULTIPLIER)
@@ -201,23 +196,10 @@
// If atmos input is not there, grab from turf.
if(!environment)
if(istype(T))
environment = T.air
if(!environment)
environment = T.return_air()
if(!environment) //We're in a crate or nullspace, bail out.
return
// Handle gas consumption.
if(seed.consume_gasses && seed.consume_gasses.len)
var/missing_gas = 0
for(var/gas in seed.consume_gasses)
if(environment && environment.gas && environment.gas[gas] && \
environment.gas[gas] >= seed.consume_gasses[gas])
environment.adjust_gas(gas,-seed.consume_gasses[gas],1)
else
missing_gas++
if(missing_gas > 0)
health -= missing_gas * HYDRO_SPEED_MULTIPLIER
// Process it.
var/pressure = environment.return_pressure()
if(pressure < seed.lowkpa_tolerance || pressure > seed.highkpa_tolerance)
@@ -226,13 +208,6 @@
if(abs(environment.temperature - seed.ideal_heat) > seed.heat_tolerance)
health -= healthmod
// Handle gas production.
if(seed.exude_gasses && seed.exude_gasses.len)
var/datum/gas_mixture/exuded = new
for(var/gas in seed.exude_gasses)
exuded.adjust_gas(gas,seed.exude_gasses[gas*seed.potency],1) //This will need adjustment since it produces moles.
loc.assume_air(exuded)
// Handle light requirements.
var/area/A = T.loc
if(A)
@@ -282,14 +257,13 @@
pestlevel = 0
// If enough time (in cycles, not ticks) has passed since the plant was harvested, we're ready to harvest again.
else if(seed.products && seed.products.len && age > seed.production && \
(age - lastproduce) > seed.production && (!harvest && !dead))
else if(age > seed.production && (age - lastproduce) > seed.production && (!harvest && !dead))
harvest = 1
lastproduce = age
if(prob(5)) // On each tick, there's a 5 percent chance the pest population will increase
pestlevel += 1 * HYDRO_SPEED_MULTIPLIER
check_level_sanity()
update_icon()
return
@@ -783,30 +757,7 @@
usr << "[src] is \red filled with weeds!"
if(pestlevel >= 5)
usr << "[src] is \red filled with tiny worms!"
if(!istype(src,/obj/machinery/portable_atmospherics/hydroponics/soil))
var/turf/T = loc
var/datum/gas_mixture/environment
if(closed_system && (connected_port || holding))
environment = air_contents
if(!environment)
if(istype(T))
environment = T.return_air()
if(!environment) //We're in a crate or nullspace, bail out.
return
var/area/A = T.loc
var/light_available
if(A)
if(A.lighting_use_dynamic)
light_available = max(0,min(10,T.lighting_lumcount)-5)
else
light_available = 5
usr << "The tray's sensor suite is reporting a light level of [light_available] lumens and a temperature of [environment.temperature]K."
usr << text ("")
/obj/machinery/portable_atmospherics/hydroponics/verb/close_lid()
set name = "Toggle Tray Lid"