From 7168c9b0644a732d65c44b5e3b5d3d8bbd4f9274 Mon Sep 17 00:00:00 2001 From: PsiOmegaDelta Date: Thu, 4 Jun 2015 09:50:43 +0200 Subject: [PATCH 1/5] Spiderlings now inherit color and light from egg clusters, spiders inherit from spiderlings. --- code/game/objects/effects/spiders.dm | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/code/game/objects/effects/spiders.dm b/code/game/objects/effects/spiders.dm index 03b5c922d8..141eabc61f 100644 --- a/code/game/objects/effects/spiders.dm +++ b/code/game/objects/effects/spiders.dm @@ -79,13 +79,19 @@ pixel_x = rand(3,-3) pixel_y = rand(3,-3) processing_objects.Add(src) + +/obj/effect/spider/eggcluster/Destroy() + processing_objects.Remove(src) + ..() /obj/effect/spider/eggcluster/process() amount_grown += rand(0,2) if(amount_grown >= 100) var/num = rand(6,24) for(var/i=0, i= 100) var/spawn_type = pick(typesof(/mob/living/simple_animal/hostile/giant_spider)) - new spawn_type(src.loc) + var/mob/spiderspawn = new spawn_type(src.loc) + spiderspawn.color = color + spiderspawn.set_light(light_range, light_power, light_color) qdel(src) /obj/effect/decal/cleanable/spiderling_remains From dc22e8fed387ba93ca042cccc68b3601e440b70f Mon Sep 17 00:00:00 2001 From: PsiOmegaDelta Date: Thu, 4 Jun 2015 12:13:29 +0200 Subject: [PATCH 2/5] Giant spider nurses now have a chance of injecting their victims with spider eggs. Spider nurses now have poison_per_bite chance (currently 10%) to inject a random non-robotic external limb with spider eggs. These eggs will eventually hatch a number of spiderlings that will slowly grow inside their host, causing minor tox damage over time. If the organ is removed from the host, the host dies, or the spiderling has matured sufficiently it will crawl out into freedom. Medical scanners will register eggs and spiderlings as foreign bodies. --- code/game/objects/effects/spiders.dm | 72 +++++++++++++------ .../simple_animal/hostile/giant_spider.dm | 15 +++- 2 files changed, 61 insertions(+), 26 deletions(-) diff --git a/code/game/objects/effects/spiders.dm b/code/game/objects/effects/spiders.dm index 141eabc61f..ea420e56b9 100644 --- a/code/game/objects/effects/spiders.dm +++ b/code/game/objects/effects/spiders.dm @@ -78,18 +78,28 @@ New() pixel_x = rand(3,-3) pixel_y = rand(3,-3) - processing_objects.Add(src) - + processing_objects |= src + /obj/effect/spider/eggcluster/Destroy() - processing_objects.Remove(src) + processing_objects -= src + if(istype(loc, /obj/item/organ/external)) + var/obj/item/organ/external/O = loc + O.implants -= src + ..() /obj/effect/spider/eggcluster/process() amount_grown += rand(0,2) if(amount_grown >= 100) var/num = rand(6,24) + var/obj/item/organ/external/O = null + if(istype(loc, /obj/item/organ/external)) + O = loc + for(var/i=0, i\The [src] skitters[pick(" away"," around","")].") + else if(prob(5)) + //vent crawl! + for(var/obj/machinery/atmospherics/unary/vent_pump/v in view(7,src)) + if(!v.welded) + entry_vent = v + walk_to(src, entry_vent, 5) + break - else if(prob(25)) - var/list/nearby = oview(5, src) - if(nearby.len) - var/target_atom = pick(nearby) - walk_to(src, target_atom, 5) - if(prob(25)) - src.visible_message("\blue \the [src] skitters[pick(" away"," around","")].") - else if(prob(5)) - //vent crawl! - for(var/obj/machinery/atmospherics/unary/vent_pump/v in view(7,src)) - if(!v.welded) - entry_vent = v - walk_to(src, entry_vent, 5) - break - - if(prob(1)) - src.visible_message("\blue \the [src] chitters.") - if(isturf(loc) && amount_grown > 0) - amount_grown += rand(0,2) if(amount_grown >= 100) var/spawn_type = pick(typesof(/mob/living/simple_animal/hostile/giant_spider)) var/mob/spiderspawn = new spawn_type(src.loc) spiderspawn.color = color spiderspawn.set_light(light_range, light_power, light_color) qdel(src) + else if(isorgan(loc)) + if(!amount_grown) amount_grown = 1 + var/obj/item/organ/external/O = loc + if(!O.owner || O.owner.stat == DEAD || amount_grown > 80) + O.implants -= src + src.loc = O.owner ? O.owner.loc : O.loc + src.visible_message("\A [src] makes its way out of [O.owner ? "[O.owner]'s [O.name]" : "\the [O]"]!") + if(O.owner) + O.owner.apply_damage(1, BRUTE, O.limb_name) + else if(prob(1)) + O.owner.apply_damage(1, TOX, O.limb_name) + if(world.time > last_itch + 30 SECONDS) + last_itch = world.time + O.owner << "Your [O.name] itches..." + else if(prob(1)) + src.visible_message("\The [src] skitters.") + + if(amount_grown) + amount_grown += rand(0,2) /obj/effect/decal/cleanable/spiderling_remains name = "spiderling remains" @@ -214,7 +240,7 @@ icon_state = pick("cocoon1","cocoon2","cocoon3") /obj/effect/spider/cocoon/Destroy() - src.visible_message("\red \the [src] splits open.") + src.visible_message("\The [src] splits open.") for(var/atom/movable/A in contents) A.loc = src.loc return ..() diff --git a/code/modules/mob/living/simple_animal/hostile/giant_spider.dm b/code/modules/mob/living/simple_animal/hostile/giant_spider.dm index 4d7a8f7e3a..40247c7584 100644 --- a/code/modules/mob/living/simple_animal/hostile/giant_spider.dm +++ b/code/modules/mob/living/simple_animal/hostile/giant_spider.dm @@ -64,15 +64,24 @@ move_to_delay = 4 /mob/living/simple_animal/hostile/giant_spider/AttackingTarget() - ..() - if(isliving(target_mob)) - var/mob/living/L = target_mob + var/target = ..() + if(isliving(target)) + var/mob/living/L = target if(L.reagents) L.reagents.add_reagent("toxin", poison_per_bite) if(prob(poison_per_bite)) L << "\red You feel a tiny prick." L.reagents.add_reagent(poison_type, 5) +/mob/living/simple_animal/hostile/giant_spider/nurse/AttackingTarget() + var/target = ..() + if(ishuman(target)) + var/mob/living/carbon/human/H = target + if(prob(poison_per_bite)) + var/obj/item/organ/external/O = pick(H.organs) + if(!(O.status & ORGAN_ROBOT)) + O.implants += new/obj/effect/spider/eggcluster(O) + /mob/living/simple_animal/hostile/giant_spider/Life() ..() if(!stat) From 5006e8160d85bbe62b185dc3d03ecf1f72edf732 Mon Sep 17 00:00:00 2001 From: PsiOmegaDelta Date: Thu, 4 Jun 2015 12:19:54 +0200 Subject: [PATCH 3/5] Spider eggs now also inherit color and light from their mother. --- .../mob/living/simple_animal/hostile/giant_spider.dm | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/code/modules/mob/living/simple_animal/hostile/giant_spider.dm b/code/modules/mob/living/simple_animal/hostile/giant_spider.dm index 40247c7584..091bd200cd 100644 --- a/code/modules/mob/living/simple_animal/hostile/giant_spider.dm +++ b/code/modules/mob/living/simple_animal/hostile/giant_spider.dm @@ -80,7 +80,10 @@ if(prob(poison_per_bite)) var/obj/item/organ/external/O = pick(H.organs) if(!(O.status & ORGAN_ROBOT)) - O.implants += new/obj/effect/spider/eggcluster(O) + var/obj/effect/spider/eggcluster/eggs = new(O) + eggs.color = color + eggs.set_light(light_range, light_power, light_color) + O.implants += eggs /mob/living/simple_animal/hostile/giant_spider/Life() ..() @@ -144,7 +147,9 @@ if(busy == LAYING_EGGS) E = locate() in get_turf(src) if(!E) - new /obj/effect/spider/eggcluster(src.loc) + var/obj/effect/spider/eggcluster/eggs = new(src.loc) + eggs.color = color + eggs.set_light(light_range, light_power, light_color) fed-- busy = 0 stop_automated_movement = 0 From 2f9abd759ee09a7407121422492d1ca2bff241e5 Mon Sep 17 00:00:00 2001 From: PsiOmegaDelta Date: Thu, 4 Jun 2015 12:25:17 +0200 Subject: [PATCH 4/5] Changelog entry. --- html/changelogs/PsiOmegaDelta-SpiderGlow.yml | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 html/changelogs/PsiOmegaDelta-SpiderGlow.yml diff --git a/html/changelogs/PsiOmegaDelta-SpiderGlow.yml b/html/changelogs/PsiOmegaDelta-SpiderGlow.yml new file mode 100644 index 0000000000..bccc54c320 --- /dev/null +++ b/html/changelogs/PsiOmegaDelta-SpiderGlow.yml @@ -0,0 +1,5 @@ +author: PsiOmegaDelta +delete-after: True + +changes: + - rscadd: "Spider nurses now have a chance of injecting their victims with spider eggs which eventually hatch. If the limb is removed from the host, the host dies, or the spiderling has matured sufficiently it will crawl out into freedom. Medical scanners will pick upp eggs and spiderlings as foreign bodies." From 55bc495ee73c9bd666b94e3bf271bba5ba94d345 Mon Sep 17 00:00:00 2001 From: PsiOmegaDelta Date: Thu, 4 Jun 2015 14:12:27 +0200 Subject: [PATCH 5/5] Some cleanup of code. --- code/__HELPERS/unsorted.dm | 5 +++ code/game/objects/effects/spiders.dm | 36 +++++++++++-------- .../simple_animal/hostile/giant_spider.dm | 20 +++++------ 3 files changed, 37 insertions(+), 24 deletions(-) diff --git a/code/__HELPERS/unsorted.dm b/code/__HELPERS/unsorted.dm index 75166b3f48..da54173471 100644 --- a/code/__HELPERS/unsorted.dm +++ b/code/__HELPERS/unsorted.dm @@ -1373,3 +1373,8 @@ var/list/WALLITEMS = list( temp_col = "0[temp_col]" colour += temp_col return colour + +/atom/proc/get_light_and_color(var/atom/origin) + if(origin) + color = origin.color + set_light(origin.light_range, origin.light_power, origin.light_color) diff --git a/code/game/objects/effects/spiders.dm b/code/game/objects/effects/spiders.dm index ea420e56b9..c54b1c15c4 100644 --- a/code/game/objects/effects/spiders.dm +++ b/code/game/objects/effects/spiders.dm @@ -80,6 +80,10 @@ pixel_y = rand(3,-3) processing_objects |= src +/obj/effect/spider/eggcluster/New(var/location, var/atom/parent) + get_light_and_color(parent) + ..() + /obj/effect/spider/eggcluster/Destroy() processing_objects -= src if(istype(loc, /obj/item/organ/external)) @@ -97,11 +101,9 @@ O = loc for(var/i=0, i= 100) var/spawn_type = pick(typesof(/mob/living/simple_animal/hostile/giant_spider)) - var/mob/spiderspawn = new spawn_type(src.loc) - spiderspawn.color = color - spiderspawn.set_light(light_range, light_power, light_color) + new spawn_type(src.loc, src) qdel(src) else if(isorgan(loc)) if(!amount_grown) amount_grown = 1 diff --git a/code/modules/mob/living/simple_animal/hostile/giant_spider.dm b/code/modules/mob/living/simple_animal/hostile/giant_spider.dm index 091bd200cd..793e421b99 100644 --- a/code/modules/mob/living/simple_animal/hostile/giant_spider.dm +++ b/code/modules/mob/living/simple_animal/hostile/giant_spider.dm @@ -63,6 +63,10 @@ poison_per_bite = 5 move_to_delay = 4 +/mob/living/simple_animal/hostile/giant_spider/New(var/location, var/atom/parent) + get_light_and_color(parent) + ..() + /mob/living/simple_animal/hostile/giant_spider/AttackingTarget() var/target = ..() if(isliving(target)) @@ -80,9 +84,7 @@ if(prob(poison_per_bite)) var/obj/item/organ/external/O = pick(H.organs) if(!(O.status & ORGAN_ROBOT)) - var/obj/effect/spider/eggcluster/eggs = new(O) - eggs.color = color - eggs.set_light(light_range, light_power, light_color) + var/eggs = PoolOrNew(/obj/effect/spider/eggcluster/, list(O, src)) O.implants += eggs /mob/living/simple_animal/hostile/giant_spider/Life() @@ -129,7 +131,7 @@ var/obj/effect/spider/stickyweb/W = locate() in get_turf(src) if(!W) busy = SPINNING_WEB - src.visible_message("\blue \the [src] begins to secrete a sticky substance.") + src.visible_message("\The [src] begins to secrete a sticky substance.") stop_automated_movement = 1 spawn(40) if(busy == SPINNING_WEB) @@ -141,15 +143,13 @@ var/obj/effect/spider/eggcluster/E = locate() in get_turf(src) if(!E && fed > 0) busy = LAYING_EGGS - src.visible_message("\blue \the [src] begins to lay a cluster of eggs.") + src.visible_message("\The [src] begins to lay a cluster of eggs.") stop_automated_movement = 1 spawn(50) if(busy == LAYING_EGGS) E = locate() in get_turf(src) if(!E) - var/obj/effect/spider/eggcluster/eggs = new(src.loc) - eggs.color = color - eggs.set_light(light_range, light_power, light_color) + PoolOrNew(/obj/effect/spider/eggcluster, list(loc, src)) fed-- busy = 0 stop_automated_movement = 0 @@ -171,7 +171,7 @@ else if(busy == MOVING_TO_TARGET && cocoon_target) if(get_dist(src, cocoon_target) <= 1) busy = SPINNING_COCOON - src.visible_message("\blue \the [src] begins to secrete a sticky substance around \the [cocoon_target].") + src.visible_message("\The [src] begins to secrete a sticky substance around \the [cocoon_target].") stop_automated_movement = 1 walk(src,0) spawn(50) @@ -186,7 +186,7 @@ continue large_cocoon = 1 fed++ - src.visible_message("\red \the [src] sticks a proboscis into \the [cocoon_target] and sucks a viscous substance out.") + src.visible_message("\The [src] sticks a proboscis into \the [cocoon_target] and sucks a viscous substance out.") M.loc = C C.pixel_x = M.pixel_x C.pixel_y = M.pixel_y