From 0a83f95c927616e27459b209c8f33e3f4448eaf5 Mon Sep 17 00:00:00 2001 From: Atermonera Date: Fri, 20 Jul 2018 18:47:15 -0700 Subject: [PATCH] Merge pull request #5423 from Anewbe/dirt_floors Implements ways to make floors not get dirty --- code/game/turfs/simulated.dm | 19 +++++++++++-------- code/modules/mob/living/living.dm | 6 +++++- code/modules/mob/living/living_defines.dm | 3 ++- 3 files changed, 18 insertions(+), 10 deletions(-) diff --git a/code/game/turfs/simulated.dm b/code/game/turfs/simulated.dm index e156588937..1c74b467e2 100644 --- a/code/game/turfs/simulated.dm +++ b/code/game/turfs/simulated.dm @@ -12,6 +12,7 @@ nitrogen = MOLES_N2STANDARD var/to_be_destroyed = 0 //Used for fire, if a melting temperature was reached, it will be destroyed var/max_fire_temperature_sustained = 0 //The max temperature of the fire which it was subjected to + var/can_dirty = TRUE // If false, tile never gets dirty var/dirt = 0 // This is not great. @@ -65,12 +66,13 @@ tracks.AddTracks(bloodDNA,comingdir,goingdir,bloodcolor) /turf/simulated/proc/update_dirt() - dirt = min(dirt+1, 101) - var/obj/effect/decal/cleanable/dirt/dirtoverlay = locate(/obj/effect/decal/cleanable/dirt, src) - if (dirt > 50) - if (!dirtoverlay) - dirtoverlay = new/obj/effect/decal/cleanable/dirt(src) - dirtoverlay.alpha = min((dirt - 50) * 5, 255) + if(can_dirty) + dirt = min(dirt+1, 101) + var/obj/effect/decal/cleanable/dirt/dirtoverlay = locate(/obj/effect/decal/cleanable/dirt, src) + if (dirt > 50) + if (!dirtoverlay) + dirtoverlay = new/obj/effect/decal/cleanable/dirt(src) + dirtoverlay.alpha = min((dirt - 50) * 5, 255) /turf/simulated/Entered(atom/A, atom/OL) if(movement_disabled && usr.ckey != movement_disabled_exception) @@ -82,8 +84,9 @@ if(M.lying) return ..() - // Dirt overlays. - update_dirt() + if(M.dirties_floor()) + // Dirt overlays. + update_dirt() if(istype(M, /mob/living/carbon/human)) var/mob/living/carbon/human/H = M diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index 7d2d86ab76..0bcfcf6174 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -1277,4 +1277,8 @@ default behaviour is: /mob/living/proc/has_vision() - return !(eye_blind || (disabilities & BLIND) || stat || blinded) \ No newline at end of file + return !(eye_blind || (disabilities & BLIND) || stat || blinded) + + +/mob/living/proc/dirties_floor() // If we ever decide to add fancy conditionals for making dirty floors (floating, etc), here's the proc. + return makes_dirt \ No newline at end of file diff --git a/code/modules/mob/living/living_defines.dm b/code/modules/mob/living/living_defines.dm index 9739e596b8..1ee86da6ef 100644 --- a/code/modules/mob/living/living_defines.dm +++ b/code/modules/mob/living/living_defines.dm @@ -16,7 +16,6 @@ var/brainloss = 0 //'Retardation' damage caused by someone hitting you in the head with a bible or being infected with brainrot. var/halloss = 0 //Hallucination damage. 'Fake' damage obtained through hallucinating or the holodeck. Sleeping should cause it to wear off. - var/hallucination = 0 //Directly affects how long a mob will hallucinate for var/list/atom/hallucinations = list() //A list of hallucinated people that try to attack the mob. See /obj/effect/fake_attacker in hallucinations.dm @@ -59,3 +58,5 @@ var/list/hud_list //Holder for health hud, status hud, wanted hud, etc (not like inventory slots) var/has_huds = FALSE //Whether or not we should bother initializing the above list + + var/makes_dirt = TRUE //FALSE if the mob shouldn't be making dirt on the ground when it walks \ No newline at end of file