[MIRROR] fixes not being able to resist out of aggro grabs [MDB IGNORE] (#11262)

* fixes not being able to resist out of aggro grabs (#64642)

* fixes not being able to resist out of aggro grabs

Co-authored-by: John Willard <53777086+JohnFulpWillard@users.noreply.github.com>
This commit is contained in:
SkyratBot
2022-02-03 20:41:27 +00:00
committed by GitHub
co-authored by John Willard
parent c46af1053f
commit 6eb22e1ff1
2 changed files with 13 additions and 9 deletions
+12 -8
View File
@@ -465,28 +465,28 @@
death()
/**
* Checks if a mob is incapacitated
* Checks if a mob is incapacitated
*
* Normally being restrained, agressively grabbed, or in stasis counts as incapacitated
* unless there is a flag being used to check if it's ignored
*
*
* args:
* * flags (optional) bitflags that determine if special situations are exempt from being considered incapacitated
*
*
* bitflags: (see code/__DEFINES/status_effects.dm)
* * IGNORE_RESTRAINTS - mob in a restraint (handcuffs) is not considered incapacitated
* * IGNORE_STASIS - mob in stasis (stasis bed, etc.) is not considered incapacitated
* * IGNORE_GRAB - mob that is agressively grabbed is not considered incapacitated
* * IGNORE_GRAB - mob that is agressively grabbed is not considered incapacitated
**/
/mob/living/incapacitated(flags)
if(HAS_TRAIT(src, TRAIT_INCAPACITATED))
return TRUE
if(HAS_TRAIT(src, TRAIT_RESTRAINED) && !(flags & IGNORE_RESTRAINTS))
if(!(flags & IGNORE_RESTRAINTS) && HAS_TRAIT(src, TRAIT_RESTRAINED))
return TRUE
if(IS_IN_STASIS(src) && !(flags & IGNORE_STASIS))
if(!(flags & IGNORE_GRAB) && pulledby && pulledby.grab_state >= GRAB_AGGRESSIVE)
return TRUE
if((pulledby && pulledby.grab_state >= GRAB_AGGRESSIVE) && !(flags & IGNORE_GRAB))
if(!(flags & IGNORE_STASIS) && IS_IN_STASIS(src))
return TRUE
return FALSE
@@ -988,7 +988,11 @@
..(pressure_difference, direction, pressure_resistance_prob_delta)
/mob/living/can_resist()
return !((next_move > world.time) || incapacitated(IGNORE_RESTRAINTS|IGNORE_STASIS))
if(next_move > world.time)
return FALSE
if(HAS_TRAIT(src, TRAIT_INCAPACITATED))
return FALSE
return TRUE
/mob/living/verb/resist()
set name = "Resist"
+1 -1
View File
@@ -184,7 +184,7 @@
return FALSE
if(mob.pulledby == mob.pulling && mob.pulledby.grab_state == GRAB_PASSIVE) //Don't autoresist passive grabs if we're grabbing them too.
return FALSE
if(mob.incapacitated(IGNORE_RESTRAINTS))
if(HAS_TRAIT(mob, TRAIT_INCAPACITATED))
COOLDOWN_START(src, move_delay, 1 SECONDS)
return TRUE
else if(HAS_TRAIT(mob, TRAIT_RESTRAINED))