Pollution doesn't spawn when the subsystem is offline + only player-crafted bonfires produce smoke (#24555)

* Pollution no longer happens when the subsystem is offline

* Removes the code for bonfire pollution that wasn't done modularly

* Modularizes bonfire pollution, makes the default bonfire not produce pollution

* Player-made campfires produce pollution
This commit is contained in:
GoldenAlpharex
2023-10-24 14:37:34 -04:00
committed by GitHub
parent 34a6d93796
commit a6995da07d
6 changed files with 30 additions and 7 deletions
+1 -1
View File
@@ -14,7 +14,7 @@
reqs = list(/obj/item/grown/log = 5)
parts = list(/obj/item/grown/log = 5)
blacklist = list(/obj/item/grown/log/steel)
result = /obj/structure/bonfire
result = /obj/structure/bonfire/player_made // SKYRAT EDIT - Pollution - ORIGINAL: result = /obj/structure/bonfire
category = CAT_TOOLS
/datum/crafting_recipe/boneshovel
@@ -326,7 +326,7 @@ GLOBAL_LIST_INIT(wood_recipes, list ( \
new/datum/stack_recipe("loom", /obj/structure/loom, 10, time = 1.5 SECONDS, one_per_turf = TRUE, on_solid_ground = TRUE, category = CAT_TOOLS), \
new/datum/stack_recipe("mortar", /obj/item/reagent_containers/cup/mortar, 3, check_density = FALSE, category = CAT_CHEMISTRY), \
new/datum/stack_recipe("firebrand", /obj/item/match/firebrand, 2, time = 10 SECONDS, check_density = FALSE, category = CAT_TOOLS), \
new/datum/stack_recipe("bonfire", /obj/structure/bonfire, 10, time = 6 SECONDS, one_per_turf = TRUE, on_solid_ground = TRUE, category = CAT_TOOLS), \
new/datum/stack_recipe("bonfire", /obj/structure/bonfire/player_made, 10, time = 6 SECONDS, one_per_turf = TRUE, on_solid_ground = TRUE, category = CAT_TOOLS), /* SKYRAT EDIT - Pollution - ORIGINAL: /obj/structure/bonfire */ \
new/datum/stack_recipe("easel", /obj/structure/easel, 5, time = 1 SECONDS, one_per_turf = TRUE, on_solid_ground = TRUE, category = CAT_ENTERTAINMENT), \
new/datum/stack_recipe("noticeboard", /obj/item/wallframe/noticeboard, 1, time = 1 SECONDS, one_per_turf = FALSE, on_solid_ground = FALSE, check_density = FALSE, category = CAT_FURNITURE), \
new/datum/stack_recipe("test tube rack", /obj/item/storage/test_tube_rack, 1, time = 1 SECONDS, check_density = FALSE, category = CAT_CHEMISTRY), \
-5
View File
@@ -160,11 +160,6 @@
if(!check_oxygen())
extinguish()
return
//SKYRAT EDIT ADDITION
var/turf/open/my_turf = get_turf(src)
if(istype(my_turf) && !my_turf.planetary_atmos && !is_centcom_level(my_turf.z)) //Pollute, but only when we're not on planetary atmos or on CentCom
my_turf.pollute_turf_list(list(/datum/pollutant/smoke = 15, /datum/pollutant/carbon_air_pollution = 5), POLLUTION_ACTIVE_EMITTER_CAP)
//SKYRAT EDIT END
bonfire_burn(seconds_per_tick)
/obj/structure/bonfire/extinguish()
@@ -0,0 +1,19 @@
/obj/structure/bonfire
/// Whether or not this bonfire can cause pollution.
var/produces_smoke = FALSE
// We basically only want player-made bonfires to make smoke, so it's simpler.
/obj/structure/bonfire/player_made
produces_smoke = TRUE
/obj/structure/bonfire/process(seconds_per_tick)
. = ..()
if(!burning || !produces_smoke)
return
var/turf/open/my_turf = get_turf(src)
if(istype(my_turf) && !my_turf.planetary_atmos && !is_centcom_level(my_turf.z)) //Pollute, but only when we're not on planetary atmos or on CentCom
my_turf.pollute_turf_list(list(/datum/pollutant/smoke = 15, /datum/pollutant/carbon_air_pollution = 5), POLLUTION_ACTIVE_EMITTER_CAP)
@@ -5,6 +5,10 @@
return
/turf/open/pollute_turf(pollution_type, amount, cap)
// Don't add pollution when the subsystem is off.
if(!SSpollution.can_fire)
return
if(!pollution)
pollution = new(src)
if(cap && pollution.total_amount >= cap)
@@ -12,6 +16,10 @@
pollution.add_pollutant(pollution_type, amount)
/turf/open/pollute_turf_list(list/pollutions, cap)
// Don't add pollution when the subsystem is off.
if(!SSpollution.can_fire)
return
if(!pollution)
pollution = new(src)
if(cap && pollution.total_amount >= cap)
+1
View File
@@ -7589,6 +7589,7 @@
#include "modular_skyrat\modules\polarized_windows\windows.dm"
#include "modular_skyrat\modules\pollution\code\admin_spawn_pollution.dm"
#include "modular_skyrat\modules\pollution\code\air_refresher.dm"
#include "modular_skyrat\modules\pollution\code\bonfire.dm"
#include "modular_skyrat\modules\pollution\code\fancy_storage_items.dm"
#include "modular_skyrat\modules\pollution\code\perfumes.dm"
#include "modular_skyrat\modules\pollution\code\pollutant_datum.dm"