Skip to content

Commit

Permalink
Notify when a NPC Facehugger facehugs someone (#3884)
Browse files Browse the repository at this point in the history
# About the pull request

NPC facehuggers now also send out a notifcation like player facehuggers
do when they facehug someone.

# Explain why it's good for the game

With player huggers able to do this, it makes sense for regular huggers
to do the same to notify the hive of a new infection (though eggs,
morpher, or even traps), giving the Xenos valuable information. This
also gives feedback for Carriers when their trap facehugs someone.


# Testing Photographs and Procedure


![image](https://github.com/cmss13-devs/cmss13/assets/91219575/0cbda9a9-eb75-4483-8e51-00a075235850)

# Changelog
:cl:
qol: Non player Facehuggers now also notify the hive when they facehug
something.
/:cl:

---------

Co-authored-by: Drathek <[email protected]>
  • Loading branch information
Ben10083 and Drulikar authored Jul 19, 2023
1 parent 0eafd94 commit e270f0f
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 16 deletions.
19 changes: 17 additions & 2 deletions code/modules/mob/living/carbon/xenomorph/Facehuggers.dm
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@
throw_atom(target, 3, SPEED_FAST)
return TRUE

/obj/item/clothing/mask/facehugger/proc/attach(mob/living/living_mob, silent = FALSE, knockout_mod = 1, hugger_ckey = null)
/obj/item/clothing/mask/facehugger/proc/attach(mob/living/living_mob, silent = FALSE, knockout_mod = 1, mob/living/carbon/xenomorph/facehugger/hugger)
if(attached || !can_hug(living_mob, hivenumber))
return FALSE

Expand Down Expand Up @@ -281,7 +281,22 @@
if(!human.species || !(human.species.flags & IS_SYNTHETIC)) //synthetics aren't paralyzed
human.apply_effect(MIN_IMPREGNATION_TIME * 0.5 * knockout_mod, PARALYZE) //THIS MIGHT NEED TWEAKS

addtimer(CALLBACK(src, PROC_REF(impregnate), human, hugger_ckey), rand(MIN_IMPREGNATION_TIME, MAX_IMPREGNATION_TIME))
var/area/hug_area = get_area(src)
var/name = hugger ? "[hugger]" : "\a [src]"
if(hug_area)
for(var/mob/dead/observer/observer as anything in GLOB.observer_list)
to_chat(observer, SPAN_DEADSAY("<b>[human]</b> has been facehugged by <b>[name]</b> at \the <b>[hug_area]</b> [OBSERVER_JMP(observer, human)]"))
to_chat(src, SPAN_DEADSAY("<b>[human]</b> has been facehugged by <b>[name]</b> at \the <b>[hug_area]</b>"))
else
for(var/mob/dead/observer/observer as anything in GLOB.observer_list)
to_chat(observer, SPAN_DEADSAY("<b>[human]</b> has been facehugged by <b>[name]</b> [OBSERVER_JMP(observer, human)]"))
to_chat(src, SPAN_DEADSAY("<b>[human]</b> has been facehugged by <b>[name]</b>"))
if(hug_area)
xeno_message(SPAN_XENOMINORWARNING("You sense that [name] has facehugged a host at \the [hug_area]!"), 1, hivenumber)
else
xeno_message(SPAN_XENOMINORWARNING("You sense that [name] has facehugged a host!"), 1, hivenumber)

addtimer(CALLBACK(src, PROC_REF(impregnate), human, hugger?.client?.ckey), rand(MIN_IMPREGNATION_TIME, MAX_IMPREGNATION_TIME))

return TRUE

Expand Down
15 changes: 1 addition & 14 deletions code/modules/mob/living/carbon/xenomorph/castes/Facehugger.dm
Original file line number Diff line number Diff line change
Expand Up @@ -149,23 +149,10 @@

/mob/living/carbon/xenomorph/facehugger/proc/handle_hug(mob/living/carbon/human/human)
var/obj/item/clothing/mask/facehugger/hugger = new /obj/item/clothing/mask/facehugger(loc, hivenumber)
var/did_hug = hugger.attach(human, TRUE, 0.5, client?.ckey)
var/did_hug = hugger.attach(human, TRUE, 0.5, src)
if(client)
client.player_data?.adjust_stat(PLAYER_STAT_FACEHUGS, STAT_CATEGORY_XENO, 1)
var/area/hug_area = get_area(src)
if(hug_area)
for(var/mob/dead/observer/observer as anything in GLOB.observer_list)
to_chat(observer, SPAN_DEADSAY("<b>[human]</b> has been facehugged by <b>[src]</b> at \the <b>[hug_area]</b>" + " [OBSERVER_JMP(observer, human)]"))
to_chat(src, SPAN_DEADSAY("<b>[human]</b> has been facehugged by <b>[src]</b> at \the <b>[hug_area]</b>"))
else
for(var/mob/dead/observer/observer as anything in GLOB.observer_list)
to_chat(observer, SPAN_DEADSAY("<b>[human]</b> has been facehugged by <b>[src]</b>" + " [OBSERVER_JMP(observer, human)]"))
to_chat(src, SPAN_DEADSAY("<b>[human]</b> has been facehugged by <b>[src]</b>"))
qdel(src)
if(hug_area)
xeno_message(SPAN_XENOMINORWARNING("You sense that [src] has facehugged a host at \the [hug_area]!"), 1, src.hivenumber)
else
xeno_message(SPAN_XENOMINORWARNING("You sense that [src] has facehugged a host!"), 1, src.hivenumber)
return did_hug

/mob/living/carbon/xenomorph/facehugger/age_xeno()
Expand Down

0 comments on commit e270f0f

Please sign in to comment.