Skip to content

Commit

Permalink
Merge pull request #17822 from optimumtact/keepphilfromkillinme
Browse files Browse the repository at this point in the history
MakeSlippery proc made more readable with named arguments
  • Loading branch information
Cheridan committed May 24, 2016
2 parents 3c4b771 + f2bf808 commit 6d6711f
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 15 deletions.
2 changes: 1 addition & 1 deletion code/game/objects/items/weapons/extinguisher.dm
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@
var/turf/T = get_turf(loc)
if(istype(T, /turf/open))
var/turf/open/theturf = T
theturf.MakeSlippery(min = 10, max = 5)
theturf.MakeSlippery(min_wet_time = 10, wet_time_to_add = 5)

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
4 changes: 2 additions & 2 deletions code/game/objects/structures/watercloset.dm
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@
else
if(istype(loc, /turf/open))
var/turf/open/tile = loc
tile.MakeSlippery(min = 5, max = 1)
tile.MakeSlippery(min_wet_time = 5, wet_time_to_add = 1)


/obj/machinery/shower/attackby(obj/item/I, mob/user, params)
Expand Down Expand Up @@ -492,4 +492,4 @@
/obj/structure/sink/puddle/attackby(obj/item/O, mob/user, params)
icon_state = "puddle-splash"
. = ..()
icon_state = "puddle"
icon_state = "puddle"
6 changes: 2 additions & 4 deletions code/game/turfs/open.dm
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,8 @@
C.spin(1,1)
return 1

/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
/turf/open/proc/MakeSlippery(wet_setting = TURF_WET_WATER, min_wet_time = 0, wet_time_to_add = 0) // 1 = Water, 2 = Lube, 3 = Ice
wet_time = max(wet_time+wet_time_to_add, min_wet_time)
if(wet >= wet_setting)
return
wet = wet_setting
Expand Down
2 changes: 1 addition & 1 deletion code/modules/mob/living/simple_animal/bot/cleanbot.dm
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@

if(prob(10)) //Wets floors randomly
var/turf/open/OT = get_turf(loc)
OT.MakeSlippery(min = 5, max = 1)
OT.MakeSlippery(min_wet_time = 5, wet_time_to_add = 1)

if(prob(5)) //Spawns foam!
visible_message("<span class='danger'>[src] whirs and bubbles violently, before releasing a plume of froth!</span>")
Expand Down
6 changes: 3 additions & 3 deletions code/modules/reagents/chemistry/reagents/blob_reagents.dm
Original file line number Diff line number Diff line change
Expand Up @@ -565,7 +565,7 @@
reac_volume = ..()
var/turf/open/T = get_turf(M)
if(istype(T) && prob(reac_volume))
T.MakeSlippery(min = 5, max = 1)
T.MakeSlippery(min_wet_time = 5, wet_time_to_add = 1)
M.adjust_fire_stacks(-(reac_volume / 10))
M.ExtinguishMob()
M.apply_damage(0.1*reac_volume, BRUTE)
Expand All @@ -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(min = 5, max = 1)
T.MakeSlippery(min_wet_time = 5, wet_time_to_add = 1)
for(var/obj/O in T)
O.extinguish()
for(var/mob/living/L in T)
Expand Down Expand Up @@ -663,4 +663,4 @@
if(message_living && !issilicon(M))
totalmessage += message_living
totalmessage += "!"
M << "<span class='userdanger'>[totalmessage]</span>"
M << "<span class='userdanger'>[totalmessage]</span>"
4 changes: 2 additions & 2 deletions code/modules/reagents/chemistry/reagents/food_reagents.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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_ICE, 5, reac_volume*0.5) // 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=5, wet_time_to_add=reac_volume*0.5) // 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
Expand Down Expand Up @@ -324,7 +324,7 @@
/datum/reagent/consumable/cornoil/reaction_turf(turf/open/T, reac_volume)
if (!istype(T))
return
T.MakeSlippery(min = 5, max = reac_volume*2)
T.MakeSlippery(min_wet_time = 5, wet_time_to_add = 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() )
Expand Down
4 changes: 2 additions & 2 deletions code/modules/reagents/chemistry/reagents/other_reagents.dm
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@
var/CT = cooling_temperature

if(reac_volume >= 5)
T.MakeSlippery(min = 5, max = reac_volume*0.2)
T.MakeSlippery(min_wet_time = 5, wet_time_to_add = reac_volume*0.2)

for(var/mob/living/simple_animal/slime/M in T)
M.apply_water()
Expand Down Expand Up @@ -258,7 +258,7 @@
/datum/reagent/lube/reaction_turf(turf/open/T, reac_volume)
if (!istype(T)) return
if(reac_volume >= 1)
T.MakeSlippery(TURF_WET_LUBE, 5, reac_volume)
T.MakeSlippery(wet_setting=TURF_WET_LUBE, min_wet_time=5, wet_time_to_add=reac_volume)

/datum/reagent/spraytan
name = "Spray Tan"
Expand Down

0 comments on commit 6d6711f

Please sign in to comment.