From 2e95447d91065a1b5df24355741b12f6574afa04 Mon Sep 17 00:00:00 2001 From: CHOMPStation2 <58959929+CHOMPStation2@users.noreply.github.com> Date: Tue, 26 Sep 2023 06:56:55 -0700 Subject: [PATCH] [MIRROR] You don't have to fight in the belly if you don't want to (#7032) Co-authored-by: Heroman3003 <31296024+Heroman3003@users.noreply.github.com> Co-authored-by: CHOMPStation2 --- code/modules/ai/ai_holder_disabled.dm | 3 +++ code/modules/ai/ai_holder_targeting.dm | 8 +++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/code/modules/ai/ai_holder_disabled.dm b/code/modules/ai/ai_holder_disabled.dm index 796f094776..ed2dc6cd4f 100644 --- a/code/modules/ai/ai_holder_disabled.dm +++ b/code/modules/ai/ai_holder_disabled.dm @@ -17,6 +17,9 @@ if(holder.instasis()) // In a stasis field. ai_log("can_act() : In a stasis field.", AI_LOG_TRACE) return FALSE + if(!belly_attack) + if(isbelly(holder.loc)) + return FALSE return TRUE // Test if we should switch to STANCE_DISABLE. diff --git a/code/modules/ai/ai_holder_targeting.dm b/code/modules/ai/ai_holder_targeting.dm index bb46872c39..17bb55e949 100644 --- a/code/modules/ai/ai_holder_targeting.dm +++ b/code/modules/ai/ai_holder_targeting.dm @@ -9,6 +9,7 @@ var/vore_hostile = FALSE // The same as hostile, but with vore pref checks var/micro_hunt = FALSE // Will target mobs at or under the micro_hunt_size size, requires vore_hostile to be true var/micro_hunt_size = 0.25 + var/belly_attack = TRUE //Mobs attack if they are in a belly! var/atom/movable/target = null // The thing (mob or object) we're trying to kill. var/atom/movable/preferred_target = null// If set, and if given the chance, we will always prefer to target this over other options. @@ -122,7 +123,9 @@ /datum/ai_holder/proc/can_attack(atom/movable/the_target, var/vision_required = TRUE) if(!can_see_target(the_target) && vision_required) return FALSE - + if(!belly_attack) + if(isbelly(holder.loc)) + return FALSE if(isliving(the_target)) var/mob/living/L = the_target if(ishuman(L) || issilicon(L)) @@ -263,6 +266,9 @@ if(!hostile && !retaliate) // Not allowed to defend ourselves. ai_log("react_to_attack() : Was attacked by [attacker], but we are not allowed to attack back.", AI_LOG_TRACE) return FALSE + if(!belly_attack) + if(isbelly(holder.loc)) + return FALSE if(holder.IIsAlly(attacker)) // I'll overlook it THIS time... ai_log("react_to_attack() : Was attacked by [attacker], but they were an ally.", AI_LOG_TRACE) return FALSE