From 206cac22d3ecafe39c25d1eb97e0cd684e971512 Mon Sep 17 00:00:00 2001 From: Ben10083 Date: Tue, 26 Mar 2024 21:33:15 -0400 Subject: [PATCH 1/8] Grabs now harder to resist out of if super strong --- code/modules/mob/living/living.dm | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index d5190318715c..ee2b3ec27772 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -224,8 +224,23 @@ /mob/living/resist_grab(moving_resist) if(!pulledby) return - if(pulledby.grab_level) - if(prob(50)) + var/mob/user = src + // Passive grabs will also be broken, UNLESS pulledby has super strength, but this is ignored if you also have super strength + if(pulledby.grab_level || (!pulledby.grab_level && (HAS_TRAIT(pulledby, TRAIT_SUPER_STRONG) && !HAS_TRAIT(user, TRAIT_SUPER_STRONG)))) + /// Chance for person to break free of grip, defaults to 50. + var/chance = 50 + if(HAS_TRAIT(user, TRAIT_SUPER_STRONG)) + chance += 30 // you are strong, you can overpower them easier + if(HAS_TRAIT(pulledby, TRAIT_SUPER_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. + + //we do code to add floor and ceiling to chance + if(chance > 100) + chance = 100 + else if(chance < 0) + chance = 0 + if(prob(chance)) 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() From 84bf86daa96ac2e1a36f6d63146c7edea3414435 Mon Sep 17 00:00:00 2001 From: Ben10083 Date: Tue, 26 Mar 2024 21:33:46 -0400 Subject: [PATCH 2/8] feel that? That's TRUE --- code/modules/mob/living/living.dm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index ee2b3ec27772..79847d7e4994 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -244,13 +244,13 @@ 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 + 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!"), null, null, 5) client.next_movement = world.time + (10*pulledby.grab_level) + client.move_delay else pulledby.stop_pulling() - return 1 + return TRUE /mob/living/movement_delay() From 1cf5fbb83e19bc20e4bd5cd23861306e093644f5 Mon Sep 17 00:00:00 2001 From: Ben10083 Date: Tue, 26 Mar 2024 21:39:22 -0400 Subject: [PATCH 3/8] True --- code/modules/mob/living/carbon/human/human_helpers.dm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/code/modules/mob/living/carbon/human/human_helpers.dm b/code/modules/mob/living/carbon/human/human_helpers.dm index c38ddbcd552c..f3ef34608210 100644 --- a/code/modules/mob/living/carbon/human/human_helpers.dm +++ b/code/modules/mob/living/carbon/human/human_helpers.dm @@ -208,16 +208,16 @@ /mob/living/carbon/human/is_mob_restrained(check_grab = 1) 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 if (HAS_TRAIT(src, TRAIT_NESTED)) return TRUE - return 0 + return FALSE /mob/living/carbon/human/proc/disable_special_flags() status_flags |= CANPUSH From 03d1d48235f4b2ba5315c99d5827c30d4be1fa9d Mon Sep 17 00:00:00 2001 From: Ben10083 Date: Tue, 26 Mar 2024 21:57:58 -0400 Subject: [PATCH 4/8] Anti spam --- code/modules/mob/living/living.dm | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index 79847d7e4994..2a2098f374b5 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -235,11 +235,6 @@ 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. - //we do code to add floor and ceiling to chance - if(chance > 100) - chance = 100 - else if(chance < 0) - chance = 0 if(prob(chance)) 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) @@ -247,7 +242,11 @@ 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!"), null, null, 5) - client.next_movement = world.time + (10*pulledby.grab_level) + client.move_delay + // +1 delay if super strong, also done as passive grabs would have a modifier of 0 otherwise, causing spam + if(HAS_TRAIT(pulledby, TRAIT_SUPER_STRONG) && !HAS_TRAIT(user, TRAIT_SUPER_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 else pulledby.stop_pulling() return TRUE From 4514d2e1429f0f54987c69b624ab829bc87a3f37 Mon Sep 17 00:00:00 2001 From: Ben10083 Date: Tue, 26 Mar 2024 22:08:15 -0400 Subject: [PATCH 5/8] no src --- code/modules/mob/living/living.dm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index 2a2098f374b5..1f4fa15ae938 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -236,12 +236,12 @@ // 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(src.loc, 'sound/weapons/thudswoosh.ogg', 25, 1, 7) - visible_message(SPAN_DANGER("[src] has broken free of [pulledby]'s grip!"), null, null, 5) + playsound(user.loc, 'sound/weapons/thudswoosh.ogg', 25, 1, 7) + visible_message(SPAN_DANGER("[user] has broken free of [pulledby]'s grip!"), null, null, 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!"), null, null, 5) + visible_message(SPAN_DANGER("[user] struggles to break free of [pulledby]'s grip!"), null, null, 5) // +1 delay if super strong, also done as passive grabs would have a modifier of 0 otherwise, causing spam if(HAS_TRAIT(pulledby, TRAIT_SUPER_STRONG) && !HAS_TRAIT(user, TRAIT_SUPER_STRONG)) client.next_movement = world.time + (10*(pulledby.grab_level + 1)) + client.move_delay From 9fdb1a5c705f352dea5dbdc80a04fa8ea4a25737 Mon Sep 17 00:00:00 2001 From: Ben10083 Date: Thu, 28 Mar 2024 17:42:41 -0400 Subject: [PATCH 6/8] Xeno exception --- code/modules/mob/living/living.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index 1f4fa15ae938..b35d0559ad76 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -229,7 +229,7 @@ if(pulledby.grab_level || (!pulledby.grab_level && (HAS_TRAIT(pulledby, TRAIT_SUPER_STRONG) && !HAS_TRAIT(user, TRAIT_SUPER_STRONG)))) /// Chance for person to break free of grip, defaults to 50. var/chance = 50 - if(HAS_TRAIT(user, TRAIT_SUPER_STRONG)) + if(HAS_TRAIT(user, TRAIT_SUPER_STRONG) && !isxeno(pulledby)) // no extra chance to resist warrior grabs chance += 30 // you are strong, you can overpower them easier if(HAS_TRAIT(pulledby, TRAIT_SUPER_STRONG)) chance -= 30 // stronger grip From ff5752005354be3b44732503745c98de621dc03d Mon Sep 17 00:00:00 2001 From: Ben10083 Date: Sun, 31 Mar 2024 14:10:10 -0400 Subject: [PATCH 7/8] Requested changes --- .../mob/living/carbon/human/human_helpers.dm | 4 ++-- code/modules/mob/living/living.dm | 21 +++++++++++-------- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/code/modules/mob/living/carbon/human/human_helpers.dm b/code/modules/mob/living/carbon/human/human_helpers.dm index f3ef34608210..d6d438441d20 100644 --- a/code/modules/mob/living/carbon/human/human_helpers.dm +++ b/code/modules/mob/living/carbon/human/human_helpers.dm @@ -206,13 +206,13 @@ 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 TRUE if (handcuffed) return TRUE if (istype(wear_suit, /obj/item/clothing/suit/straight_jacket)) - return 1 + return TRUE if (HAS_TRAIT(src, TRAIT_NESTED)) return TRUE diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index b35d0559ad76..57ae7875b9b3 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -224,26 +224,29 @@ /mob/living/resist_grab(moving_resist) if(!pulledby) return - var/mob/user = src + // 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) + // Passive grabs will also be broken, UNLESS pulledby has super strength, but this is ignored if you also have super strength - if(pulledby.grab_level || (!pulledby.grab_level && (HAS_TRAIT(pulledby, TRAIT_SUPER_STRONG) && !HAS_TRAIT(user, TRAIT_SUPER_STRONG)))) - /// Chance for person to break free of grip, defaults to 50. + if(pulledby.grab_level || (pulledby_is_strong && !src_is_strong)) + // Chance for person to break free of grip, defaults to 50. var/chance = 50 - if(HAS_TRAIT(user, TRAIT_SUPER_STRONG) && !isxeno(pulledby)) // no extra chance to resist warrior grabs + if(src_is_strong && !isxeno(pulledby)) // no extra chance to resist warrior grabs chance += 30 // you are strong, you can overpower them easier - if(HAS_TRAIT(pulledby, TRAIT_SUPER_STRONG)) + 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(user.loc, 'sound/weapons/thudswoosh.ogg', 25, 1, 7) - visible_message(SPAN_DANGER("[user] has broken free of [pulledby]'s grip!"), null, null, 5) + 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("[user] struggles to break free of [pulledby]'s grip!"), null, null, 5) + 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(HAS_TRAIT(pulledby, TRAIT_SUPER_STRONG) && !HAS_TRAIT(user, TRAIT_SUPER_STRONG)) + 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 From 86eb5ee4b48206856da515bfcb07ee64f2b55561 Mon Sep 17 00:00:00 2001 From: Ben10083 Date: Sun, 31 Mar 2024 20:21:35 -0400 Subject: [PATCH 8/8] Requested change --- code/modules/mob/living/living.dm | 44 +++++++++++++++---------------- 1 file changed, 21 insertions(+), 23 deletions(-) diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index 57ae7875b9b3..40a06b253c3e 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -228,32 +228,30 @@ var/pulledby_is_strong = HAS_TRAIT(pulledby, TRAIT_SUPER_STRONG) var/src_is_strong = HAS_TRAIT(src, TRAIT_SUPER_STRONG) - // Passive grabs will also be broken, UNLESS pulledby has super strength, but this is ignored if you also have super strength - if(pulledby.grab_level || (pulledby_is_strong && !src_is_strong)) - // 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 - else + 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 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() . = ..()