From 1070a8f63ce17667a0d14f580ddfe968f488a2a1 Mon Sep 17 00:00:00 2001 From: Zuhayr Date: Wed, 1 Apr 2015 07:25:09 -0700 Subject: [PATCH] Adds weedkiller smoke checks to hydro trays and spreading plants. --- code/modules/clothing/spacesuits/rig/rig.dm | 3 +- .../hydroponics/spreading/spreading_growth.dm | 5 +++ code/modules/hydroponics/trays/tray.dm | 32 +++++++++---------- .../modules/hydroponics/trays/tray_process.dm | 5 +++ code/modules/reagents/Chemistry-Reagents.dm | 7 ++-- 5 files changed, 29 insertions(+), 23 deletions(-) diff --git a/code/modules/clothing/spacesuits/rig/rig.dm b/code/modules/clothing/spacesuits/rig/rig.dm index dd646a71450..932986938d1 100644 --- a/code/modules/clothing/spacesuits/rig/rig.dm +++ b/code/modules/clothing/spacesuits/rig/rig.dm @@ -134,7 +134,7 @@ verbs |= /obj/item/weapon/rig/proc/toggle_chest for(var/obj/item/piece in list(gloves,helmet,boots,chest)) - if(!piece) + if(!istype(piece)) continue piece.canremove = 0 piece.name = "[suit_type] [initial(piece.name)]" @@ -145,7 +145,6 @@ piece.siemens_coefficient = siemens_coefficient piece.permeability_coefficient = permeability_coefficient piece.unacidable = unacidable - if(islist(species_restricted)) piece.species_restricted = species_restricted.Copy() if(islist(armor)) piece.armor = armor.Copy() update_icon(1) diff --git a/code/modules/hydroponics/spreading/spreading_growth.dm b/code/modules/hydroponics/spreading/spreading_growth.dm index 257d2219bac..7b1eae4f218 100644 --- a/code/modules/hydroponics/spreading/spreading_growth.dm +++ b/code/modules/hydroponics/spreading/spreading_growth.dm @@ -35,6 +35,11 @@ die_off() return 0 + for(var/obj/effect/effect/smoke/chem/smoke in view(1, src)) + if(smoke.reagents.has_reagent("plantbgone")) + die_off() + return + // Handle life. var/turf/simulated/T = get_turf(src) if(istype(T)) diff --git a/code/modules/hydroponics/trays/tray.dm b/code/modules/hydroponics/trays/tray.dm index 19f181d03e7..22c227a8d4f 100644 --- a/code/modules/hydroponics/trays/tray.dm +++ b/code/modules/hydroponics/trays/tray.dm @@ -98,22 +98,22 @@ // Beneficial reagents also have values for modifying yield_mod and mut_mod (in that order). var/global/list/beneficial_reagents = list( - "beer" = list( -0.05, 0, 0 ), - "fluorine" = list( -2, 0, 0 ), - "chlorine" = list( -1, 0, 0 ), - "phosphorus" = list( -0.75, 0, 0 ), - "sodawater" = list( 0.1, 0, 0 ), - "sacid" = list( -1, 0, 0 ), - "pacid" = list( -2, 0, 0 ), - "plantbgone" = list( -2, 0, 0.2 ), - "cryoxadone" = list( 3, 0, 0 ), - "ammonia" = list( 0.5, 0, 0 ), - "diethylamine" = list( 1, 0, 0 ), - "nutriment" = list( 0.5, 0.1, 0 ), - "radium" = list( -1.5, 0, 0.2 ), - "adminordrazine" = list( 1, 1, 1 ), - "robustharvest" = list( 0, 0.2, 0 ), - "left4zed" = list( 0, 0, 0.2 ) + "beer" = list( -0.05, 0, 0 ), + "fluorine" = list( -2, 0, 0 ), + "chlorine" = list( -1, 0, 0 ), + "phosphorus" = list( -0.75, 0, 0 ), + "sodawater" = list( 0.1, 0, 0 ), + "sacid" = list( -1, 0, 0 ), + "pacid" = list( -2, 0, 0 ), + "plantbgone" = list( -2, 0, 0.2), + "cryoxadone" = list( 3, 0, 0 ), + "ammonia" = list( 0.5, 0, 0 ), + "diethylamine" = list( 1, 0, 0 ), + "nutriment" = list( 0.5, 0.1, 0 ), + "radium" = list( -1.5, 0, 0.2), + "adminordrazine" = list( 1, 1, 1 ), + "robustharvest" = list( 0, 0.2, 0 ), + "left4zed" = list( 0, 0, 0.2) ) // Mutagen list specifies minimum value for the mutation to take place, rather diff --git a/code/modules/hydroponics/trays/tray_process.dm b/code/modules/hydroponics/trays/tray_process.dm index 280ce9e6d6e..68e6fbce373 100644 --- a/code/modules/hydroponics/trays/tray_process.dm +++ b/code/modules/hydroponics/trays/tray_process.dm @@ -1,5 +1,10 @@ /obj/machinery/portable_atmospherics/hydroponics/process() + // Handle nearby smoke if any. + for(var/obj/effect/effect/smoke/chem/smoke in view(1, src)) + if(smoke.reagents.total_volume) + smoke.reagents.copy_to(src, 5) + //Do this even if we're not ready for a plant cycle. process_reagents() diff --git a/code/modules/reagents/Chemistry-Reagents.dm b/code/modules/reagents/Chemistry-Reagents.dm index 4f08f6f0c35..64a65de467a 100644 --- a/code/modules/reagents/Chemistry-Reagents.dm +++ b/code/modules/reagents/Chemistry-Reagents.dm @@ -1855,12 +1855,9 @@ datum var/obj/effect/alien/weeds/alien_weeds = O alien_weeds.health -= rand(15,35) // Kills alien weeds pretty fast alien_weeds.healthcheck() - else if(istype(O,/obj/effect/plant)) //even a small amount is enough to kill it - del(O) else if(istype(O,/obj/effect/plant)) - if(prob(50)) - var/obj/effect/plant/plant = O - plant.die_off() + var/obj/effect/plant/plant = O + plant.die_off() else if(istype(O,/obj/machinery/portable_atmospherics/hydroponics)) var/obj/machinery/portable_atmospherics/hydroponics/tray = O