diff --git a/code/datums/components/wet_floor.dm b/code/datums/components/wet_floor.dm index 0b3b92fd2e3..d1f5b0fb1b8 100644 --- a/code/datums/components/wet_floor.dm +++ b/code/datums/components/wet_floor.dm @@ -11,8 +11,11 @@ var/current_overlay var/permanent = FALSE var/last_process = 0 + /// Should we display an overlay for this component? Useful mainly for turfs + /// that already look wets or just don't need the visuals for any other reason. + var/should_display_overlay = TRUE -/datum/component/wet_floor/InheritComponent(datum/newcomp, orig, strength, duration_minimum, duration_add, duration_maximum, _permanent) +/datum/component/wet_floor/InheritComponent(datum/newcomp, orig, strength, duration_minimum, duration_add, duration_maximum, _permanent, _should_display_overlay) if(!newcomp) //We are getting passed the arguments of a would-be new component, but not a new component add_wet(arglist(args.Copy(3))) else //We are being passed in a full blown component @@ -22,10 +25,11 @@ for(var/i in WF.time_left_list) add_wet(text2num(i), WF.time_left_list[i]) -/datum/component/wet_floor/Initialize(strength, duration_minimum, duration_add, duration_maximum, _permanent = FALSE) +/datum/component/wet_floor/Initialize(strength, duration_minimum, duration_add, duration_maximum, _permanent = FALSE, _should_display_overlay = TRUE) if(!isopenturf(parent)) return COMPONENT_INCOMPATIBLE - add_wet(strength, duration_minimum, duration_add, duration_maximum) + should_display_overlay = _should_display_overlay + add_wet(strength, duration_minimum, duration_add, duration_maximum, _permanent, _should_display_overlay) permanent = _permanent if(!permanent) START_PROCESSING(SSwet_floors, src) @@ -50,6 +54,15 @@ return ..() /datum/component/wet_floor/proc/update_overlay() + if(!should_display_overlay) + if(!current_overlay) + return + + var/turf/parent_turf = parent + parent_turf.cut_overlay(current_overlay) + current_overlay = null + return + var/intended if(!isfloorturf(parent)) intended = generic_turf_overlay @@ -62,9 +75,9 @@ else intended = water_overlay if(current_overlay != intended) - var/turf/T = parent - T.cut_overlay(current_overlay) - T.add_overlay(intended) + var/turf/parent_turf = parent + parent_turf.cut_overlay(current_overlay) + parent_turf.add_overlay(intended) current_overlay = intended /datum/component/wet_floor/proc/AfterSlip(mob/living/slipped) @@ -163,7 +176,7 @@ //NB it's possible we get deleted after this, due to inherit -/datum/component/wet_floor/proc/add_wet(type, duration_minimum = 0, duration_add = 0, duration_maximum = MAXIMUM_WET_TIME, _permanent = FALSE) +/datum/component/wet_floor/proc/add_wet(type, duration_minimum = 0, duration_add = 0, duration_maximum = MAXIMUM_WET_TIME, _permanent = FALSE, _should_display_overlay = TRUE) var/static/list/allowed_types = list(TURF_WET_WATER, TURF_WET_LUBE, TURF_WET_ICE, TURF_WET_PERMAFROST, TURF_WET_SUPERLUBE) if(duration_minimum <= 0 || !type) return FALSE @@ -179,6 +192,8 @@ permanent = TRUE STOP_PROCESSING(SSwet_floors, src) + should_display_overlay = _should_display_overlay + /datum/component/wet_floor/proc/_do_add_wet(type, duration_minimum, duration_add, duration_maximum) var/time = 0 if(LAZYACCESS(time_left_list, "[type]")) diff --git a/code/game/turfs/open/_open.dm b/code/game/turfs/open/_open.dm index 3e3560eafa7..6a62f7e0227 100644 --- a/code/game/turfs/open/_open.dm +++ b/code/game/turfs/open/_open.dm @@ -329,8 +329,8 @@ slipper.AddComponent(/datum/component/force_move, target, FALSE)//spinning would be bad for ice, fucks up the next dir return TRUE -/turf/open/proc/MakeSlippery(wet_setting = TURF_WET_WATER, min_wet_time = 0, wet_time_to_add = 0, max_wet_time = MAXIMUM_WET_TIME, permanent) - AddComponent(/datum/component/wet_floor, wet_setting, min_wet_time, wet_time_to_add, max_wet_time, permanent) +/turf/open/proc/MakeSlippery(wet_setting = TURF_WET_WATER, min_wet_time = 0, wet_time_to_add = 0, max_wet_time = MAXIMUM_WET_TIME, permanent = FALSE, should_display_overlay = TRUE) + AddComponent(/datum/component/wet_floor, wet_setting, min_wet_time, wet_time_to_add, max_wet_time, permanent, should_display_overlay) /turf/open/proc/MakeDry(wet_setting = TURF_WET_WATER, immediate = FALSE, amount = INFINITY) SEND_SIGNAL(src, COMSIG_TURF_MAKE_DRY, wet_setting, immediate, amount) diff --git a/code/game/turfs/open/ice.dm b/code/game/turfs/open/ice.dm index 96bf1baac09..3f951684e86 100644 --- a/code/game/turfs/open/ice.dm +++ b/code/game/turfs/open/ice.dm @@ -17,7 +17,7 @@ /turf/open/misc/ice/Initialize(mapload) . = ..() - MakeSlippery(TURF_WET_PERMAFROST, INFINITY, 0, INFINITY, TRUE) + MakeSlippery(TURF_WET_PERMAFROST, INFINITY, 0, INFINITY, TRUE, FALSE) /turf/open/misc/ice/break_tile() return