diff --git a/code/datums/ai/basic_mobs/targetting_datums/dont_target_friends.dm b/code/datums/ai/basic_mobs/targetting_datums/dont_target_friends.dm index 0fcd5dbf422..fdad4ac8b59 100644 --- a/code/datums/ai/basic_mobs/targetting_datums/dont_target_friends.dm +++ b/code/datums/ai/basic_mobs/targetting_datums/dont_target_friends.dm @@ -1,5 +1,7 @@ /// Don't target an atom in our friends list (or turfs), anything else is fair game /datum/targetting_datum/not_friends + /// Stop regarding someone as a valid target once they pass this stat level, setting it to DEAD means you will happily attack corpses + var/attack_until_past_stat = HARD_CRIT ///Returns true or false depending on if the target can be attacked by the mob /datum/targetting_datum/not_friends/can_attack(mob/living/living_mob, atom/target) @@ -12,12 +14,13 @@ var/mob/mob_target = target if (mob_target.status_flags & GODMODE) return FALSE + if (mob_target.stat > attack_until_past_stat) + return FALSE if (living_mob.see_invisible < target.invisibility) return FALSE if (isturf(target.loc) && living_mob.z != target.z) // z check will always fail if target is in a mech return FALSE - if (!living_mob.ai_controller) // How did you get here? return FALSE