From 4e050485241e262fcef105fd47ba7fc6fc3459cb Mon Sep 17 00:00:00 2001 From: Perakp Date: Sun, 1 Dec 2013 08:52:34 +0200 Subject: [PATCH] Fixes multiple embryos in single host MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Added checks so you can’t have multiple embryos in a single host. Checks are included in both facehugger.dm and alien_embryo.dm, because there might be ways to implant embryos without facehuggers in the future, but we also want to avoid creating and instantly deleting objects. Also changes chest augmentation surgery to remove any embryos. Before you could remove the whole chest without finding the embryo inside. --- .../mob/living/carbon/alien/special/alien_embryo.dm | 4 +++- .../mob/living/carbon/alien/special/facehugger.dm | 7 ++++--- code/modules/surgery/limb augmentation.dm | 2 ++ code/modules/surgery/xenomorph_removal.dm | 13 +++++++++---- 4 files changed, 18 insertions(+), 8 deletions(-) diff --git a/code/modules/mob/living/carbon/alien/special/alien_embryo.dm b/code/modules/mob/living/carbon/alien/special/alien_embryo.dm index 056cb434c3b..6de54fc375d 100644 --- a/code/modules/mob/living/carbon/alien/special/alien_embryo.dm +++ b/code/modules/mob/living/carbon/alien/special/alien_embryo.dm @@ -14,8 +14,10 @@ var/const/ALIEN_AFK_BRACKET = 450 // 45 seconds if(istype(loc, /mob/living)) affected_mob = loc - if(affected_mob.getlimb(/obj/item/organ/limb/robot/chest)) //If our Victim is augmented in the chest, No Babby - RR + if(affected_mob.getlimb(/obj/item/organ/limb/robot/chest) | affected_mob.status_flags & XENO_HOST) //If our Victim is augmented in the chest, No Babby - RR + Del(src) return + affected_mob.status_flags |= XENO_HOST processing_objects.Add(src) spawn(0) AddInfectionImages(affected_mob) diff --git a/code/modules/mob/living/carbon/alien/special/facehugger.dm b/code/modules/mob/living/carbon/alien/special/facehugger.dm index a37b3483a60..b9b04c90203 100644 --- a/code/modules/mob/living/carbon/alien/special/facehugger.dm +++ b/code/modules/mob/living/carbon/alien/special/facehugger.dm @@ -161,14 +161,15 @@ var/const/MAX_ACTIVE_TIME = 400 if(!sterile) //target.contract_disease(new /datum/disease/alien_embryo(0)) //so infection chance is same as virus infection chance - new /obj/item/alien_embryo(target) - target.status_flags |= XENO_HOST - target.visible_message("\red \b [src] falls limp after violating [target]'s face!") Die() icon_state = "[initial(icon_state)]_impregnated" + if(!target.getlimb(/obj/item/organ/limb/robot/chest) && !(target.status_flags & XENO_HOST)) + new /obj/item/alien_embryo(target) + + if(iscorgi(target)) var/mob/living/simple_animal/corgi/C = target src.loc = get_turf(C) diff --git a/code/modules/surgery/limb augmentation.dm b/code/modules/surgery/limb augmentation.dm index 0a38c93cdc9..79ee6030520 100644 --- a/code/modules/surgery/limb augmentation.dm +++ b/code/modules/surgery/limb augmentation.dm @@ -61,6 +61,8 @@ if("head") H.organs += new /obj/item/organ/limb/robot/head(src) if("chest") + var/datum/surgery_step/xenomorph_removal/xeno_removal = new + xeno_removal.remove_xeno(user, target) // remove an alien if there is one H.organs += new /obj/item/organ/limb/robot/chest(src) for(var/datum/disease/appendicitis/A in H.viruses) //If they already have Appendicitis, Remove it A.cure(1) diff --git a/code/modules/surgery/xenomorph_removal.dm b/code/modules/surgery/xenomorph_removal.dm index 6577d89d66d..9143713034d 100644 --- a/code/modules/surgery/xenomorph_removal.dm +++ b/code/modules/surgery/xenomorph_removal.dm @@ -16,6 +16,13 @@ user.visible_message("[user] begins to search in [target]'s chest for a xenomorph.") /datum/surgery_step/xenomorph_removal/success(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery) + if(remove_xeno(user, target)) + user.visible_message("[user] successfully extracts the xenomorph from [target]!") + else + user.visible_message("[user] can't find anything in [target]'s chest!") + return 1 + +/datum/surgery_step/xenomorph_removal/proc/remove_xeno(mob/user, mob/living/carbon/target) var/obj/item/alien_embryo/A = locate() in target.contents if(A) user << "You found an unknown alien organism in [target]'s chest!" @@ -27,10 +34,8 @@ A.AttemptGrow() A.loc = get_turf(target) - user.visible_message("[user] successfully extracts the xenomorph from [target]!") - else - user.visible_message("[user] can't find anything in [target]'s chest!") - return 1 + return 1 + /datum/surgery_step/xenomorph_removal/failure(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery) var/obj/item/alien_embryo/A = locate() in target.contents