diff --git a/code/controllers/configuration/entries/game_options.dm b/code/controllers/configuration/entries/game_options.dm index 67e4a97894..dcede1e3e0 100644 --- a/code/controllers/configuration/entries/game_options.dm +++ b/code/controllers/configuration/entries/game_options.dm @@ -566,3 +566,16 @@ config_entry_value = 0.333 min_val = 0 integer = FALSE + +/// Amount of dirtyness tiles need to spawn dirt. +/datum/config_entry/number/turf_dirt_threshold + config_entry_value = 100 + min_value = 1 + integer = TRUE + +/// Alpha dirt starts at +/datum/config_entry/number/dirt_alpha_starting + config_entry_value = 127 + max_val = 255 + min_val = 0 + integer = TRUE diff --git a/code/game/objects/effects/decals/cleanable/misc.dm b/code/game/objects/effects/decals/cleanable/misc.dm index e3f223f380..b4c3a3acec 100644 --- a/code/game/objects/effects/decals/cleanable/misc.dm +++ b/code/game/objects/effects/decals/cleanable/misc.dm @@ -65,7 +65,11 @@ mergeable_decal = TRUE persistent = TRUE -/obj/effect/decal/cleanable/dirt/proc/dirty(strength) +/obj/effect/decal/cleanable/dirt/Initialize(mapload) + . = ..() + alpha = CONFIG_GET(number/dirt_alpha_starting) + +/obj/effect/decal/cleanable/dirt/proc/dirty(strength = 1) if(alpha < 255) alpha += strength if(alpha > 255) diff --git a/code/game/turfs/open.dm b/code/game/turfs/open.dm index 15f5738033..7e00b1cf63 100644 --- a/code/game/turfs/open.dm +++ b/code/game/turfs/open.dm @@ -4,8 +4,8 @@ var/dirt_buildup_allowed = FALSE /// Dirt level. var/dirtyness = 0 - /// Dirt level to spawn dirt. - var/dirt_spawn_threshold = 100 + /// Dirt level to spawn dirt. Null to use config. + var/dirt_spawn_threshold /// Slowdown applied to mobs on us. var/slowdown = 0 //negative for faster, positive for slower diff --git a/code/modules/mob/living/living_movement.dm b/code/modules/mob/living/living_movement.dm index 2a9e2d2634..d4694a76ea 100644 --- a/code/modules/mob/living/living_movement.dm +++ b/code/modules/mob/living/living_movement.dm @@ -107,7 +107,7 @@ /** * Attempts to make the floor dirty. */ -/mob/living/proc/dirt_buildup(strength) +/mob/living/proc/dirt_buildup(strength =) var/turf/open/T = loc if(!istype(T) || !T.dirt_buildup_allowed) return @@ -119,7 +119,7 @@ D.dirty(strength) else T.dirtyness += strength - if(T.dirtyness >= T.dirt_spawn_threshold) + if(T.dirtyness >= isnull(T.dirt_spawn_threshold)? CONFIG_GET(number/turf_dirt_threshold) : T.dirt_spawn_threshold) D = new /obj/effect/decal/cleanable/dirt(T) D.dirty(T.dirt_spawn_threshold - T.dirtyness) T.dirtyness = 0 // reset. diff --git a/config/game_options.txt b/config/game_options.txt index bc5fdf940e..3c53d9fecb 100644 --- a/config/game_options.txt +++ b/config/game_options.txt @@ -668,4 +668,10 @@ ALLOW_CUSTOM_SKINTONES ## Enables the FoV component, which hides objects and mobs behind the parent from their sight, unless they turn around, duh. ## Camera mobs, AIs, ghosts and some other are of course exempt from this. This also doesn't influence simplemob AI, for the best. -#USE_FIELD_OF_VISION \ No newline at end of file +#USE_FIELD_OF_VISION + +## Default turf threshold to get dirt +TURF_DIRT_THRESHOLD 100 + +## Default alpha of dirt on spawn +DIRT_ALPHA_STARTING 127