Skip to content

Commit

Permalink
use stuff in crit
Browse files Browse the repository at this point in the history
  • Loading branch information
dwasint committed Nov 14, 2023
1 parent 22518c8 commit 232ff2c
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 6 deletions.
2 changes: 2 additions & 0 deletions code/__DEFINES/status_effects.dm
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
#define IGNORE_STASIS (1<<1)
/// If the incapacitated status effect will ignore a mob being agressively grabbed
#define IGNORE_GRAB (1<<2)
/// If the incapacited status effect will ignore a mob in cirt
#define IGNORE_CRIT (1<<3)

// Grouped effect sources, see also code/__DEFINES/traits.dm

Expand Down
4 changes: 2 additions & 2 deletions code/_onclick/click.dm
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
CtrlClickOn(A)
return

if(incapacitated(IGNORE_RESTRAINTS|IGNORE_STASIS))
if(incapacitated(IGNORE_RESTRAINTS|IGNORE_STASIS|IGNORE_CRIT))
return

face_atom(A)
Expand All @@ -117,7 +117,7 @@
if(!LAZYACCESS(modifiers, "catcher") && A.IsObscured())
return

if(HAS_TRAIT(src, TRAIT_HANDS_BLOCKED))
if(HAS_TRAIT(src, TRAIT_HANDS_BLOCKED) && stat < SOFT_CRIT)
changeNext_move(CLICK_CD_HANDCUFFED) //Doing shit in cuffs shall be vey slow
UnarmedAttack(A, FALSE)
return
Expand Down
2 changes: 1 addition & 1 deletion code/_onclick/other_mobs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
Otherwise pretty standard.
*/
/mob/living/carbon/human/UnarmedAttack(atom/A, proximity_flag)
if(HAS_TRAIT(src, TRAIT_HANDS_BLOCKED))
if(HAS_TRAIT(src, TRAIT_HANDS_BLOCKED) && stat < SOFT_CRIT)
if(src == A)
check_self_for_injuries()
return
Expand Down
2 changes: 1 addition & 1 deletion code/datums/storage/storage.dm
Original file line number Diff line number Diff line change
Expand Up @@ -983,7 +983,7 @@ GLOBAL_LIST_EMPTY(cached_storage_typecaches)
resolve_parent.balloon_alert(to_show, "can't reach!")
return FALSE

if(!isliving(to_show) || to_show.incapacitated())
if(!isliving(to_show) || to_show.incapacitated(IGNORE_CRIT))
return FALSE

if(locked)
Expand Down
4 changes: 2 additions & 2 deletions code/modules/mob/inventory.dm
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,8 @@
return FALSE //nonliving mobs don't have hands

/mob/living/put_in_hand_check(obj/item/I)
if(istype(I) && ((mobility_flags & MOBILITY_PICKUP) || (I.item_flags & ABSTRACT)) \
&& !(SEND_SIGNAL(src, COMSIG_LIVING_TRY_PUT_IN_HAND, I) & COMPONENT_LIVING_CANT_PUT_IN_HAND))
if(istype(I) && ((((mobility_flags & MOBILITY_PICKUP) || ((stat >= SOFT_CRIT && (stat != DEAD || stat != UNCONSCIOUS))) || (I.item_flags & ABSTRACT)) \
&& !(SEND_SIGNAL(src, COMSIG_LIVING_TRY_PUT_IN_HAND, I) & COMPONENT_LIVING_CANT_PUT_IN_HAND)))
return TRUE
return FALSE

Expand Down
3 changes: 3 additions & 0 deletions code/modules/mob/living/living.dm
Original file line number Diff line number Diff line change
Expand Up @@ -504,6 +504,9 @@
* * IGNORE_GRAB - mob that is agressively grabbed is not considered incapacitated
**/
/mob/living/incapacitated(flags)
if((flags & IGNORE_CRIT) && ((stat >= SOFT_CRIT && (stat != DEAD || stat != UNCONSCIOUS))))
return FALSE

if(HAS_TRAIT(src, TRAIT_INCAPACITATED))
return TRUE

Expand Down

0 comments on commit 232ff2c

Please sign in to comment.