[READY] Refactors wet floors to a component (#36130)

* Wet Floor components

* No more turf wet slide.
This commit is contained in:
kevinz000
2018-03-16 15:26:09 -07:00
committed by yogstation13-bot
parent 7268bf8915
commit 33764678a2
23 changed files with 240 additions and 174 deletions

View File

@@ -86,3 +86,8 @@
#define CALTROP_BYPASS_SHOES 1
#define CALTROP_IGNORE_WALKERS 2
//Component Specific Signals
//Wet floors
#define COMSIG_TURF_IS_WET "check_turf_wet" //(): Returns bitflags of wet values.
#define COMSIG_TURF_MAKE_DRY "make_turf_try" //(max_strength, immediate, duration_decrease = INFINITY): Returns bool.

View File

@@ -180,15 +180,17 @@ GLOBAL_LIST_EMPTY(bloody_footprints_cache)
#define HAS_SENSORS 1
#define LOCKED_SENSORS 2
//Turf wet states
//Wet floor type flags. Stronger ones should be higher in number.
#define TURF_DRY 0
#define TURF_WET_WATER 1
#define TURF_WET_LUBE 2
#define TURF_WET_ICE 3
#define TURF_WET_PERMAFROST 4
#define TURF_WET_ICE 4
#define TURF_WET_PERMAFROST 8
//Maximum amount of time, (in approx. seconds.) a tile can be wet for.
#define MAXIMUM_WET_TIME 300
#define IS_WET_OPEN_TURF(O) O.GetComponent(/datum/component/wet_floor)
//Maximum amount of time, (in deciseconds) a tile can be wet for.
#define MAXIMUM_WET_TIME 3000
//unmagic-strings for types of polls
#define POLLTYPE_OPTION "OPTION"

View File

@@ -86,6 +86,7 @@
#define FIRE_PRIORITY_SERVER_MAINT 10
#define FIRE_PRIORITY_RESEARCH 10
#define FIRE_PRIORITY_GARBAGE 15
#define FIRE_PRIORITY_WET_FLOORS 20
#define FIRE_PRIORITY_AIR 20
#define FIRE_PRIORITY_NPC 20
#define FIRE_PRIORITY_PROCESS 25

View File

@@ -0,0 +1,5 @@
PROCESSING_SUBSYSTEM_DEF(wet_floors)
name = "Wet floors"
priority = FIRE_PRIORITY_WET_FLOORS
wait = 15
stat_tag = "WFP" //Used for logging

View File

@@ -0,0 +1,171 @@
/datum/component/wet_floor
dupe_mode = COMPONENT_DUPE_UNIQUE_PASSARGS
var/highest_strength = TURF_DRY
var/lube_flags = NONE //why do we have this?
var/list/time_left_list //In deciseconds.
var/static/mutable_appearance/permafrost_overlay = mutable_appearance('icons/effects/water.dmi', "ice_floor")
var/static/mutable_appearance/ice_overlay = mutable_appearance('icons/turf/overlays.dmi', "snowfloor")
var/static/mutable_appearance/water_overlay = mutable_appearance('icons/effects/water.dmi', "wet_floor_static")
var/static/mutable_appearance/generic_turf_overlay = mutable_appearance('icons/effects/water.dmi', "wet_static")
var/current_overlay
var/permanent = FALSE
/datum/component/wet_floor/InheritComponent(datum/newcomp, orig, argslist)
if(!newcomp) //We are getting passed the arguments of a would-be new component, but not a new component
add_wet(arglist(argslist))
else //We are being passed in a full blown component
var/datum/component/wet_floor/WF = newcomp //Lets make an assumption
if(WF.gc()) //See if it's even valid, still. Also does LAZYLEN and stuff for us.
CRASH("Wet floor component tried to inherit another, but the other was able to garbage collect while being inherited! What a waste of time!")
return
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)
if(!isopenturf(parent))
. = COMPONENT_INCOMPATIBLE
CRASH("Wet floor component attempted to be applied to a non open turf!")
add_wet(strength, duration_minimum, duration_add, duration_maximum)
RegisterSignal(COMSIG_TURF_IS_WET, .proc/is_wet)
RegisterSignal(COMSIG_TURF_MAKE_DRY, .proc/dry)
if(!permanent)
START_PROCESSING(SSwet_floors, src)
if(gc())
stack_trace("Warning: Wet floor component added and immediately deleted! What a waste of time!")
/datum/component/wet_floor/Destroy()
STOP_PROCESSING(SSwet_floors, src)
var/turf/T = parent
qdel(T.GetComponent(/datum/component/slippery))
if(istype(T)) //If this is false there is so many things wrong with it.
T.cut_overlay(current_overlay)
else
stack_trace("Warning: Wet floor component wasn't on a turf when being destroyed! This is really bad!")
return ..()
/datum/component/wet_floor/proc/update_overlay()
var/intended
if(!istype(parent, /turf/open/floor))
intended = generic_turf_overlay
else
switch(highest_strength)
if(TURF_WET_PERMAFROST)
intended = permafrost_overlay
if(TURF_WET_ICE)
intended = ice_overlay
else
intended = water_overlay
if(current_overlay != intended)
var/turf/T = parent
T.cut_overlay(current_overlay)
T.add_overlay(intended)
current_overlay = intended
/datum/component/wet_floor/proc/AfterSlip(mob/living/L)
if(highest_strength == TURF_WET_LUBE)
L.confused = max(L.confused, 8)
/datum/component/wet_floor/proc/update_flags()
var/intensity
lube_flags = NONE
switch(highest_strength)
if(TURF_WET_WATER)
intensity = 60
lube_flags = NO_SLIP_WHEN_WALKING
if(TURF_WET_LUBE)
intensity = 80
lube_flags = SLIDE | GALOSHES_DONT_HELP
if(TURF_WET_ICE)
intensity = 120
lube_flags = SLIDE | GALOSHES_DONT_HELP
if(TURF_WET_PERMAFROST)
intensity = 120
lube_flags = SLIDE_ICE | GALOSHES_DONT_HELP
else
qdel(parent.GetComponent(/datum/component/slippery))
return
var/datum/component/slippery/S = parent.LoadComponent(/datum/component/slippery, NONE, CALLBACK(src, .proc/AfterSlip))
S.intensity = intensity
S.lube_flags = lube_flags
/datum/component/wet_floor/proc/dry(strength = TURF_WET_WATER, immediate = FALSE, duration_decrease = INFINITY)
for(var/i in time_left_list)
if(text2num(i) <= strength)
time_left_list[i] = max(0, time_left_list[i] - duration_decrease)
if(immediate)
check()
/datum/component/wet_floor/proc/max_time_left()
. = 0
for(var/i in time_left_list)
. = max(., time_left_list[i])
/datum/component/wet_floor/process()
var/turf/open/T = parent
var/decrease = 0
var/t = T.GetTemperature()
switch(t)
if(-INFINITY to T0C)
add_wet(TURF_WET_ICE, max_time_left()) //Water freezes into ice!
if(T0C to T0C + 100)
decrease = (T.air.temperature - T0C) //one ds per degree.
if(T0C + 100 to INFINITY)
decrease = INFINITY
if((is_wet() & TURF_WET_ICE) && t > T0C) //Ice melts into water!
for(var/obj/O in T.contents)
if(O.flags_2 & FROZEN_2)
O.make_unfrozen()
add_wet(TURF_WET_WATER, max_time_left())
dry(TURF_WET_ICE)
dry(ALL, FALSE, decrease)
check()
/datum/component/wet_floor/proc/update_strength()
highest_strength = 0 //Not bitflag.
for(var/i in time_left_list)
highest_strength = max(highest_strength, text2num(i))
/datum/component/wet_floor/proc/is_wet()
. = 0
for(var/i in time_left_list)
. |= text2num(i)
/datum/component/wet_floor/OnTransfer(datum/to_datum)
if(!isopenturf(to_datum))
. = COMPONENT_INCOMPATIBLE
CRASH("Wet floor component attempted to be transferred to a non open turf!")
var/turf/O = parent
O.cut_overlay(current_overlay)
var/turf/T = to_datum
T.add_overlay(current_overlay)
/datum/component/wet_floor/proc/add_wet(type, duration_minimum = 0, duration_add = 0, duration_maximum = MAXIMUM_WET_TIME)
var/static/list/allowed_types = list(TURF_WET_WATER, TURF_WET_LUBE, TURF_WET_ICE, TURF_WET_PERMAFROST)
if(!duration_minimum || duration_minimum < 0 || !type || !(type in allowed_types))
return FALSE
var/time = 0
if(LAZYACCESS(time_left_list, "[type]"))
time = CLAMP(LAZYACCESS(time_left_list, "[type]") + duration_add, duration_minimum, duration_maximum)
else
time = min(duration_minimum, duration_maximum)
LAZYSET(time_left_list, "[type]", time)
check(TRUE)
return TRUE
/datum/component/wet_floor/proc/gc()
if(!LAZYLEN(time_left_list))
qdel(src)
return TRUE
/datum/component/wet_floor/proc/check(force_update = FALSE)
var/changed = FALSE
for(var/i in time_left_list)
if(time_left_list[i] <= 0)
time_left_list -= i
changed = TRUE
if(changed || force_update)
update_strength()
update_overlay()
update_flags()
gc()

View File

@@ -304,6 +304,9 @@
if(AM && isturf(AM.loc))
step(AM, turn(AM.dir, 180))
/atom/proc/handle_slip(mob/living/carbon/C, knockdown_amount, obj/O, lube)
return
//returns the mob's dna info as a list, to be inserted in an object's blood_DNA list
/mob/living/proc/get_blood_dna_list()
if(get_blood_id() != "blood")
@@ -354,9 +357,6 @@
/atom/proc/handle_fall()
return
/atom/proc/handle_slip()
return
/atom/proc/singularity_act()
return

View File

@@ -202,6 +202,6 @@
var/turf/T = get_turf(loc)
if(isopenturf(T))
var/turf/open/theturf = T
theturf.MakeSlippery(TURF_WET_WATER, min_wet_time = 10, wet_time_to_add = 5)
theturf.MakeSlippery(TURF_WET_WATER, min_wet_time = 10 SECONDS, wet_time_to_add = 5 SECONDS)
user.visible_message("[user] empties out \the [src] onto the floor using the release valve.", "<span class='info'>You quietly empty out \the [src] using its release valve.</span>")

View File

@@ -43,8 +43,7 @@
for(var/turf/T in view(freeze_range,loc))
if(isfloorturf(T))
var/turf/open/floor/F = T
F.wet = TURF_WET_PERMAFROST
addtimer(CALLBACK(F, /turf/open/floor.proc/MakeDry, TURF_WET_PERMAFROST), rand(3000, 3100))
F.MakeSlippery(TURF_WET_PERMAFROST, 6 MINUTES)
for(var/mob/living/carbon/L in T)
L.adjustStaminaLoss(stamina_damage)
L.adjust_bodytemperature(-230)

View File

@@ -247,7 +247,7 @@
soundloop.stop()
if(isopenturf(loc))
var/turf/open/tile = loc
tile.MakeSlippery(TURF_WET_WATER, min_wet_time = 5, wet_time_to_add = 1)
tile.MakeSlippery(TURF_WET_WATER, min_wet_time = 5 SECONDS, wet_time_to_add = 1 SECONDS)
/obj/machinery/shower/attackby(obj/item/I, mob/user, params)

View File

@@ -1,12 +1,16 @@
/turf/open
var/slowdown = 0 //negative for faster, positive for slower
var/wet = 0
var/wet_time = 0 // Time in seconds that this floor will be wet for.
var/mutable_appearance/wet_overlay
var/postdig_icon_change = FALSE
var/postdig_icon
var/list/archdrops
var/wet
/turf/open/Initialize()
. = ..()
if(wet)
AddComponent(/datum/component/wet_floor, wet, INFINITY, 0, INFINITY, TRUE)
/turf/open/indestructible
name = "floor"
@@ -164,11 +168,11 @@
for(var/mob/living/L in contents)
if(L.bodytemperature <= 50)
L.apply_status_effect(/datum/status_effect/freon)
MakeSlippery(TURF_WET_PERMAFROST, 5)
MakeSlippery(TURF_WET_PERMAFROST, 50)
return 1
/turf/open/proc/water_vapor_gas_act()
MakeSlippery(TURF_WET_WATER, min_wet_time = 10, wet_time_to_add = 5)
MakeSlippery(TURF_WET_WATER, min_wet_time = 100, wet_time_to_add = 50)
for(var/mob/living/simple_animal/slime/M in src)
M.apply_water()
@@ -177,7 +181,7 @@
for(var/obj/effect/O in src)
if(is_cleanable(O))
qdel(O)
return 1
return TRUE
/turf/open/handle_slip(mob/living/carbon/C, knockdown_amount, obj/O, lube)
if(C.movement_type & FLYING)
@@ -224,132 +228,23 @@
/turf/open/copyTurf(turf/T)
. = ..()
if(. && isopenturf(T) && wet_time)
var/turf/open/O = T
O.MakeSlippery(wet_setting = wet, wet_time_to_add = wet_time) //we're copied, copy how wet we are also
if(. && isopenturf(T))
GET_COMPONENT(slip, /datum/component/wet_floor)
if(slip)
var/datum/component/wet_floor/WF = T.AddComponent(/datum/component/wet_floor)
WF.InheritComponent(slip)
/turf/open/proc/MakeSlippery(wet_setting = TURF_WET_WATER, min_wet_time = 0, wet_time_to_add = 0) // 1 = Water, 2 = Lube, 3 = Ice, 4 = Permafrost, 5 = Slide
wet_time = max(wet_time+wet_time_to_add, min_wet_time)
if(wet >= wet_setting)
return
wet = wet_setting
UpdateSlip()
if(wet_setting != TURF_DRY)
if(wet_overlay)
cut_overlay(wet_overlay)
else
wet_overlay = mutable_appearance()
var/turf/open/floor/F = src
if(istype(F))
if(wet_setting == TURF_WET_PERMAFROST)
wet_overlay.icon = 'icons/effects/water.dmi'
wet_overlay.icon_state = "ice_floor"
else if(wet_setting == TURF_WET_ICE)
wet_overlay.icon = 'icons/turf/overlays.dmi'
wet_overlay.icon_state = "snowfloor"
else
wet_overlay.icon = 'icons/effects/water.dmi'
wet_overlay.icon_state = "wet_floor_static"
else
wet_overlay.icon = 'icons/effects/water.dmi'
wet_overlay.icon_state = "wet_static"
add_overlay(wet_overlay)
HandleWet()
/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/UpdateSlip()
var/intensity
var/lube_flags
switch(wet)
if(TURF_WET_WATER)
intensity = 60
lube_flags = NO_SLIP_WHEN_WALKING
if(TURF_WET_LUBE)
intensity = 80
lube_flags = SLIDE | GALOSHES_DONT_HELP
if(TURF_WET_ICE)
intensity = 120
lube_flags = SLIDE | GALOSHES_DONT_HELP
if(TURF_WET_PERMAFROST)
intensity = 120
lube_flags = SLIDE_ICE | GALOSHES_DONT_HELP
else
qdel(GetComponent(/datum/component/slippery))
return
var/datum/component/slippery/S = LoadComponent(/datum/component/slippery, NONE, CALLBACK(src, .proc/AfterSlip))
S.intensity = intensity
S.lube_flags = lube_flags
/turf/open/proc/AfterSlip(mob/living/L)
if(wet == TURF_WET_LUBE)
L.confused = max(L.confused, 8)
/turf/open/proc/MakeDry(wet_setting = TURF_WET_WATER)
if(wet > wet_setting || !wet)
return
spawn(rand(0,20))
if(wet == TURF_WET_PERMAFROST)
wet = TURF_WET_ICE
else if(wet == TURF_WET_ICE)
wet = TURF_WET_WATER
else
wet = TURF_DRY
if(wet_overlay)
cut_overlay(wet_overlay)
UpdateSlip()
/turf/open/proc/HandleWet()
if(!wet)
//It's possible for this handler to get called after all the wetness is
//cleared, so bail out if that is the case
return
if(!wet_time && wet < TURF_WET_ICE)
MakeDry(TURF_WET_ICE)
if(wet_time > MAXIMUM_WET_TIME)
wet_time = MAXIMUM_WET_TIME
if(wet == TURF_WET_ICE && air.temperature > T0C)
for(var/obj/O in contents)
if(O.flags_2 & FROZEN_2)
O.make_unfrozen()
MakeDry(TURF_WET_ICE)
MakeSlippery(TURF_WET_WATER)
if(wet != TURF_WET_PERMAFROST)
switch(air.temperature)
if(-INFINITY to T0C)
if(wet != TURF_WET_ICE && wet)
MakeDry(TURF_WET_ICE)
MakeSlippery(TURF_WET_ICE)
if(T0C to T20C)
wet_time = max(0, wet_time-1)
if(T20C to T0C + 40)
wet_time = max(0, wet_time-2)
if(T0C + 40 to T0C + 60)
wet_time = max(0, wet_time-3)
if(T0C + 60 to T0C + 80)
wet_time = max(0, wet_time-5)
if(T0C + 80 to T0C + 100)
wet_time = max(0, wet_time-10)
if(T0C + 100 to INFINITY)
wet_time = 0
else if (GetTemperature() > BODYTEMP_COLD_DAMAGE_LIMIT) //seems like a good place
MakeDry(TURF_WET_PERMAFROST)
else
wet_time = max(0, wet_time-5)
if(wet && wet < TURF_WET_ICE && !wet_time)
MakeDry(TURF_WET_ICE)
if(!wet && wet_time)
wet_time = 0
if(wet)
addtimer(CALLBACK(src, .proc/HandleWet), 15, TIMER_UNIQUE)
/turf/open/proc/MakeDry(wet_setting = TURF_WET_WATER, immediate = FALSE, amount = INFINITY)
SendSignal(COMSIG_TURF_MAKE_DRY, wet_setting, immediate, amount)
/turf/open/get_dumping_location()
return src
/turf/open/proc/ClearWet()//Nuclear option of immediately removing slipperyness from the tile instead of the natural drying over time
wet = TURF_DRY
UpdateSlip()
if(wet_overlay)
cut_overlay(wet_overlay)
qdel(GetComponent(/datum/component/wet_floor))
/turf/open/rad_act(pulse_strength)
. = ..()

View File

@@ -21,10 +21,10 @@
GET_COMPONENT(chasm_component, /datum/component/chasm)
chasm_component.drop(AM)
/turf/open/chasm/MakeSlippery(wet_setting = TURF_WET_WATER, min_wet_time = 0, wet_time_to_add = 0)
/turf/open/chasm/MakeSlippery()
return
/turf/open/chasm/MakeDry(wet_setting = TURF_WET_WATER)
/turf/open/chasm/MakeDry()
return
/turf/open/chasm/get_smooth_underlay_icon(mutable_appearance/underlay_appearance, turf/asking_turf, adjacency_dir)

View File

@@ -33,10 +33,10 @@
/turf/open/floor/plating/asteroid/burn_tile()
return
/turf/open/floor/plating/asteroid/MakeSlippery(wet_setting = TURF_WET_WATER, min_wet_time = 0, wet_time_to_add = 0)
/turf/open/floor/plating/asteroid/MakeSlippery()
return
/turf/open/floor/plating/asteroid/MakeDry(wet_setting = TURF_WET_WATER)
/turf/open/floor/plating/asteroid/MakeDry()
return
/turf/open/floor/plating/asteroid/attackby(obj/item/W, mob/user, params)

View File

@@ -143,22 +143,15 @@
planetary_atmos = TRUE
baseturfs = /turf/open/floor/plating/ice
slowdown = 1
wet = TURF_WET_PERMAFROST
attachment_holes = FALSE
/turf/open/floor/plating/ice/Initialize()
. = ..()
UpdateSlip()
MakeSlippery(TURF_WET_PERMAFROST, INFINITY, 0, INFINITY, TRUE)
/turf/open/floor/plating/ice/try_replace_tile(obj/item/stack/tile/T, mob/user, params)
return
/turf/open/floor/plating/ice/HandleWet()
if(wet == TURF_WET_ICE)
return
..()
MakeSlippery(TURF_WET_ICE) //rewet after ..() clears out lube/ice etc.
/turf/open/floor/plating/ice/smooth
icon_state = "smooth"
smooth = SMOOTH_MORE | SMOOTH_BORDER

View File

@@ -14,7 +14,7 @@
/turf/open/lava/ex_act(severity, target)
contents_explosion(severity, target)
/turf/open/lava/MakeSlippery(wet_setting = TURF_WET_WATER, min_wet_time = 0, wet_time_to_add = 0)
/turf/open/lava/MakeSlippery()
return
/turf/open/lava/MakeDry(wet_setting = TURF_WET_WATER)

View File

@@ -7,10 +7,7 @@
initial_gas_mix = LAVALAND_DEFAULT_ATMOS
planetary_atmos = TRUE
slowdown = 1
wet = TURF_WET_WATER
/turf/open/water/HandleWet()
if(wet == TURF_WET_WATER)
return
..()
MakeSlippery(TURF_WET_WATER) //rewet after ..() clears out lube/ice etc.
/turf/open/water/Initialize()
. = ..()
MakeSlippery(TURF_WET_WATER, INFINITY, 0, INFINITY, TRUE)

View File

@@ -84,6 +84,9 @@
/turf/open/space/proc/CanBuildHere()
return TRUE
/turf/open/space/handle_slip()
return
/turf/open/space/attackby(obj/item/C, mob/user, params)
..()
if(!CanBuildHere())
@@ -162,10 +165,7 @@
A.newtonian_move(A.inertia_dir)
/turf/open/space/MakeSlippery(wet_setting = TURF_WET_WATER, min_wet_time = 0, wet_time_to_add = 0)
return
/turf/open/space/handle_slip()
/turf/open/space/MakeSlippery()
return
/turf/open/space/singularity_act()

View File

@@ -64,9 +64,7 @@
/obj/item/clothing/shoes/galoshes/dry/step_action()
var/turf/open/t_loc = get_turf(src)
if(istype(t_loc) && t_loc.wet)
t_loc.MakeDry(TURF_WET_WATER)
t_loc.wet_time = 0
t_loc.SendSignal(COMSIG_TURF_MAKE_DRY, TURF_WET_WATER, TRUE, INFINITY)
/obj/item/clothing/shoes/clown_shoes
desc = "The prankster's standard-issue clowning shoes. Damn, they're huge!"

View File

@@ -27,7 +27,6 @@
add_logs(src,, "slipped",, "on [O ? O.name : "floor"]")
return loc.handle_slip(src, knockdown_amount, O, lube)
/mob/living/carbon/Process_Spacemove(movement_dir = 0)
if(..())
return 1

View File

@@ -246,7 +246,7 @@
if(prob(75))
var/turf/open/T = loc
if(istype(T))
T.MakeSlippery(TURF_WET_WATER, min_wet_time = 20, wet_time_to_add = 15)
T.MakeSlippery(TURF_WET_WATER, min_wet_time = 20 SECONDS, wet_time_to_add = 15 SECONDS)
else
visible_message("<span class='danger'>[src] whirs and bubbles violently, before releasing a plume of froth!</span>")
new /obj/effect/particle_effect/foam(loc)

View File

@@ -459,7 +459,7 @@
reac_volume = ..()
var/turf/open/T = get_turf(M)
if(istype(T) && prob(reac_volume))
T.MakeSlippery(TURF_WET_WATER, min_wet_time = 10, wet_time_to_add = 5)
T.MakeSlippery(TURF_WET_WATER, min_wet_time = 10 SECONDS, wet_time_to_add = 5 SECONDS)
M.adjust_fire_stacks(-(reac_volume / 10))
M.ExtinguishMob()
M.apply_damage(0.4*reac_volume, BRUTE)
@@ -481,7 +481,7 @@
/datum/reagent/blob/pressurized_slime/proc/extinguisharea(obj/structure/blob/B, probchance)
for(var/turf/open/T in range(1, B))
if(prob(probchance))
T.MakeSlippery(TURF_WET_WATER, min_wet_time = 10, wet_time_to_add = 5)
T.MakeSlippery(TURF_WET_WATER, min_wet_time = 10 SECONDS, wet_time_to_add = 5 SECONDS)
for(var/obj/O in T)
O.extinguish()
for(var/mob/living/L in T)

View File

@@ -124,7 +124,7 @@
if(!istype(T))
return
if(reac_volume >= 5)
T.MakeSlippery(TURF_WET_LUBE, min_wet_time = 10, wet_time_to_add = reac_volume * 1.5)
T.MakeSlippery(TURF_WET_LUBE, min_wet_time = 10 SECONDS, wet_time_to_add = reac_volume * 1.5 SECONDS)
T.name = "deep-fried [initial(T.name)]"
T.add_atom_colour(color, TEMPORARY_COLOUR_PRIORITY)
@@ -249,7 +249,7 @@
if(reac_volume >= 1) // Make Freezy Foam and anti-fire grenades!
if(isopenturf(T))
var/turf/open/OT = T
OT.MakeSlippery(wet_setting=TURF_WET_ICE, min_wet_time=10, wet_time_to_add=reac_volume) // Is less effective in high pressure/high heat capacity environments. More effective in low pressure.
OT.MakeSlippery(wet_setting=TURF_WET_ICE, min_wet_time=100, wet_time_to_add=reac_volume SECONDS) // Is less effective in high pressure/high heat capacity environments. More effective in low pressure.
OT.air.temperature -= MOLES_CELLSTANDARD*100*reac_volume/OT.air.heat_capacity() // reduces environment temperature by 5K per unit.
/datum/reagent/consumable/condensedcapsaicin
@@ -433,7 +433,7 @@
/datum/reagent/consumable/cornoil/reaction_turf(turf/open/T, reac_volume)
if (!istype(T))
return
T.MakeSlippery(TURF_WET_LUBE, min_wet_time = 10, wet_time_to_add = reac_volume*2)
T.MakeSlippery(TURF_WET_LUBE, min_wet_time = 10 SECONDS, wet_time_to_add = reac_volume*2 SECONDS)
var/obj/effect/hotspot/hotspot = (locate(/obj/effect/hotspot) in T)
if(hotspot)
var/datum/gas_mixture/lowertemp = T.remove_air(T.air.total_moles())

View File

@@ -135,7 +135,7 @@
var/CT = cooling_temperature
if(reac_volume >= 5)
T.MakeSlippery(TURF_WET_WATER, min_wet_time = 10, wet_time_to_add = min(reac_volume*1.5, 60))
T.MakeSlippery(TURF_WET_WATER, min_wet_time = 10 SECONDS, wet_time_to_add = min(reac_volume*1.5 SECONDS, 60 SECONDS))
for(var/mob/living/simple_animal/slime/M in T)
M.apply_water()
@@ -329,7 +329,7 @@
if (!istype(T))
return
if(reac_volume >= 1)
T.MakeSlippery(TURF_WET_LUBE, 15, min(reac_volume * 2, 120))
T.MakeSlippery(TURF_WET_LUBE, 15 SECONDS, min(reac_volume * 2 SECONDS, 120))
/datum/reagent/spraytan
name = "Spray Tan"
@@ -1613,9 +1613,8 @@
taste_description = "dryness"
/datum/reagent/drying_agent/reaction_turf(turf/open/T, reac_volume)
if(istype(T) && T.wet)
T.wet_time = max(0, T.wet_time-reac_volume*5) // removes 5 seconds of wetness for every unit.
T.HandleWet()
if(istype(T))
T.MakeDry(ALL, TRUE, reac_volume * 5 SECONDS) //50 deciseconds per unit
/datum/reagent/drying_agent/reaction_obj(obj/O, reac_volume)
if(O.type == /obj/item/clothing/shoes/galoshes)

View File

@@ -252,6 +252,7 @@
#include "code\controllers\subsystem\processing\processing.dm"
#include "code\controllers\subsystem\processing\projectiles.dm"
#include "code\controllers\subsystem\processing\traits.dm"
#include "code\controllers\subsystem\processing\wet_floors.dm"
#include "code\datums\action.dm"
#include "code\datums\ai_laws.dm"
#include "code\datums\armor.dm"
@@ -327,6 +328,7 @@
#include "code\datums\components\spooky.dm"
#include "code\datums\components\squeek.dm"
#include "code\datums\components\thermite.dm"
#include "code\datums\components\wet_floor.dm"
#include "code\datums\components\decals\blood.dm"
#include "code\datums\diseases\_disease.dm"
#include "code\datums\diseases\_MobProcs.dm"