Skip to content

Commit

Permalink
Fixes huggers not dying when caught by predator (#6226)
Browse files Browse the repository at this point in the history
# About the pull request
Closes #6134.

# Changelog

:cl:
fix: fixes hugger not dying when squished by predator
/:cl:

Co-authored-by: DOOM <N/A>
  • Loading branch information
vero5123 committed May 3, 2024
1 parent 8a2727a commit 4ef1793
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions code/modules/mob/living/carbon/xenomorph/Facehuggers.dm
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@
if(isturf(human.loc))
forceMove(human.loc)//Just checkin

if(!human.handle_hugger_attachment(src))
if(!human.handle_hugger_attachment(src, hugger))
return FALSE

attached = TRUE
Expand Down Expand Up @@ -491,15 +491,14 @@
/**
* Human hugger handling
*/

/mob/living/carbon/human/proc/handle_hugger_attachment(obj/item/clothing/mask/facehugger/hugger)
/mob/living/carbon/human/proc/handle_hugger_attachment(obj/item/clothing/mask/facehugger/hugger, mob/living/carbon/xenomorph/facehugger/mob_hugger)
var/can_infect = TRUE
if(!has_limb("head"))
hugger.visible_message(SPAN_WARNING("[hugger] looks for a face to hug on [src], but finds none!"))
hugger.go_idle()
return FALSE

if(species && !species.handle_hugger_attachment(src, hugger))
if(species && !species.handle_hugger_attachment(src, hugger, mob_hugger))
return FALSE

if(head && !(head.flags_item & NODROP))
Expand Down Expand Up @@ -546,10 +545,10 @@

return can_infect

/datum/species/proc/handle_hugger_attachment(mob/living/carbon/human/target, obj/item/clothing/mask/facehugger/hugger)
/datum/species/proc/handle_hugger_attachment(mob/living/carbon/human/target, obj/item/clothing/mask/facehugger/hugger, mob/living/carbon/xenomorph/facehugger/mob_hugger)
return TRUE

/datum/species/yautja/handle_hugger_attachment(mob/living/carbon/human/target, obj/item/clothing/mask/facehugger/hugger)
/datum/species/yautja/handle_hugger_attachment(mob/living/carbon/human/target, obj/item/clothing/mask/facehugger/hugger, mob/living/carbon/xenomorph/facehugger/mob_hugger)
var/catch_chance = 50
if(target.dir == GLOB.reverse_dir[hugger.dir])
catch_chance += 20
Expand All @@ -563,7 +562,10 @@

if(!target.stat && target.dir != hugger.dir && prob(catch_chance)) //Not facing away
target.visible_message(SPAN_NOTICE("[target] snatches [hugger] out of the air and squashes it!"))
hugger.die()
if(mob_hugger)
mob_hugger.death(create_cause_data("squished"))
else
hugger.die()
return FALSE

return TRUE

0 comments on commit 4ef1793

Please sign in to comment.