Cleans up slipping code

Puts slipping into one proc rather than being dealt with individually by
each item.

The only changes to functionality here are where it would have been
possible to slip on some items whilst flying. It will make any changes
decided on in #3490 or any future changes far more easy to implement
This commit is contained in:
VampyrBytes
2016-02-03 09:44:32 +00:00
parent c3973fff4c
commit de45fc9aba
6 changed files with 38 additions and 94 deletions
+21 -1
View File
@@ -759,4 +759,24 @@ var/list/ventcrawl_machinery = list(/obj/machinery/atmospherics/unary/vent_pump,
W.loc = loc
W.dropped(src)
if (W)
W.layer = initial(W.layer)
W.layer = initial(W.layer)
/mob/living/carbon/proc/slip(var/slippery, var/stun, var/weaken, var/tilesSlipped, var/walkSafely, var/slipAny)
if (flying || buckled || (walkSafely && m_intent == "walk"))
return
if (!(slipAny))
if (istype(src, /mob/living/carbon/human))
var/mob/living/carbon/human/H = src
if ((isobj(H.shoes) && H.shoes.flags & NOSLIP) || H.species.bodyflags & FEET_NOSLIP)
return
if (tilesSlipped)
for(var/t = 0, t<=tilesSlipped, t++)
spawn (t) step(src, src.dir)
stop_pulling()
src << "<span class='notice'>You slipped on the [slippery]!</span>"
playsound(src.loc, 'sound/misc/slip.ogg', 50, 1, -3)
if (stun)
Stun(stun)
Weaken(weaken)
return 1