diff --git a/code/game/objects/effects/effect_system/effects_chem_smoke.dm b/code/game/objects/effects/effect_system/effects_chem_smoke.dm index 57e04e26e22..10220b45ec2 100644 --- a/code/game/objects/effects/effect_system/effects_chem_smoke.dm +++ b/code/game/objects/effects/effect_system/effects_chem_smoke.dm @@ -125,3 +125,24 @@ var/mob/living/carbon/C = A if(C.can_breathe_gas()) chemholder.reagents.copy_to(C, chemholder.reagents.total_volume) + +/datum/effect_system/smoke_spread/chem/plant + +/datum/effect_system/smoke_spread/chem/plant/SmokeEm(effect_range) + var/list/mobs_to_smoke = list() + for(var/atom/A in view(effect_range, get_turf(location))) + if(istype(A, /obj/effect/particle_effect)) // Don't impact particle effects, as there can be hundreds of them in a small area. Also, we don't want smoke particles adding themselves to this list. Major performance issue. + continue + if(A in smoked_atoms) + continue + smoked_atoms += A + chemholder.reagents.reaction(A) + SEND_SIGNAL(A, COMSIG_ATOM_EXPOSE_REAGENTS, chemholder.reagents, chemholder, chemholder.reagents.total_volume) + if(iscarbon(A)) + mobs_to_smoke += A + + var/percentage_to_add = chemholder.reagents.total_volume / length(mobs_to_smoke) + + for(var/mob/living/carbon/smoker as anything in mobs_to_smoke) + if(smoker.can_breathe_gas()) + chemholder.reagents.copy_to(smoker, percentage_to_add) diff --git a/code/modules/hydroponics/plant_genes.dm b/code/modules/hydroponics/plant_genes.dm index 95b53c40d64..226d47129a9 100644 --- a/code/modules/hydroponics/plant_genes.dm +++ b/code/modules/hydroponics/plant_genes.dm @@ -444,7 +444,7 @@ dangerous = TRUE /datum/plant_gene/trait/smoke/on_squash(obj/item/food/snacks/grown/G, atom/target) - var/datum/effect_system/smoke_spread/chem/S = new + var/datum/effect_system/smoke_spread/chem/plant/S = new() var/splat_location = get_turf(target) var/smoke_amount = round(sqrt(G.seed.potency * 0.1), 1) S.set_up(G.reagents, splat_location)