diff --git a/code/game/objects/effects/effect_system.dm b/code/game/objects/effects/effect_system.dm index 128fe3850a1..2fef944acf8 100644 --- a/code/game/objects/effects/effect_system.dm +++ b/code/game/objects/effects/effect_system.dm @@ -845,15 +845,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)) - 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(5, 2, src) /datum/effect/effect/system/foam_spread diff --git a/code/game/objects/items/devices/PDA/PDA.dm b/code/game/objects/items/devices/PDA/PDA.dm index 8ba2e3f6d59..792bfa55b74 100644 --- a/code/game/objects/items/devices/PDA/PDA.dm +++ b/code/game/objects/items/devices/PDA/PDA.dm @@ -960,20 +960,13 @@ 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:honk_charges < 5) - src.cartridge:honk_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 + if(M.slip(8, 5, src, NO_SLIP_WHEN_WALKING)) + if (ishuman(M) && (M.real_name != src.owner)) + if (istype(src.cartridge, /obj/item/weapon/cartridge/clown)) + var/obj/item/weapon/cartridge/clown/cart = src.cartridge + if(cart.honk_charges < 5) + cart.honk_charges++ //AI verb and proc for sending PDA messages. diff --git a/code/game/objects/items/weapons/clown_items.dm b/code/game/objects/items/weapons/clown_items.dm index 47d1846e6ad..4ca4d3160c1 100644 --- a/code/game/objects/items/weapons/clown_items.dm +++ b/code/game/objects/items/weapons/clown_items.dm @@ -10,30 +10,17 @@ */ /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)) - return + var/mob/living/carbon/M = AM + M.slip(4, 2, src) - 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) /* * 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)) - return - - M.stop_pulling() - M << "\blue You slipped on the [name]!" - playsound(src.loc, 'sound/misc/slip.ogg', 50, 1, -3) - M.Stun(3) - M.Weaken(2) + var/mob/living/carbon/M = AM + M.slip(3, 2, src) /obj/item/weapon/soap/afterattack(atom/target, mob/user as mob, proximity) if(!proximity) return diff --git a/code/game/turfs/simulated.dm b/code/game/turfs/simulated.dm index 7bd7b596a96..fab95d2400e 100644 --- a/code/game/turfs/simulated.dm +++ b/code/game/turfs/simulated.dm @@ -54,41 +54,13 @@ playsound(src, "clownstep", 20, 1) switch (src.wet) - if(1) - if(istype(M, /mob/living/carbon/human)) // Added check since monkeys don't have shoes - if ((M.m_intent == "run") && !(istype(M:shoes, /obj/item/clothing/shoes) && M:shoes.flags&NOSLIP)) - M.stop_pulling() - step(M, M.dir) - M << "\blue You slipped on the wet floor!" - playsound(src, 'sound/misc/slip.ogg', 50, 1, -3) - M.Stun(8) - M.Weaken(5) - else - M.inertia_dir = 0 - return - else if(!istype(M, /mob/living/carbon/slime)) - if (M.m_intent == "run") - M.stop_pulling() - step(M, M.dir) - M << "\blue You slipped on the wet floor!" - playsound(src, 'sound/misc/slip.ogg', 50, 1, -3) - M.Stun(8) - M.Weaken(5) - else - M.inertia_dir = 0 - return + if(1) //wet floor + if(!M.slip(8, 5, null, (NO_SLIP_WHEN_WALKING|STEP))) + M.inertia_dir = 0 + return + + if(2) //lube + M.slip(0, 10, null, (STEP|SLIDE|GALOSHES_DONT_HELP)) - if(2) //lube //can cause infinite loops - needs work - if(!istype(M, /mob/living/carbon/slime)) - 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.take_organ_damage(2) // Was 5 -- TLE - M << "\blue You slipped on the floor!" - playsound(src, 'sound/misc/slip.ogg', 50, 1, -3) - M.Weaken(10) ..() \ No newline at end of file diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index d9e5925f20e..4f829ca40be 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -547,3 +547,29 @@ else if(prob(50)) return "trails_1" return "trails_2" + +var/const/NO_SLIP_WHEN_WALKING = 1 +var/const/STEP = 2 +var/const/SLIDE = 4 +var/const/GALOSHES_DONT_HELP = 8 +/mob/living/carbon/slip(var/s_amount, var/w_amount, var/obj/O, var/lube) + if (m_intent=="walk" && (lube&NO_SLIP_WHEN_WALKING)) + return 0 + if(!lying) + stop_pulling() + if(lube&STEP) + step(src, src.dir) + if(lube&SLIDE) + for(var/i=1, i<5, i++) + spawn (i) + step(src, src.dir) + take_organ_damage(2) + if(O) + src << "You slipped on the [O.name]!" + else + src << "You slipped!" + playsound(loc, 'sound/misc/slip.ogg', 50, 1, -3) + Stun(s_amount) + Weaken(w_amount) + return 1 + return 0 // no success. Used in clown pda and wet floors \ No newline at end of file diff --git a/code/modules/mob/living/carbon/human/human_movement.dm b/code/modules/mob/living/carbon/human/human_movement.dm index ce3f80398ad..edb6e5b37ab 100644 --- a/code/modules/mob/living/carbon/human/human_movement.dm +++ b/code/modules/mob/living/carbon/human/human_movement.dm @@ -18,7 +18,7 @@ if(shoes) tally += shoes.slowdown - + if(back) tally += back.slowdown @@ -64,3 +64,9 @@ prob_slip = round(prob_slip) return(prob_slip) + + +/mob/living/carbon/human/slip(var/s_amount, var/w_amount, var/obj/O, var/lube) + if(isobj(shoes) && (shoes.flags&NOSLIP) && !(lube&GALOSHES_DONT_HELP)) + return 0 + .=..() \ No newline at end of file diff --git a/code/modules/mob/living/carbon/metroid/metroid.dm b/code/modules/mob/living/carbon/metroid/metroid.dm index aeb9717693d..45f6d940dc4 100644 --- a/code/modules/mob/living/carbon/metroid/metroid.dm +++ b/code/modules/mob/living/carbon/metroid/metroid.dm @@ -964,6 +964,12 @@ mob/living/carbon/slime/var/temperature_resistance = T0C+75 /mob/living/carbon/slime/getTrail() return null +/mob/living/carbon/slime/slip(var/s_amount, var/w_amount, var/obj/O, var/lube) + if(lube>=2) + return 0 + .=..() + + //////////////////////////////Old shit from metroids/RoRos, and the old cores, would not take much work to re-add them//////////////////////// /* diff --git a/code/modules/mob/mob_movement.dm b/code/modules/mob/mob_movement.dm index 9f107361df7..b947beb1267 100644 --- a/code/modules/mob/mob_movement.dm +++ b/code/modules/mob/mob_movement.dm @@ -442,4 +442,7 @@ M.start_pulling(t) else step(pulling, get_dir(pulling.loc, A)) - return \ No newline at end of file + return + +/mob/proc/slip(var/s_amount, var/w_amount, var/obj/O, var/lube) + return