From 6044086de034a9aeae81be11f53c39a24a773878 Mon Sep 17 00:00:00 2001 From: silicons <2003111+silicons@users.noreply.github.com> Date: Sat, 26 Dec 2020 20:29:52 -0800 Subject: [PATCH] changes --- code/game/area/areas.dm | 2 ++ .../objects/effects/decals/cleanable/misc.dm | 18 ++++++++++++++++ code/game/turfs/open.dm | 7 +++++++ code/game/turfs/simulated/chasm.dm | 1 + code/game/turfs/simulated/dirtystation.dm | 5 ++++- code/game/turfs/simulated/floor.dm | 1 + code/game/turfs/simulated/lava.dm | 1 + code/game/turfs/simulated/reebe_void.dm | 1 + code/game/turfs/space/space.dm | 1 + code/modules/mob/living/living_defines.dm | 2 ++ code/modules/mob/living/living_movement.dm | 21 +++++++++++++++++++ 11 files changed, 59 insertions(+), 1 deletion(-) diff --git a/code/game/area/areas.dm b/code/game/area/areas.dm index fcde2bd1eb..ff177898cb 100644 --- a/code/game/area/areas.dm +++ b/code/game/area/areas.dm @@ -26,6 +26,8 @@ var/clockwork_warp_fail = "The structure there is too dense for warping to pierce. (This is normal in high-security areas.)" /// Persistent debris alowed var/persistent_debris_allowed = TRUE + /// Dirty flooring allowed + var/dirt_buildup_allowed = TRUE /// If mining tunnel generation is allowed in this area var/tunnel_allowed = FALSE diff --git a/code/game/objects/effects/decals/cleanable/misc.dm b/code/game/objects/effects/decals/cleanable/misc.dm index 9c0fb2eca9..e3f223f380 100644 --- a/code/game/objects/effects/decals/cleanable/misc.dm +++ b/code/game/objects/effects/decals/cleanable/misc.dm @@ -57,10 +57,28 @@ name = "dirt" desc = "Someone should clean that up." icon_state = "dirt" + alpha = 127 canSmoothWith = list(/obj/effect/decal/cleanable/dirt, /turf/closed/wall, /obj/structure/falsewall) smooth = SMOOTH_FALSE mouse_opacity = MOUSE_OPACITY_TRANSPARENT beauty = -75 + mergeable_decal = TRUE + persistent = TRUE + +/obj/effect/decal/cleanable/dirt/proc/dirty(strength) + if(alpha < 255) + alpha += strength + if(alpha > 255) + alpha = 255 + +/obj/effect/decal/cleanable/dirt/PersistenceSave(list/data) + . = ..() + data["alpha"] = alpha + +/obj/effect/decal/cleanable/dirt/PersistenceLoad(list/data) + . = ..() + if(data["alpha"]) + alpha = data["alpha"] /obj/effect/decal/cleanable/dirt/Initialize() . = ..() diff --git a/code/game/turfs/open.dm b/code/game/turfs/open.dm index 493e88d442..15f5738033 100644 --- a/code/game/turfs/open.dm +++ b/code/game/turfs/open.dm @@ -1,5 +1,12 @@ /turf/open plane = FLOOR_PLANE + /// Does dirt buildup happen on us? + var/dirt_buildup_allowed = FALSE + /// Dirt level. + var/dirtyness = 0 + /// Dirt level to spawn dirt. + var/dirt_spawn_threshold = 100 + /// Slowdown applied to mobs on us. var/slowdown = 0 //negative for faster, positive for slower var/postdig_icon_change = FALSE diff --git a/code/game/turfs/simulated/chasm.dm b/code/game/turfs/simulated/chasm.dm index 5e8f55feed..9490d728fe 100644 --- a/code/game/turfs/simulated/chasm.dm +++ b/code/game/turfs/simulated/chasm.dm @@ -9,6 +9,7 @@ canSmoothWith = list(/turf/open/floor/fakepit, /turf/open/chasm) density = TRUE //This will prevent hostile mobs from pathing into chasms, while the canpass override will still let it function like an open turf bullet_bounce_sound = null //abandon all hope ye who enter + dirt_buildup_allowed = FALSE /turf/open/chasm/Initialize() . = ..() diff --git a/code/game/turfs/simulated/dirtystation.dm b/code/game/turfs/simulated/dirtystation.dm index e29d75a248..add8467ceb 100644 --- a/code/game/turfs/simulated/dirtystation.dm +++ b/code/game/turfs/simulated/dirtystation.dm @@ -8,6 +8,9 @@ //Making the station dirty, one tile at a time. Called by master controller's setup_objects /turf/open/floor/proc/MakeDirty() + if(CONFIG_GET(flag/persistent_debris_only)) + return + if(prob(66)) //fastest possible exit 2/3 of the time return @@ -38,7 +41,7 @@ return //Construction zones. Blood, sweat, and oil. Oh, and dirt. - var/static/list/engine_dirt_areas = typecacheof(list(/area/engine, + var/static/list/engine_dirt_areas = typecacheof(list(/area/engine, /area/crew_quarters/heads/chief, /area/ruin/space/derelict/assembly_line, /area/science/robotics, diff --git a/code/game/turfs/simulated/floor.dm b/code/game/turfs/simulated/floor.dm index ddec9750d9..6a95a4a95d 100644 --- a/code/game/turfs/simulated/floor.dm +++ b/code/game/turfs/simulated/floor.dm @@ -5,6 +5,7 @@ name = "floor" icon = 'icons/turf/floors.dmi' baseturfs = /turf/open/floor/plating + dirt_buildup_allowed = TRUE footstep = FOOTSTEP_FLOOR barefootstep = FOOTSTEP_HARD_BAREFOOT diff --git a/code/game/turfs/simulated/lava.dm b/code/game/turfs/simulated/lava.dm index 2f223f2c40..e7471478fb 100644 --- a/code/game/turfs/simulated/lava.dm +++ b/code/game/turfs/simulated/lava.dm @@ -6,6 +6,7 @@ gender = PLURAL //"That's some lava." baseturfs = /turf/open/lava //lava all the way down slowdown = 2 + dirt_buildup_allowed = FALSE light_range = 2 light_power = 0.75 diff --git a/code/game/turfs/simulated/reebe_void.dm b/code/game/turfs/simulated/reebe_void.dm index 14aa02065d..3f3bf31f9b 100644 --- a/code/game/turfs/simulated/reebe_void.dm +++ b/code/game/turfs/simulated/reebe_void.dm @@ -6,6 +6,7 @@ planetary_atmos = TRUE bullet_bounce_sound = null //forever falling tiled_dirt = FALSE + dirt_buildup_allowed = FALSE /turf/open/indestructible/reebe_void/Initialize(mapload) . = ..() diff --git a/code/game/turfs/space/space.dm b/code/game/turfs/space/space.dm index b150d4930e..3cdbe8badb 100644 --- a/code/game/turfs/space/space.dm +++ b/code/game/turfs/space/space.dm @@ -3,6 +3,7 @@ icon_state = "0" name = "\proper space" intact = 0 + dirt_buildup_allowed = FALSE temperature = TCMB thermal_conductivity = OPEN_HEAT_TRANSFER_COEFFICIENT diff --git a/code/modules/mob/living/living_defines.dm b/code/modules/mob/living/living_defines.dm index d4ccc63b34..79334e1698 100644 --- a/code/modules/mob/living/living_defines.dm +++ b/code/modules/mob/living/living_defines.dm @@ -63,6 +63,8 @@ //Allows mobs to move through dense areas without restriction. For instance, in space or out of holder objects. var/incorporeal_move = FALSE //FALSE is off, INCORPOREAL_MOVE_BASIC is normal, INCORPOREAL_MOVE_SHADOW is for ninjas //and INCORPOREAL_MOVE_JAUNT is blocked by holy water/salt + /// Do we make floors dirty as we move? + var/causes_dirt_buildup_on_floor = TRUE var/list/roundstart_quirks = list() diff --git a/code/modules/mob/living/living_movement.dm b/code/modules/mob/living/living_movement.dm index 0cdfe9dbf2..e7a5de294d 100644 --- a/code/modules/mob/living/living_movement.dm +++ b/code/modules/mob/living/living_movement.dm @@ -101,7 +101,28 @@ if(lying && !buckled && prob(getBruteLoss()*200/maxHealth)) makeTrail(newloc, T, old_direction) + if(causes_dirt_buildup_on_floor && (movement_type & GROUND)) + dirt_buildup() +/** + * Attempts to make the floor dirty. + */ +/mob/living/proc/dirt_buildup(strength) + var/turf/T = loc + if(!istype(T) || !T.allow_dirt_buildup) + return + var/area/A = T.loc + if(!A.allow_dirt_buildup) + return + var/obj/effect/decal/cleanable/dirt/D = locate() in T + if(D) + D.dirty(strength) + else + T.dirtyness += strength + if(T.dirtyness >= T.dirt_spawn_threshold) + D = new /obj/effect/decal/cleanable/dirt(T) + D.dirty(T.dirt_spawn_threshold - T.dirtyness) + T.dirtyness = 0 // reset. /mob/living/Move_Pulled(atom/A) . = ..()