Skip to content

Commit

Permalink
TGS Test Merge (#6020)
Browse files Browse the repository at this point in the history
  • Loading branch information
cm13-github committed Apr 3, 2024
2 parents 3f5ff00 + 9246532 commit 9c293fd
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 16 deletions.
10 changes: 5 additions & 5 deletions code/modules/mob/living/carbon/human/human_helpers.dm
Original file line number Diff line number Diff line change
Expand Up @@ -206,18 +206,18 @@
return FALSE


/mob/living/carbon/human/is_mob_restrained(check_grab = 1)
/mob/living/carbon/human/is_mob_restrained(check_grab = TRUE)
if(check_grab && pulledby && pulledby.grab_level >= GRAB_AGGRESSIVE)
return 1
return TRUE
if (handcuffed)
return 1
return TRUE
if (istype(wear_suit, /obj/item/clothing/suit/straight_jacket))
return 1
return TRUE

if (HAS_TRAIT(src, TRAIT_NESTED))
return TRUE

return 0
return FALSE

/mob/living/carbon/human/proc/disable_special_flags()
status_flags |= CANPUSH
Expand Down
37 changes: 26 additions & 11 deletions code/modules/mob/living/living.dm
Original file line number Diff line number Diff line change
Expand Up @@ -224,19 +224,34 @@
/mob/living/resist_grab(moving_resist)
if(!pulledby)
return
if(pulledby.grab_level)
if(prob(50))
playsound(src.loc, 'sound/weapons/thudswoosh.ogg', 25, 1, 7)
visible_message(SPAN_DANGER("[src] has broken free of [pulledby]'s grip!"), null, null, 5)
pulledby.stop_pulling()
return 1
if(moving_resist && client) //we resisted by trying to move
visible_message(SPAN_DANGER("[src] struggles to break free of [pulledby]'s grip!"), null, null, 5)
client.next_movement = world.time + (10*pulledby.grab_level) + client.move_delay
else
// vars for checks of strengh
var/pulledby_is_strong = HAS_TRAIT(pulledby, TRAIT_SUPER_STRONG)
var/src_is_strong = HAS_TRAIT(src, TRAIT_SUPER_STRONG)

if(!pulledby.grab_level && (!pulledby_is_strong || src_is_strong)) // if passive grab, check if puller is stronger than src, and if not, break free
pulledby.stop_pulling()
return 1
return TRUE

// Chance for person to break free of grip, defaults to 50.
var/chance = 50
if(src_is_strong && !isxeno(pulledby)) // no extra chance to resist warrior grabs
chance += 30 // you are strong, you can overpower them easier
if(pulledby_is_strong)
chance -= 30 // stronger grip
// above code means that if you are super strong, 80% chance to resist, otherwise, 20 percent. if both are super strong, standard 50.

if(prob(chance))
playsound(loc, 'sound/weapons/thudswoosh.ogg', 25, 1, 7)
visible_message(SPAN_DANGER("[src] has broken free of [pulledby]'s grip!"), max_distance = 5)
pulledby.stop_pulling()
return TRUE
if(moving_resist && client) //we resisted by trying to move
visible_message(SPAN_DANGER("[src] struggles to break free of [pulledby]'s grip!"), max_distance = 5)
// +1 delay if super strong, also done as passive grabs would have a modifier of 0 otherwise, causing spam
if(pulledby_is_strong && !src_is_strong)
client.next_movement = world.time + (10*(pulledby.grab_level + 1)) + client.move_delay
else
client.next_movement = world.time + (10*pulledby.grab_level) + client.move_delay

/mob/living/movement_delay()
. = ..()
Expand Down

0 comments on commit 9c293fd

Please sign in to comment.