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