Merge pull request #3502 from VampyrBytes/cleanSlips

Cleans up slipping code
This commit is contained in:
Fox McCloud
2016-02-07 15:11:23 -05:00
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/description, 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 [description]!</span>"
playsound(src.loc, 'sound/misc/slip.ogg', 50, 1, -3)
if (stun)
Stun(stun)
Weaken(weaken)
return 1