From 31217a058dfc451a7f744b33c776f9314afeae9a Mon Sep 17 00:00:00 2001 From: Fox-McCloud Date: Sat, 12 Mar 2016 23:37:01 -0500 Subject: [PATCH 1/2] Implements Changeling Headcrabs --- .../gamemodes/changeling/powers/headcrab.dm | 40 +++++++++ code/modules/mob/living/carbon/carbon.dm | 13 ++- code/modules/mob/living/carbon/human/death.dm | 6 ++ .../living/simple_animal/hostile/headcrab.dm | 88 +++++++++++++++++++ paradise.dme | 2 + 5 files changed, 145 insertions(+), 4 deletions(-) create mode 100644 code/game/gamemodes/changeling/powers/headcrab.dm create mode 100644 code/modules/mob/living/simple_animal/hostile/headcrab.dm diff --git a/code/game/gamemodes/changeling/powers/headcrab.dm b/code/game/gamemodes/changeling/powers/headcrab.dm new file mode 100644 index 00000000000..98c7b964f4a --- /dev/null +++ b/code/game/gamemodes/changeling/powers/headcrab.dm @@ -0,0 +1,40 @@ +/obj/effect/proc_holder/changeling/headcrab + name = "Last Resort" + desc = "We sacrifice our current body in a moment of need, placing us in control of a vessel." + helptext = "We will be placed in control of a small, fragile creature. We may attack a corpse like this to plant an egg which will slowly mature into a new form for us." + chemical_cost = 20 + dna_cost = 1 + req_human = 1 + +/obj/effect/proc_holder/changeling/headcrab/sting_action(mob/user) + var/datum/mind/M = user.mind + var/list/organs = user.get_organs_zone("head", 1) + + for(var/obj/item/organ/internal/I in organs) + I.remove(user, 1) + + explosion(get_turf(user),0,0,2,0,silent=1) + for(var/mob/living/carbon/human/H in range(2,user)) + H << "You are blinded by a shower of blood!" + H.Stun(1) + H.eye_blurry = max(20, H.eye_blurry) + var/obj/item/organ/internal/eyes/E = H.get_int_organ(/obj/item/organ/internal/eyes) + if(istype(E)) + E.damage = max(E.damage+5, 0) + H.confused += 3 + for(var/mob/living/silicon/S in range(2,user)) + S << "Your sensors are disabled by a shower of blood!" + S.Weaken(3) + var/turf = get_turf(user) + spawn(5) // So it's not killed in explosion + var/mob/living/simple_animal/hostile/headcrab/crab = new(turf) + for(var/obj/item/organ/internal/I in organs) + I.loc = crab + crab.origin = M + if(crab.origin) + crab.origin.active = 1 + crab.origin.transfer_to(crab) + crab << "You burst out of the remains of your former body in a shower of gore!" + user.gib() + feedback_add_details("changeling_powers","LR") + return 1 \ No newline at end of file diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index 955cfbb8e8c..44c6dac9fe1 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -93,13 +93,18 @@ #undef STOMACH_ATTACK_DELAY /mob/living/carbon/gib() + for(var/obj/item/organ/internal/I in internal_organs) + if(istype(loc,/turf)) + I.remove(src) + I.forceMove(get_turf(src)) + spawn() + I.throw_at(get_edge_target_turf(src,pick(alldirs)),rand(1,3),5) + for(var/mob/M in src) if(M in src.stomach_contents) src.stomach_contents.Remove(M) - M.loc = src.loc - for(var/mob/N in viewers(src, null)) - if(N.client) - N.show_message(text("\red [M] bursts out of [src]!"), 2) + M.forceMove(get_turf(src)) + visible_message("[M] bursts out of [src]!") . = ..() diff --git a/code/modules/mob/living/carbon/human/death.dm b/code/modules/mob/living/carbon/human/death.dm index 795ab7b7ba8..62ec059dd9a 100644 --- a/code/modules/mob/living/carbon/human/death.dm +++ b/code/modules/mob/living/carbon/human/death.dm @@ -28,6 +28,12 @@ // Override the current limb status and don't cause an explosion E.droplimb(DROPLIMB_EDGE) + for(var/mob/M in src) + if(M in stomach_contents) + stomach_contents.Remove(M) + M.forceMove(get_turf(src)) + visible_message("[M] bursts out of [src]!") + if(!isSynthetic()) flick("gibbed-h", animation) hgibs(loc, viruses, dna) diff --git a/code/modules/mob/living/simple_animal/hostile/headcrab.dm b/code/modules/mob/living/simple_animal/hostile/headcrab.dm new file mode 100644 index 00000000000..4dd8862b4a9 --- /dev/null +++ b/code/modules/mob/living/simple_animal/hostile/headcrab.dm @@ -0,0 +1,88 @@ +#define EGG_INCUBATION_TIME 120 + +/mob/living/simple_animal/hostile/headcrab + name = "headslug" + desc = "Absolutely not de-beaked or harmless. Keep away from corpses." + icon_state = "headcrab" + icon_living = "headcrab" + icon_dead = "headcrab_dead" + icon = 'icons/mob/mob.dmi' + health = 50 + maxHealth = 50 + melee_damage_lower = 5 + melee_damage_upper = 5 + attacktext = "chomps" + attack_sound = 'sound/weapons/bite.ogg' + faction = list("creature") + robust_searching = 1 + stat_attack = 2 + environment_smash = 0 + speak_emote = list("squeaks") + ventcrawler = 2 + var/datum/mind/origin + var/egg_lain = 0 + +/mob/living/simple_animal/hostile/headcrab/proc/Infect(mob/living/carbon/victim) + var/obj/item/organ/internal/body_egg/changeling_egg/egg = new(victim) + egg.insert(victim) + if(origin) + egg.origin = origin + else if(mind) // Let's make this a feature + egg.origin = mind + for(var/obj/item/organ/internal/I in src) + I.loc = egg + visible_message("[src] plants something in [victim]'s flesh!", \ + "We inject our egg into [victim]'s body!") + egg_lain = 1 + +/mob/living/simple_animal/hostile/headcrab/AttackingTarget() + if(egg_lain) + target.attack_animal(src) + return + if(iscarbon(target) && !issmall(target)) + // Changeling egg can survive in aliens! + var/mob/living/carbon/C = target + if(C.stat == DEAD) + if(C.status_flags & XENO_HOST) + src << "A foreign presence repels us from this body. Perhaps we should try to infest another?" + return + Infect(target) + src << "With our egg laid, our death approaches rapidly..." + spawn(100) + death() + return + target.attack_animal(src) + + + + +/obj/item/organ/internal/body_egg/changeling_egg + name = "changeling egg" + desc = "Twitching and disgusting." + origin_tech = "biotech=7" // You need to be really lucky to obtain it. + var/datum/mind/origin + var/time + +/obj/item/organ/internal/body_egg/changeling_egg/egg_process() + // Changeling eggs grow in dead people + time++ + if(time >= EGG_INCUBATION_TIME) + Pop() + remove(owner) + qdel(src) + +/obj/item/organ/internal/body_egg/changeling_egg/proc/Pop() + var/mob/living/carbon/human/monkey/M = new(owner) + owner.stomach_contents += M + + for(var/obj/item/organ/internal/I in src) + I.insert(M, 1) + + if(origin && origin.current && (origin.current.stat == DEAD)) + origin.transfer_to(M) + if(origin.changeling) + origin.changeling.purchasedpowers += new /obj/effect/proc_holder/changeling/humanform(null) + M.key = origin.key + owner.gib() + +#undef EGG_INCUBATION_TIME diff --git a/paradise.dme b/paradise.dme index 5aacb4a45d5..72b56fe5a4f 100644 --- a/paradise.dme +++ b/paradise.dme @@ -317,6 +317,7 @@ #include "code\game\gamemodes\changeling\powers\fakedeath.dm" #include "code\game\gamemodes\changeling\powers\fleshmend.dm" #include "code\game\gamemodes\changeling\powers\glands.dm" +#include "code\game\gamemodes\changeling\powers\headcrab.dm" #include "code\game\gamemodes\changeling\powers\hivemind.dm" #include "code\game\gamemodes\changeling\powers\humanform.dm" #include "code\game\gamemodes\changeling\powers\lesserform.dm" @@ -1502,6 +1503,7 @@ #include "code\modules\mob\living\simple_animal\hostile\creature.dm" #include "code\modules\mob\living\simple_animal\hostile\faithless.dm" #include "code\modules\mob\living\simple_animal\hostile\giant_spider.dm" +#include "code\modules\mob\living\simple_animal\hostile\headcrab.dm" #include "code\modules\mob\living\simple_animal\hostile\hivebot.dm" #include "code\modules\mob\living\simple_animal\hostile\hostile.dm" #include "code\modules\mob\living\simple_animal\hostile\jungle_animals.dm" From 55a36bbff1a3c2806ff28011e92a7106e143bae8 Mon Sep 17 00:00:00 2001 From: Fox-McCloud Date: Mon, 14 Mar 2016 15:03:14 -0400 Subject: [PATCH 2/2] isturf --- code/modules/mob/living/carbon/carbon.dm | 2 +- code/modules/mob/living/carbon/human/death.dm | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index 44c6dac9fe1..a6f57fe5150 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -94,7 +94,7 @@ /mob/living/carbon/gib() for(var/obj/item/organ/internal/I in internal_organs) - if(istype(loc,/turf)) + if(isturf(loc)) I.remove(src) I.forceMove(get_turf(src)) spawn() diff --git a/code/modules/mob/living/carbon/human/death.dm b/code/modules/mob/living/carbon/human/death.dm index 62ec059dd9a..589331a7c01 100644 --- a/code/modules/mob/living/carbon/human/death.dm +++ b/code/modules/mob/living/carbon/human/death.dm @@ -14,7 +14,7 @@ playsound(src.loc, 'sound/goonstation/effects/gib.ogg', 50, 1) for(var/obj/item/organ/internal/I in internal_organs) - if(istype(loc,/turf)) + if(isturf(loc)) I.remove(src) I.forceMove(get_turf(src)) spawn()