Crawling now works with WASD. (#14277)

This commit is contained in:
Matt Atlas
2022-06-14 00:51:18 +02:00
committed by GitHub
parent 444a22a200
commit fa73fe0100
5 changed files with 76 additions and 58 deletions
@@ -4,6 +4,9 @@
if(species.slowdown)
tally = species.slowdown
if(lying) //Crawling, it's slower
tally += (8 + ((weakened * 3) + (confused * 2)))
tally += get_pulling_movement_delay()
if (istype(loc, /turf/space) || isopenturf(loc))
+3 -1
View File
@@ -222,6 +222,8 @@
return 0
/mob/proc/movement_delay()
if(lying) //Crawling, it's slower
. += (8 + ((weakened * 3) + (confused * 2)))
. = get_pulling_movement_delay()
/mob/proc/get_pulling_movement_delay()
@@ -943,7 +945,7 @@
lying = 0
else
lying = incapacitated(INCAPACITATION_KNOCKDOWN)
canmove = !incapacitated(INCAPACITATION_DISABLED)
canmove = !incapacitated(INCAPACITATION_KNOCKOUT)
if(lying)
density = 0
+29 -3
View File
@@ -245,9 +245,6 @@
if(!mob.canmove || mob.paralysis)
return
//if(istype(mob.loc, /turf/space) || (mob.flags & NOGRAV))
// if(!mob.Process_Spacemove(0)) return 0
if(!mob.lastarea)
mob.lastarea = get_area(mob.loc)
@@ -323,6 +320,12 @@
move_delay += tally
if(mob_is_human && mob.lying)
var/mob/living/carbon/human/H = mob
var/crawl_tally = H.get_crawl_tally()
if(crawl_tally >= 120)
return FALSE
var/tickcomp = 0 //moved this out here so we can use it for vehicles
if(config.Tickcomp)
// move_delay -= 1.3 //~added to the tickcomp calculation below
@@ -375,6 +378,29 @@
var/atom/O = mob.loc
return O.relaymove(mob, direct)
/mob/living/carbon/human/proc/get_crawl_tally()
var/obj/item/organ/external/rhand = organs_by_name[BP_R_HAND]
. += limb_check(rhand)
var/obj/item/organ/external/lhand = organs_by_name[BP_L_HAND]
. += limb_check(lhand)
var/obj/item/organ/external/rfoot = organs_by_name[BP_R_FOOT]
. += limb_check(rfoot)
var/obj/item/organ/external/lfoot = organs_by_name[BP_L_FOOT]
. += limb_check(lfoot)
// Checks status of limb, returns an amount to
/mob/living/carbon/human/proc/limb_check(var/obj/item/organ/external/limb)
if(!limb) // Limb is null, thus missing.
return 30
else if(!limb.is_usable() || limb.is_broken()) // You can't use the limb, but it's still there to maneuvre yourself
return 15
else
return 0
/mob/proc/SelfMove(turf/n, direct)
return Move(n, direct)