diff --git a/code/datums/ai/generic/generic_subtrees.dm b/code/datums/ai/generic/generic_subtrees.dm index af0fd99a9aa..35e5c277f48 100644 --- a/code/datums/ai/generic/generic_subtrees.dm +++ b/code/datums/ai/generic/generic_subtrees.dm @@ -9,8 +9,9 @@ /datum/ai_planning_subtree/generic_resist/select_behaviors(datum/ai_controller/controller, seconds_per_tick) var/mob/living/living_pawn = controller.pawn - if(SHOULD_RESIST(living_pawn) && SPT_PROB(RESIST_SUBTREE_PROB, seconds_per_tick)) - controller.queue_behavior(/datum/ai_behavior/resist) // BRO IM ON FUCKING FIRE BRO + if(SHOULD_RESIST(living_pawn) || length(living_pawn.grabbed_by)) + if(SPT_PROB(RESIST_SUBTREE_PROB, seconds_per_tick)) + controller.queue_behavior(/datum/ai_behavior/resist) // BRO IM ON FUCKING FIRE BRO return SUBTREE_RETURN_FINISH_PLANNING // IM NOT DOING ANYTHING ELSE BUT EXTINGUISH MYSELF, GOOD GOD HAVE MERCY. /** diff --git a/code/datums/ai/monkey/monkey_behaviors.dm b/code/datums/ai/monkey/monkey_behaviors.dm index 19693e501e2..d2e4df8c790 100644 --- a/code/datums/ai/monkey/monkey_behaviors.dm +++ b/code/datums/ai/monkey/monkey_behaviors.dm @@ -124,7 +124,7 @@ target = L break - if(target) + if(target && !(living_pawn.IsWeakened() || living_pawn.IsStunned() || living_pawn.stam_paralyzed)) GLOB.move_manager.move_away(living_pawn, target, max_dist=MONKEY_ENEMY_VISION, delay=5) return AI_BEHAVIOR_DELAY return AI_BEHAVIOR_DELAY | AI_BEHAVIOR_SUCCEEDED diff --git a/code/datums/ai/monkey/monkey_controller.dm b/code/datums/ai/monkey/monkey_controller.dm index 0772a590339..ef65dd7b0dc 100644 --- a/code/datums/ai/monkey/monkey_controller.dm +++ b/code/datums/ai/monkey/monkey_controller.dm @@ -39,7 +39,7 @@ have ways of interacting with a specific mob and control it. return ..() /datum/ai_controller/monkey/process(seconds_per_tick) - var/mob/living/living_pawn = src.pawn + var/mob/living/carbon/human/living_pawn = src.pawn movement_delay = living_pawn.movement_delay() // Circumstances change. Update speed frequently. if(!length(living_pawn.do_afters) && living_pawn.ai_controller.blackboard[BB_RESISTING]) @@ -48,11 +48,12 @@ have ways of interacting with a specific mob and control it. if(living_pawn.ai_controller.blackboard[BB_RESISTING]) return - if(living_pawn.IsWeakened() || living_pawn.IsStunned()) // We're stunned - what are we gonna do? + if(living_pawn.IsWeakened() || living_pawn.IsStunned() || living_pawn.stam_paralyzed) // We're stunned - what are we gonna do? cancel_actions() + GLOB.move_manager.stop_looping(living_pawn) return - . = ..() + return ..() /datum/ai_controller/monkey/pun_pun movement_delay = 7 DECISECONDS // pun pun moves slower so the bartender can keep track of them @@ -106,7 +107,7 @@ have ways of interacting with a specific mob and control it. /datum/ai_controller/monkey/get_able_to_run() var/mob/living/living_pawn = pawn - if(living_pawn.stat || living_pawn.incapacitated()) + if(living_pawn.stat || living_pawn.incapacitated() || living_pawn.stam_paralyzed) return AI_UNABLE_TO_RUN if(living_pawn.ckey || living_pawn.client) diff --git a/code/modules/mob/living/carbon/carbon_status_procs.dm b/code/modules/mob/living/carbon/carbon_status_procs.dm index 6f008d355d5..bdb8ebd6935 100644 --- a/code/modules/mob/living/carbon/carbon_status_procs.dm +++ b/code/modules/mob/living/carbon/carbon_status_procs.dm @@ -8,6 +8,9 @@ return if(!IsWeakened()) to_chat(src, SPAN_NOTICE("You're too exhausted to keep going...")) + if(istype(ai_controller)) + ai_controller.cancel_actions() + GLOB.move_manager.stop_looping(src) SEND_SIGNAL(src, COMSIG_CARBON_ENTER_STAMINACRIT) stam_regen_start_time = world.time + (STAMINA_REGEN_BLOCK_TIME * stamina_regen_block_modifier) var/prev = stam_paralyzed diff --git a/code/modules/mob/living/carbon/human/species/_species.dm b/code/modules/mob/living/carbon/human/species/_species.dm index 46fdad49d59..a69cb77531e 100644 --- a/code/modules/mob/living/carbon/human/species/_species.dm +++ b/code/modules/mob/living/carbon/human/species/_species.dm @@ -407,6 +407,8 @@ . += ((health_deficiency / 25) - 1.1) //Once damage is over 40, you get the harsh formula else . += 0.5 //Otherwise, slowdown (from pain) is capped to 0.5 until you hit 40 damage. This only effects people with fractional slowdowns, and prevents some harshness from the lowered threshold + if(istype(H.ai_controller)) + H.ai_controller.movement_delay = . #undef ADD_SLOWDOWN #undef SLOWDOWN_INCREMENT