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
+2 -10
View File
@@ -985,16 +985,8 @@ steam.start() -- spawns the effect
return
if (istype(AM, /mob/living/carbon))
var/mob/M = AM
if (istype(M, /mob/living/carbon/human) && (istype(M:shoes, /obj/item/clothing/shoes) && M:shoes.flags&NOSLIP) || M.buckled)
return
if (istype (M, /mob/living/carbon/human) && M:species.bodyflags & FEET_NOSLIP)
return
M.stop_pulling()
M << "\blue You slipped on the foam!"
playsound(src.loc, 'sound/misc/slip.ogg', 50, 1, -3)
M.Stun(5)
M.Weaken(2)
var/mob/living/carbon/M = AM
M.slip("foam", 5, 2)
/datum/effect/system/foam_spread
+2 -13
View File
@@ -1214,19 +1214,8 @@ var/global/list/obj/item/device/pda/PDAs = list()
/obj/item/device/pda/clown/Crossed(AM as mob|obj) //Clown PDA is slippery.
if (istype(AM, /mob/living/carbon))
var/mob/M = AM
if ((istype(M, /mob/living/carbon/human) && (istype(M:shoes, /obj/item/clothing/shoes) && M:shoes.flags&NOSLIP)) || M.m_intent == "walk")
return
if ((istype(M, /mob/living/carbon/human) && (M.real_name != src.owner) && (istype(src.cartridge, /obj/item/weapon/cartridge/clown))))
if (src.cartridge.charges < 5)
src.cartridge.charges++
M.stop_pulling()
M << "\blue You slipped on the PDA!"
playsound(src.loc, 'sound/misc/slip.ogg', 50, 1, -3)
M.Stun(8)
M.Weaken(5)
var/mob/living/carbon/M = AM
M.slip("pda", 8, 5, 0, 1)
/obj/item/device/pda/proc/available_pdas()
var/list/names = list()
+4 -24
View File
@@ -22,36 +22,16 @@
/obj/item/weapon/bananapeel/Crossed(AM as mob|obj)
if (istype(AM, /mob/living/carbon))
var/mob/M = AM
if (istype(M, /mob/living/carbon/human) && (isobj(M:shoes) && M:shoes.flags&NOSLIP) || M.buckled)
return
if(istype(M, /mob/living/carbon/human) && M:species.bodyflags & FEET_NOSLIP)
return
if(M.flying)
return
M.stop_pulling()
M << "\blue You slipped on the [name]!"
playsound(src.loc, 'sound/misc/slip.ogg', 50, 1, -3)
M.Stun(4)
M.Weaken(2)
var/mob/living/carbon/M = AM
M.slip("banana peel", 4, 2)
/*
* Soap
*/
/obj/item/weapon/soap/Crossed(AM as mob|obj) //EXACTLY the same as bananapeel for now, so it makes sense to put it in the same dm -- Urist
if (istype(AM, /mob/living/carbon))
var/mob/M = AM
if (istype(M, /mob/living/carbon/human) && (isobj(M:shoes) && M:shoes.flags&NOSLIP) || M.buckled)
return
if(M.flying)
return
M.stop_pulling()
M << "\blue You slipped on the [name]!"
playsound(src.loc, 'sound/misc/slip.ogg', 50, 1, -3)
M.Stun(4)
M.Weaken(2)
var/mob/living/carbon/M = AM
M.slip("soap", 4, 2)
/obj/item/weapon/soap/afterattack(atom/target, mob/user as mob, proximity)
if(!proximity) return
@@ -62,8 +62,8 @@
Crossed(AM as mob|obj)
var/burned = rand(2,5)
if(istype(AM, /mob/living))
var/mob/living/M = AM
if(istype(AM, /mob/living/carbon))
var/mob/living/carbon/M = AM
if(ishuman(M))
if(isobj(M:shoes))
if((M:shoes.flags&NOSLIP) || (M:species.bodyflags & FEET_NOSLIP))
@@ -73,16 +73,8 @@
M.take_overall_damage(0, max(0, (burned - 2)))
if(!istype(M, /mob/living/carbon/slime) && !isrobot(M))
M.stop_pulling()
step(M, M.dir)
spawn(1) step(M, M.dir)
spawn(2) step(M, M.dir)
spawn(3) step(M, M.dir)
spawn(4) step(M, M.dir)
M.slip("banana peel!", 0, 7, 4)
M.take_organ_damage(2) // Was 5 -- TLE
M << "\blue You slipped on \the [name]!"
playsound(src.loc, 'sound/misc/slip.ogg', 50, 1, -3)
M.Weaken(7)
M.take_overall_damage(0, burned)
throw_impact(atom/hit_atom)