Skip to content

Commit

Permalink
Facehuggers AI fix (#150)
Browse files Browse the repository at this point in the history
Looks fine.
  • Loading branch information
xDanilcusx authored Mar 15, 2024
1 parent 414d726 commit ee5a956
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
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

0 comments on commit ee5a956

Please sign in to comment.