Merge pull request #6117 from Citadel-Station-13/upstream-merge-36697

[MIRROR] Fixes wet floor scaling
This commit is contained in:
deathride58
2018-03-27 17:45:59 +00:00
committed by GitHub
4 changed files with 11 additions and 4 deletions
+1 -1
View File
@@ -195,7 +195,7 @@ GLOBAL_LIST_EMPTY(bloody_footprints_cache)
#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
#define MAXIMUM_WET_TIME 5 MINUTES
//unmagic-strings for types of polls
#define POLLTYPE_OPTION "OPTION"
@@ -1,5 +1,7 @@
PROCESSING_SUBSYSTEM_DEF(wet_floors)
name = "Wet floors"
priority = FIRE_PRIORITY_WET_FLOORS
wait = 15
wait = 10
stat_tag = "WFP" //Used for logging
var/temperature_coeff = 2
var/time_ratio = 1.5 SECONDS
+6 -1
View File
@@ -9,6 +9,7 @@
var/static/mutable_appearance/generic_turf_overlay = mutable_appearance('icons/effects/water.dmi', "wet_static")
var/current_overlay
var/permanent = FALSE
var/last_process = 0
/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
@@ -32,6 +33,7 @@
if(!permanent)
START_PROCESSING(SSwet_floors, src)
addtimer(CALLBACK(src, .proc/gc, TRUE), 1) //GC after initialization.
last_process = world.time
/datum/component/wet_floor/Destroy()
STOP_PROCESSING(SSwet_floors, src)
@@ -103,15 +105,17 @@
/datum/component/wet_floor/process()
var/turf/open/T = parent
var/diff = world.time - last_process
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.
decrease = ((T.air.temperature - T0C) / SSwet_floors.temperature_coeff) * (diff / SSwet_floors.time_ratio)
if(T0C + 100 to INFINITY)
decrease = INFINITY
decrease = max(0, decrease)
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)
@@ -120,6 +124,7 @@
dry(TURF_WET_ICE)
dry(ALL, FALSE, decrease)
check()
last_process = world.time
/datum/component/wet_floor/proc/update_strength()
highest_strength = 0 //Not bitflag.
@@ -135,7 +135,7 @@
var/CT = cooling_temperature
if(reac_volume >= 5)
T.MakeSlippery(TURF_WET_WATER, min_wet_time = 10 SECONDS, wet_time_to_add = min(reac_volume*1.5 SECONDS, 60 SECONDS))
T.MakeSlippery(TURF_WET_WATER, 10 SECONDS, min(reac_volume*1.5 SECONDS, 60 SECONDS))
for(var/mob/living/simple_animal/slime/M in T)
M.apply_water()