From 74efb98e02ff0d9c1580f431a7abeb667472758b Mon Sep 17 00:00:00 2001 From: Geeves Date: Wed, 13 Nov 2019 22:15:32 +0200 Subject: [PATCH] crawl buffs (#7334) --- code/game/turfs/turf.dm | 43 +++++++++++++++---- .../changelogs/geeves - crawlingInMyCrawl.yml | 6 +++ 2 files changed, 40 insertions(+), 9 deletions(-) create mode 100644 html/changelogs/geeves - crawlingInMyCrawl.yml diff --git a/code/game/turfs/turf.dm b/code/game/turfs/turf.dm index bd9fae3270a..3d9a18ef579 100644 --- a/code/game/turfs/turf.dm +++ b/code/game/turfs/turf.dm @@ -409,7 +409,7 @@ var/const/enterloopsanity = 100 L.Add(t) return L - +// CRAWLING + MOVING STUFF /turf/MouseDrop_T(atom/movable/O as mob|obj, mob/user as mob) var/turf/T = get_turf(user) var/area/A = T.loc @@ -417,7 +417,7 @@ var/const/enterloopsanity = 100 return if(istype(O, /obj/screen)) return - if(user.restrained() || user.stat || user.stunned || user.paralysis || !user.lying) + if(user.restrained() || user.stat || user.incapacitated(INCAPACITATION_KNOCKOUT) || !user.lying) return if((!(istype(O, /atom/movable)) || O.anchored || !Adjacent(user) || !Adjacent(O) || !user.Adjacent(O))) return @@ -425,15 +425,40 @@ var/const/enterloopsanity = 100 return if(isanimal(user) && O != user) return + + var/tally = 0 + if(ishuman(user)) var/mob/living/carbon/human/H = user - var/has_right_hand = TRUE + var/obj/item/organ/external/rhand = H.organs_by_name["r_hand"] - if(!rhand || rhand.is_stump()) - has_right_hand = FALSE + tally += limbCheck(rhand) + var/obj/item/organ/external/lhand = H.organs_by_name["l_hand"] - if(!lhand || lhand.is_stump()) - if(!has_right_hand) - return - if (do_after(user, 25 + (5 * user.weakened)) && !(user.stat)) + tally += limbCheck(lhand) + + var/obj/item/organ/external/rfoot = H.organs_by_name["r_foot"] + tally += limbCheck(rfoot) + + var/obj/item/organ/external/lfoot = H.organs_by_name["l_foot"] + tally += limbCheck(lfoot) + + if(tally >= 120) + to_chat(user, span("notice", "You're too injured to do this!")) + return + + var/finaltime = 25 + (5 * (user.weakened * 1.5)) + if(tally >= 45) // If you have this much missing, you'll crawl slower. + finaltime += tally + + if(do_after(user, finaltime) && !user.stat) step_towards(O, src) + +// Checks status of limb, returns an amount to +/turf/proc/limbCheck(var/obj/item/organ/external/limb) + if(!limb) // Limb is null, thus missing. Add 3 seconds. + return 30 + else if(!limb.is_usable() || limb.is_broken()) // You can't use the limb, but it's still there to manoevre yourself + return 15 + else + return 0 \ No newline at end of file diff --git a/html/changelogs/geeves - crawlingInMyCrawl.yml b/html/changelogs/geeves - crawlingInMyCrawl.yml new file mode 100644 index 00000000000..38eb72a87fc --- /dev/null +++ b/html/changelogs/geeves - crawlingInMyCrawl.yml @@ -0,0 +1,6 @@ +author: Geeves + +delete-after: True + +changes: + - rscadd: "You can now crawl under a lot more circumstances, if you click drag yourself while laying down." \ No newline at end of file