Makes floor cluwnes slippery tiles not stay there till the end of times

This commit is contained in:
joep van der velden
2020-03-22 22:40:37 +01:00
parent 63ea21b20e
commit 9af501b062
5 changed files with 18 additions and 11 deletions
+13 -6
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,15 @@
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 == null)
time = rand(790, 820)
addtimer(CALLBACK(src, /turf/simulated./proc/MakeDry, wet_setting), time)
/turf/simulated/proc/MakeDry(wet_setting = TURF_WET_WATER)
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
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
@@ -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