Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Facehuggers AI fix #150

Merged
merged 1 commit into from
Mar 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 14 additions & 4 deletions code/modules/mob/living/carbon/xenomorph/ai/xeno_ai.dm
Original file line number Diff line number Diff line change
Expand Up @@ -338,14 +338,24 @@

#undef EXTRA_CHECK_DISTANCE_MULTIPLIER

/mob/living/carbon/proc/ai_can_target(mob/living/carbon/xenomorph/ai_xeno)
if(!ai_check_stat(ai_xeno))
/mob/living/carbon/proc/ai_can_target(mob/living/carbon/xenomorph/X)
if(!ai_check_stat(X))
return FALSE

if(ai_xeno.can_not_harm(src))
if(X.can_not_harm(src))
return FALSE

if(alpha <= 45 && get_dist(ai_xeno, src) > 2)
if(alpha <= 45 && get_dist(X, src) > 2)
return FALSE

if(isfacehugger(X))
if(status_flags & XENO_HOST)
return FALSE

if(istype(wear_mask, /obj/item/clothing/mask/facehugger))
return FALSE

else if(HAS_TRAIT(src, TRAIT_NESTED))
return FALSE

return TRUE
Expand Down
10 changes: 0 additions & 10 deletions code/modules/mob/living/carbon/xenomorph/xeno_ai_interaction.dm
Original file line number Diff line number Diff line change
Expand Up @@ -155,16 +155,6 @@ At bare minimum, make sure the relevant checks from parent types gets copied in
if(species.flags & IS_SYNTHETIC)
return FALSE

if(HAS_TRAIT(src, TRAIT_NESTED))
return FALSE

if(isfacehugger(X))
if(status_flags & XENO_HOST)
return FALSE

if(istype(wear_mask, /obj/item/clothing/mask/facehugger))
return FALSE

return TRUE

/mob/living/carbon/human/ai_check_stat(mob/living/carbon/xenomorph/X)
Expand Down
Loading