diff --git a/code/modules/mob/living/carbon/human/human_defense.dm b/code/modules/mob/living/carbon/human/human_defense.dm index e1e610d7a32d..2c2f3d4d7417 100644 --- a/code/modules/mob/living/carbon/human/human_defense.dm +++ b/code/modules/mob/living/carbon/human/human_defense.dm @@ -840,3 +840,5 @@ emp_act /mob/living/carbon/human/projectile_hit_check(obj/item/projectile/P) return (HAS_TRAIT(src, TRAIT_FLOORED) || HAS_TRAIT(src, TRAIT_NOKNOCKDOWNSLOWDOWN)) && !density // hit mobs that are intentionally lying down to prevent combat crawling. +/mob/living/carbon/human/canBeHandcuffed() + return has_left_hand() || has_right_hand() diff --git a/code/modules/mob/living/simple_animal/bot/ed209bot.dm b/code/modules/mob/living/simple_animal/bot/ed209bot.dm index 9f3f30662a8c..bb0c73ac7d6c 100644 --- a/code/modules/mob/living/simple_animal/bot/ed209bot.dm +++ b/code/modules/mob/living/simple_animal/bot/ed209bot.dm @@ -1,4 +1,5 @@ #define BATON_COOLDOWN 3.5 SECONDS +#define BOT_REBATON_THRESHOLD 5 SECONDS /mob/living/simple_animal/bot/ed209 name = "\improper ED-209 Security Robot" @@ -279,6 +280,10 @@ back_to_idle() return + if(target.stat == DEAD) + back_to_idle() // Stop beating up the dead guy + return + if(Adjacent(target) && isturf(target.loc) && !baton_delayed) // if right next to perp stun_attack(target) if(!lasercolor) @@ -296,7 +301,7 @@ if(BOT_PREP_ARREST) // preparing to arrest target // see if he got away. If he's no no longer adjacent or inside a closet or about to get up, we hunt again. - if(!Adjacent(target) || !isturf(target.loc) || world.time - target.stam_regen_start_time < 4 SECONDS && target.getStaminaLoss() <= 100) + if(!Adjacent(target) || !isturf(target.loc) || target.stam_regen_start_time - world.time <= BOT_REBATON_THRESHOLD || target.getStaminaLoss() <= 100) back_to_hunt() return @@ -321,7 +326,7 @@ back_to_idle() return - if(!Adjacent(target) || !isturf(target.loc) || (target.loc != target_lastloc && world.time - target.stam_regen_start_time < 4 SECONDS && target.getStaminaLoss() <= 100)) //if he's changed loc and about to get up or not adjacent or got into a closet, we prep arrest again. + if(!Adjacent(target) || !isturf(target.loc) || (target.loc != target_lastloc && target.stam_regen_start_time - world.time <= BOT_REBATON_THRESHOLD || target.getStaminaLoss() <= 100)) //if he's changed loc and about to get up or not adjacent or got into a closet, we prep arrest again. back_to_hunt() return @@ -582,3 +587,4 @@ back_to_idle() #undef BATON_COOLDOWN +#undef BOT_REBATON_THRESHOLD diff --git a/code/modules/mob/living/simple_animal/bot/secbot.dm b/code/modules/mob/living/simple_animal/bot/secbot.dm index 05704ccb59b0..82b3a1c68802 100644 --- a/code/modules/mob/living/simple_animal/bot/secbot.dm +++ b/code/modules/mob/living/simple_animal/bot/secbot.dm @@ -1,4 +1,5 @@ #define BATON_COOLDOWN 3.5 SECONDS +#define BOT_REBATON_THRESHOLD 5 SECONDS /mob/living/simple_animal/bot/secbot name = "\improper Securitron" @@ -330,6 +331,10 @@ back_to_idle() return + if(target.stat == DEAD) + back_to_idle() // Stop beating up the dead guy + return + if(Adjacent(target) && isturf(target.loc) && !baton_delayed) // if right next to perp stun_attack(target) mode = BOT_PREP_ARREST @@ -341,7 +346,7 @@ if(BOT_PREP_ARREST) // preparing to arrest target // see if he got away. If he's no no longer adjacent or inside a closet or about to get up, we hunt again. - if(!Adjacent(target) || !isturf(target.loc) || world.time - target.stam_regen_start_time < 4 SECONDS && target.getStaminaLoss() <= 100) + if(!Adjacent(target) || !isturf(target.loc) || target.stam_regen_start_time - world.time <= BOT_REBATON_THRESHOLD|| target.getStaminaLoss() <= 100) back_to_hunt() return // target is stunned and nearby @@ -362,12 +367,12 @@ back_to_idle() - if(BOT_ARREST) + if(BOT_ARREST) // Fun fact: This is not called if(!target || target.handcuffed) back_to_idle() return - if(!Adjacent(target) || !isturf(target.loc) || (target.loc != target_lastloc && target.AmountWeakened() < 4 SECONDS)) //if he's changed loc and about to get up or not adjacent or got into a closet, we prep arrest again. + if(!Adjacent(target) || !isturf(target.loc) || (target.loc != target_lastloc && target.stam_regen_start_time - world.time <= BOT_REBATON_THRESHOLD || target.getStaminaLoss() <= 100)) //if he's changed loc and about to get up or not adjacent or got into a closet, we prep arrest again. back_to_hunt() return //Try arresting again if the target escapes. @@ -407,7 +412,7 @@ if((C.stat) || (C.handcuffed)) continue - if((C.name == oldtarget_name) && (world.time < last_found + 100)) + if((C.name == oldtarget_name) && (world.time < last_found + 5 SECONDS)) continue threatlevel = C.assess_threat(src) @@ -470,3 +475,4 @@ ..() #undef BATON_COOLDOWN +#undef BOT_REBATON_THRESHOLD