wetness stuff

This commit is contained in:
nullbear
2016-05-02 06:19:28 -07:00
parent 9c53ce5f85
commit f97c8c2af4
11 changed files with 57 additions and 34 deletions
+3
View File
@@ -285,6 +285,9 @@ var/list/bloody_footprints_cache = list()
#define TURF_WET_ICE 3
#define TURF_WET_PERMAFROST 4
//Maximum amount of time, (in approx. seconds.) a tile can be wet for.
#define MAXIMUM_WET_TIME 300
//Object/Item sharpness
#define IS_BLUNT 0
#define IS_SHARP 1
@@ -174,7 +174,7 @@
var/turf/T = get_turf(loc)
if(istype(T, /turf/open))
var/turf/open/theturf = T
theturf.MakeSlippery(TURF_WET_WATER)
theturf.MakeSlippery(min = 4, max = 2)
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>")
return
+1 -1
View File
@@ -182,7 +182,7 @@
else
if(istype(loc, /turf/open))
var/turf/open/tile = loc
tile.MakeSlippery()
tile.MakeSlippery(min = 10, max = 5)
/obj/machinery/shower/attackby(obj/item/I, mob/user, params)
+39 -18
View File
@@ -2,6 +2,7 @@
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/image/wet_overlay = null
/turf/open/Initalize_Atmos(times_fired)
@@ -86,7 +87,10 @@
C.spin(1,1)
return 1
/turf/open/proc/MakeSlippery(wet_setting = TURF_WET_WATER) // 1 = Water, 2 = Lube, 3 = Ice
/turf/open/proc/MakeSlippery(wet_setting = TURF_WET_WATER, min = 0, max = 0) // 1 = Water, 2 = Lube, 3 = Ice
wet_time += max
if(wet_time < min)
wet_time = min
if(wet >= wet_setting)
return
wet = wet_setting
@@ -103,32 +107,49 @@
else
wet_overlay = image('icons/effects/water.dmi', src, "wet_static")
overlays += wet_overlay
if(wet < TURF_WET_ICE)
addtimer(src, "MakeDry", rand(790, 820))
addtimer(src, "HandleWet", 30, 1)
/turf/open/proc/MakeDry(wet_setting = TURF_WET_WATER)
if(!istype(src, /turf)) //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 || !wet)
return
if(wet == TURF_WET_PERMAFROST)
wet = TURF_WET_ICE
else
wet = TURF_DRY
if(wet_overlay)
overlays -= wet_overlay
spawn(rand(0,20))
wet = TURF_DRY
if(wet_overlay)
overlays -= wet_overlay
/turf/open/proc/HandleWet()
if(!istype(src, /turf))
return
if(!wet || wet > TURF_WET_ICE)
return
if(air.temperature < T0C && wet != TURF_WET_ICE)
if(!wet_time && wet < TURF_WET_ICE)
MakeDry(TURF_WET_ICE)
MakeSlippery(TURF_WET_ICE)
else if (wet == TURF_WET_ICE)
if(wet_time > MAXIMUM_WET_TIME)
wet_time = MAXIMUM_WET_TIME
if(wet == TURF_WET_ICE && air.temperature > T0C)
MakeDry(TURF_WET_ICE)
MakeSlippery(TURF_WET_WATER)
else if (air.temperature > T0C + 40) // Warm rooms will dry up rather quickly.
addtimer(src, "MakeDry", 100, 1, TURF_WET_ICE)
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
if(wet && wet < TURF_WET_ICE && !wet_time)
MakeDry(TURF_WET_ICE)
if(!wet && wet_time)
wet_time = 0
if(wet)
addtimer(src, "HandleWet", 30, 1)
@@ -117,8 +117,6 @@
perform_exposure()
if(location.wet) location.wet = 0
if(bypassing)
icon_state = "3"
location.burn_tile()
@@ -192,7 +192,6 @@
if(air.temperature > MINIMUM_TEMPERATURE_START_SUPERCONDUCTION)
if(consider_superconductivity(starting = 1))
remove = 0
HandleWet() // if the tile is wet, and cold, make ice. Or if it's wet, and warm, dry it off.
if(!our_excited_group && remove == 1)
SSair.remove_from_active(src)
@@ -62,6 +62,7 @@
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
/obj/item/clothing/shoes/clown_shoes
desc = "The prankster's standard-issue clowning shoes. Damn, they're huge!"
@@ -104,8 +104,8 @@
victim.acid_act(5, 2, 100)
if(prob(10)) //Wets floors randomly
var/turf/open/T = loc
T.MakeSlippery()
var/turf/open/OT = get_turf(loc)
OT.MakeSlippery(min = 15, max = 5)
if(prob(5)) //Spawns foam!
visible_message("<span class='danger'>[src] whirs and bubbles violently, before releasing a plume of froth!</span>")
@@ -565,7 +565,7 @@
reac_volume = ..()
var/turf/open/T = get_turf(M)
if(istype(T) && prob(reac_volume))
T.MakeSlippery(TURF_WET_WATER)
T.MakeSlippery(min = 15, max = 1)
M.adjust_fire_stacks(-(reac_volume / 10))
M.ExtinguishMob()
M.apply_damage(0.1*reac_volume, BRUTE)
@@ -586,7 +586,7 @@
/datum/reagent/blob/pressurized_slime/proc/extinguisharea(obj/effect/blob/B, probchance)
for(var/turf/open/T in range(1, B))
if(prob(probchance))
T.MakeSlippery(TURF_WET_WATER)
T.MakeSlippery(min = 15, max = 1)
for(var/obj/O in T)
O.extinguish()
for(var/mob/living/L in T)
@@ -155,7 +155,7 @@
if(reac_volume >= 1) // Make Freezy Foam and anti-fire grenades!
if(istype(T, /turf/open))
var/turf/open/OT = T
OT.MakeSlippery(TURF_WET_WATER) // Is less effective in high pressure/high heat capacity environments. More effective in low pressure.
OT.MakeSlippery(TURF_WET_ICE, 15, reac_volume) // 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
@@ -318,8 +318,7 @@
/datum/reagent/consumable/cornoil/reaction_turf(turf/open/T, reac_volume)
if (!istype(T))
return
if(reac_volume >= 3)
T.MakeSlippery()
T.MakeSlippery(min = 20, max = reac_volume*2)
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() )
@@ -121,8 +121,9 @@
/datum/reagent/water/reaction_turf(turf/open/T, reac_volume)
if (!istype(T)) return
var/CT = cooling_temperature
if(reac_volume >= 10)
T.MakeSlippery()
if(reac_volume >= 5)
T.MakeSlippery(min = 10, max = reac_volume)
for(var/mob/living/simple_animal/slime/M in T)
M.apply_water()
@@ -254,7 +255,7 @@
/datum/reagent/lube/reaction_turf(turf/open/T, reac_volume)
if (!istype(T)) return
if(reac_volume >= 1)
T.MakeSlippery(TURF_WET_LUBE)
T.MakeSlippery(TURF_WET_LUBE, 10, reac_volume)
/datum/reagent/spraytan
name = "Spray Tan"
@@ -1123,7 +1124,8 @@
/datum/reagent/drying_agent/reaction_turf(turf/open/T, reac_volume)
if(istype(T) && T.wet)
T.MakeDry(TURF_WET_WATER)
T.wet_time = max(0, T.wet_time-reac_volume*5) // removes 5 seconds of wetness for every unit.
T.HandleWet()
/datum/reagent/drying_agent/reaction_obj(obj/O, reac_volume)
if(O.type == /obj/item/clothing/shoes/galoshes)