diff --git a/code/modules/antagonists/changeling/headslug_eggs.dm b/code/modules/antagonists/changeling/headslug_eggs.dm index e4327aa3ed1..8f861aec2ec 100644 --- a/code/modules/antagonists/changeling/headslug_eggs.dm +++ b/code/modules/antagonists/changeling/headslug_eggs.dm @@ -6,13 +6,21 @@ desc = "Twitching and disgusting." /// The mind of the original changeling that gave forth to the headslug mob. var/datum/mind/origin - /// Tracks how long the egg has been growing. - var/time = 0 + /// When we're expected to hatch. + var/hatch_time = 0 + /// When this egg last got removed from a body. If -1, the egg hasn't been removed from a body. + var/removal_time = -1 + +/obj/item/organ/internal/body_egg/changeling_egg/Insert(mob/living/carbon/egg_owner, special = FALSE, movement_flags = DELETE_IF_REPLACED) + . = ..() + hatch_time = world.time + (removal_time == -1 ? EGG_INCUBATION_TIME : (hatch_time - removal_time)) + +/obj/item/organ/internal/body_egg/changeling_egg/Remove(mob/living/carbon/egg_owner, special, movement_flags) + . = ..() + removal_time = world.time /obj/item/organ/internal/body_egg/changeling_egg/egg_process(seconds_per_tick, times_fired) - // Changeling eggs grow in dead people - time += seconds_per_tick * 10 - if(time >= EGG_INCUBATION_TIME) + if(owner && hatch_time <= world.time) pop() /// Once the egg is fully grown, we gib the host and spawn a monkey (with the changeling's player controlling it). Very descriptive proc name. diff --git a/code/modules/mob/living/basic/space_fauna/changeling/headslug.dm b/code/modules/mob/living/basic/space_fauna/changeling/headslug.dm index a417b6c1394..27a9f7d07ae 100644 --- a/code/modules/mob/living/basic/space_fauna/changeling/headslug.dm +++ b/code/modules/mob/living/basic/space_fauna/changeling/headslug.dm @@ -75,7 +75,6 @@ /// Just to be super-duper safe to the player, we do return TRUE if all goes well and read that value in check_and_implant() to be nice to the player. /mob/living/basic/headslug/proc/infect(mob/living/carbon/victim) var/obj/item/organ/internal/body_egg/changeling_egg/egg = new(victim) - egg.Insert(victim) egg.origin = mind