Merge pull request #13178 from farie82/floor-cluwne-fix

Makes floor cluwnes slippery tiles not stay there till the end of times
This commit is contained in:
Fox McCloud
2020-04-04 03:36:32 -04:00
committed by GitHub
6 changed files with 21 additions and 12 deletions
+12 -7
View File
@@ -35,7 +35,12 @@
assume_air(lowertemp)
qdel(hotspot)
/turf/simulated/proc/MakeSlippery(wet_setting = TURF_WET_WATER, infinite = FALSE) // 1 = Water, 2 = Lube, 3 = Ice, 4 = Permafrost
/*
* Makes a turf slippery using the given parameters
* @param wet_setting The type of slipperyness used
* @param time Time the turf is slippery. If null it will pick a random time between 790 and 820 ticks. If INFINITY then it won't dry up ever
*/
/turf/simulated/proc/MakeSlippery(wet_setting = TURF_WET_WATER, time = null) // 1 = Water, 2 = Lube, 3 = Ice, 4 = Permafrost
if(wet >= wet_setting)
return
wet = wet_setting
@@ -55,13 +60,13 @@
else
wet_overlay = image('icons/effects/water.dmi', src, "wet_static")
overlays += wet_overlay
if(!infinite)
spawn(rand(790, 820)) // Purely so for visual effect
if(!istype(src, /turf/simulated)) //Because turfs don't get deleted, they change, adapt, transform, evolve and deform. they are one and they are all.
return
MakeDry(wet_setting)
if(time == INFINITY)
return
if(!time)
time = rand(790, 820)
addtimer(CALLBACK(src, .proc/MakeDry, wet_setting), time)
/turf/simulated/proc/MakeDry(wet_setting = TURF_WET_WATER)
/turf/simulated/MakeDry(wet_setting = TURF_WET_WATER)
if(wet > wet_setting)
return
wet = TURF_DRY
+1 -1
View File
@@ -186,7 +186,7 @@
/turf/simulated/floor/mineral/bananium/lubed/Initialize(mapload)
. = ..()
MakeSlippery(TURF_WET_LUBE, TRUE)
MakeSlippery(TURF_WET_LUBE, INFINITY)
/turf/simulated/floor/mineral/bananium/lubed/pry_tile(obj/item/C, mob/user, silent = FALSE) //I want to get off Mr Honk's Wild Ride
if(ishuman(user))
@@ -118,7 +118,7 @@
/turf/simulated/floor/lubed/Initialize(mapload)
. = ..()
MakeSlippery(TURF_WET_LUBE, TRUE)
MakeSlippery(TURF_WET_LUBE, INFINITY)
/turf/simulated/floor/lubed/pry_tile(obj/item/C, mob/user, silent = FALSE) //I want to get off Mr Honk's Wild Ride
if(ishuman(user))
+1 -1
View File
@@ -353,7 +353,7 @@
/turf/simulated/floor/plating/ice/Initialize(mapload)
. = ..()
MakeSlippery(TURF_WET_PERMAFROST, TRUE)
MakeSlippery(TURF_WET_PERMAFROST, INFINITY)
/turf/simulated/floor/plating/ice/try_replace_tile(obj/item/stack/tile/T, mob/user, params)
return
+4
View File
@@ -309,6 +309,10 @@
for(var/atom/movable/AM in contents)
AM.get_spooked()
// Defined here to avoid runtimes
/turf/proc/MakeDry(wet_setting = TURF_WET_WATER)
return
/turf/proc/burn_down()
return
@@ -285,7 +285,7 @@
if(prob(6))
for(var/turf/simulated/floor/O in range(src, 6))
O.MakeSlippery(TURF_WET_WATER, 10)
O.MakeSlippery(TURF_WET_WATER, 10 SECONDS)
playsound(src, 'sound/effects/clownstep1.ogg', 30, 1)
if(prob(5))
@@ -323,7 +323,7 @@
if(!eating)
addtimer(CALLBACK(src, /mob/living/simple_animal/hostile/floor_cluwne/.proc/Grab, H), 70)
for(var/turf/simulated/floor/O in range(src, 6))
O.MakeSlippery(TURF_WET_LUBE, 20)
O.MakeSlippery(TURF_WET_LUBE, 20 SECONDS)
playsound(src, 'sound/effects/meteorimpact.ogg', 30, 1)
eating = TRUE