diff --git a/code/modules/mob/living/carbon/xenomorph/Facehuggers.dm b/code/modules/mob/living/carbon/xenomorph/Facehuggers.dm index df272387f001..8aa3000092f5 100644 --- a/code/modules/mob/living/carbon/xenomorph/Facehuggers.dm +++ b/code/modules/mob/living/carbon/xenomorph/Facehuggers.dm @@ -38,6 +38,9 @@ /// the nearest human before dying var/jumps_left = 2 + var/time_to_live = 30 SECONDS + var/death_timer + var/icon_xeno = 'icons/mob/xenos/effects.dmi' var/icon_xenonid = 'icons/mob/xenonids/xenonid_crab.dmi' @@ -55,6 +58,9 @@ set_hive_data(src, hivenumber) go_active() + if (hivenumber != XENO_HIVE_TUTORIAL) + death_timer = addtimer(CALLBACK(src, PROC_REF(end_lifecycle)), time_to_live, TIMER_OVERRIDE|TIMER_STOPPABLE|TIMER_UNIQUE) + /obj/item/clothing/mask/facehugger/Destroy() . = ..() @@ -75,6 +81,10 @@ if(QDESTROYING(src)) return addtimer(CALLBACK(src, PROC_REF(check_turf)), 0.2 SECONDS) + + if(!death_timer && hivenumber != XENO_HIVE_TUTORIAL) + death_timer = addtimer(CALLBACK(src, PROC_REF(end_lifecycle)), time_to_live, TIMER_OVERRIDE|TIMER_STOPPABLE|TIMER_UNIQUE) + if(stat == CONSCIOUS && loc) //Make sure we're conscious and not idle or dead. go_idle() if(attached) @@ -173,9 +183,18 @@ if(exposed_temperature > 300) die() -/obj/item/clothing/mask/facehugger/equipped(mob/M) +/obj/item/clothing/mask/facehugger/equipped(mob/holder) SHOULD_CALL_PARENT(FALSE) // ugh equip sounds // So picking up a hugger does not prematurely kill it + if (!isxeno(holder)) + return + + var/mob/living/carbon/xenomorph/xeno = holder + + if ((xeno.caste.hugger_nurturing || hivenumber == XENO_HIVE_TUTORIAL) && death_timer) + deltimer(death_timer) + death_timer = null + go_idle() /obj/item/clothing/mask/facehugger/Crossed(atom/target) @@ -410,6 +429,10 @@ deltimer(jump_timer) jump_timer = null + if(death_timer) + deltimer(death_timer) + death_timer = null + if(!impregnated) icon_state = "[initial(icon_state)]_dead" stat = DEAD diff --git a/code/modules/mob/living/carbon/xenomorph/castes/lesser_drone.dm b/code/modules/mob/living/carbon/xenomorph/castes/lesser_drone.dm index 8b268ebfce62..9be9e21fd983 100644 --- a/code/modules/mob/living/carbon/xenomorph/castes/lesser_drone.dm +++ b/code/modules/mob/living/carbon/xenomorph/castes/lesser_drone.dm @@ -16,9 +16,10 @@ can_be_revived = FALSE build_time_mult = BUILD_TIME_MULT_LESSER_DRONE + behavior_delegate_type = /datum/behavior_delegate/lesser_drone_base caste_desc = "A builder of hives." - can_hold_facehuggers = 1 + can_hold_facehuggers = TRUE can_hold_eggs = CAN_HOLD_TWO_HANDS acid_level = 1 weed_level = WEED_LEVEL_STANDARD @@ -118,3 +119,10 @@ /mob/living/carbon/xenomorph/lesser_drone/handle_ghost_message() return + +/datum/behavior_delegate/lesser_drone_base + name = "Base Lesser Drone Behavior Delegate" + +/datum/behavior_delegate/lesser_drone_base/on_life() + if(bound_xeno.body_position == STANDING_UP && !(locate(/obj/effect/alien/weeds) in get_turf(bound_xeno))) + bound_xeno.adjustBruteLoss(5)