Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Super Strength Grab Changes (Never skip arm day) #6020

Merged
merged 13 commits into from
Apr 6, 2024
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
Loading