diff --git a/code/modules/mob/living/carbon/xenomorph/abilities/crusher/crusher_abilities.dm b/code/modules/mob/living/carbon/xenomorph/abilities/crusher/crusher_abilities.dm index 8f2c89e316..868576e532 100644 --- a/code/modules/mob/living/carbon/xenomorph/abilities/crusher/crusher_abilities.dm +++ b/code/modules/mob/living/carbon/xenomorph/abilities/crusher/crusher_abilities.dm @@ -158,7 +158,7 @@ if(distance_between_base_carbon_and_xeno < MINIMUM_CHARGE_DISTANCE) continue - if(!processing_xeno.check_mob_target(base_checked_carbon)) + if(!base_checked_carbon.check_mob_target(processing_xeno)) continue var/secondary_count = 0 @@ -166,7 +166,7 @@ var/secondary_y_sum = 0 for(var/mob/living/carbon/secondary_checked_carbon in range(FLOCK_SCAN_RADIUS, base_checked_carbon)) - if(!processing_xeno.check_mob_target(secondary_checked_carbon)) + if(!secondary_checked_carbon.check_mob_target(processing_xeno)) continue secondary_count++ diff --git a/code/modules/mob/living/carbon/xenomorph/ai/movement/lurking.dm b/code/modules/mob/living/carbon/xenomorph/ai/movement/lurking.dm index eeeb5b9ba8..d14435766e 100644 --- a/code/modules/mob/living/carbon/xenomorph/ai/movement/lurking.dm +++ b/code/modules/mob/living/carbon/xenomorph/ai/movement/lurking.dm @@ -271,7 +271,7 @@ registered_turfs += cycled_open_turf var/mob/living/carbon/human/possible_target = locate() in cycled_open_turf - if(possible_target && (!parent.current_target || get_dist(parent, possible_target) < get_dist(parent, parent.current_target)) && parent.check_mob_target(possible_target)) + if(possible_target && (!parent.current_target || get_dist(parent, possible_target) < get_dist(parent, parent.current_target)) && possible_target.check_mob_target(parent)) parent.current_target = possible_target /datum/xeno_ai_movement/linger/lurking/proc/unregister_turf_signals() @@ -286,7 +286,7 @@ return var/mob/living/carbon/human/possible_target = entering_atom - if(!parent.current_target || get_dist(parent, possible_target) < get_dist(parent, parent.current_target) && parent.check_mob_target(possible_target)) + if(!parent.current_target || get_dist(parent, possible_target) < get_dist(parent, parent.current_target) && possible_target.check_mob_target(parent)) parent.current_target = possible_target /datum/xeno_ai_movement/linger/lurking/proc/lurking_parent_moved(atom/movable/moving_atom, atom/oldloc, direction, Forced) diff --git a/code/modules/mob/living/carbon/xenomorph/ai/xeno_ai.dm b/code/modules/mob/living/carbon/xenomorph/ai/xeno_ai.dm index 652214afe4..aa270a617a 100644 --- a/code/modules/mob/living/carbon/xenomorph/ai/xeno_ai.dm +++ b/code/modules/mob/living/carbon/xenomorph/ai/xeno_ai.dm @@ -259,7 +259,7 @@ if(z != potential_target.z) continue - if(!check_mob_target(potential_target)) + if(!potential_target.check_mob_target(src)) continue var/distance = get_dist(src, potential_target) @@ -288,8 +288,8 @@ var/skip_vehicle = TRUE var/list/interior_living_mobs = potential_vehicle_target.interior.get_passengers() - for(var/mob/living/carbon/human/human_mob in interior_living_mobs) - if(!check_mob_target(human_mob)) + for(var/mob/living/carbon/carbon_mob in interior_living_mobs) + if(!carbon_mob.check_mob_target(src)) continue skip_vehicle = FALSE @@ -335,27 +335,13 @@ #undef EXTRA_CHECK_DISTANCE_MULTIPLIER -/mob/living/carbon/xenomorph/proc/check_mob_target(mob/living/carbon/checked_target) - if(checked_target.stat == DEAD) - return FALSE - - if(hivenumber == checked_target.hivenumber) - return FALSE - - if(HAS_TRAIT(checked_target, TRAIT_NESTED)) - return FALSE +/mob/living/carbon/proc/check_mob_target(mob/living/carbon/xenomorph/ai_xeno) + if(stat == DEAD) + return FALSE // We leave dead bodies alone - if(can_not_harm(checked_target)) + if(ai_xeno.can_not_harm(src)) return FALSE - if(ishuman(checked_target)) - var/mob/living/carbon/human/checked_human = checked_target - if(checked_human.species.flags & IS_SYNTHETIC) - return FALSE - - if(checked_human.stat != CONSCIOUS) - return FALSE // We leave crit people be - return TRUE /mob/living/carbon/xenomorph/proc/make_ai() diff --git a/code/modules/mob/living/carbon/xenomorph/xeno_ai_interaction.dm b/code/modules/mob/living/carbon/xenomorph/xeno_ai_interaction.dm index 4d3109d7fe..c643047f7b 100644 --- a/code/modules/mob/living/carbon/xenomorph/xeno_ai_interaction.dm +++ b/code/modules/mob/living/carbon/xenomorph/xeno_ai_interaction.dm @@ -106,6 +106,22 @@ At bare minimum, make sure the relevant checks from parent types gets copied in . = ..() +/mob/living/carbon/human/check_mob_target(mob/living/carbon/xenomorph/ai_xeno) + . = ..() + if(!.) + return FALSE + + if(stat == UNCONSCIOUS) + return FALSE // We also leave crit people be + + if(species.flags & IS_SYNTHETIC) + return FALSE + + if(HAS_TRAIT(src, TRAIT_NESTED)) + return FALSE + + return TRUE + // XENOS /mob/living/carbon/xenomorph/xeno_ai_obstacle(mob/living/carbon/xenomorph/X, direction, turf/target) . = ..() @@ -117,6 +133,16 @@ At bare minimum, make sure the relevant checks from parent types gets copied in return XENO_PENALTY +/mob/living/carbon/xenomorph/check_mob_target(mob/living/carbon/xenomorph/ai_xeno) + . = ..() + if(!.) + return FALSE + + if(ai_xeno.hivenumber == hivenumber) + return FALSE + + return TRUE + // VEHICLES /obj/vehicle/xeno_ai_obstacle(mob/living/carbon/xenomorph/X, direction, turf/target) . = ..()