// TODO: probably rework how these work, this is all pretty awful. /obj/structure/spider name = "web" desc = "it's stringy and sticky" icon = 'icons/effects/effects.dmi' anchored = TRUE density = FALSE integrity = 15 integrity_max = 15 armor_type = /datum/armor/none /obj/structure/spider/fire_act(datum/gas_mixture/air, exposed_temperature, exposed_volume) if(exposed_temperature > 300 + T0C) damage_integrity(5) /obj/structure/spider/process_damage_instance(list/shieldcall_args, filter_zone) . = ..() if(shieldcall_args[SHIELDCALL_ARG_DAMAGE_TYPE]) shieldcall_args[SHIELDCALL_ARG_DAMAGE] *= 2 /obj/structure/spider/stickyweb icon_state = "stickyweb1" /obj/structure/spider/stickyweb/Initialize(mapload) if(prob(50)) icon_state = "stickyweb2" return ..() /obj/structure/spider/stickyweb/CanAllowThrough(atom/movable/mover, turf/target) . = ..() if(istype(mover, /mob/living/simple_mob/animal/giant_spider)) return TRUE else if(istype(mover, /mob/living)) if(prob(50)) to_chat(mover, SPAN_WARNING( "You get stuck in \the [src] for a moment.")) return FALSE else if(istype(mover, /obj/projectile)) return prob(30) return TRUE /obj/structure/spider/eggcluster name = "egg cluster" desc = "They seem to pulse slightly with an inner life" icon_state = "eggs" var/amount_grown = 0 var/spiders_min = 6 var/spiders_max = 24 var/spider_type = /obj/structure/spider/spiderling /obj/structure/spider/eggcluster/Initialize(mapload) pixel_x = rand(3,-3) pixel_y = rand(3,-3) START_PROCESSING(SSobj, src) return ..() /obj/structure/spider/eggcluster/Initialize(mapload, atom/parent) . = ..() get_light_and_color(parent) /obj/structure/spider/eggcluster/Destroy() STOP_PROCESSING(SSobj, src) if(istype(loc, /obj/item/organ/external)) var/obj/item/organ/external/O = loc O.implants -= src return ..() /obj/structure/spider/eggcluster/process(delta_time) amount_grown += rand(0,2) if(amount_grown >= 100) var/num = rand(spiders_min, spiders_max) var/obj/item/organ/external/O = null if(istype(loc, /obj/item/organ/external)) O = loc for(var/i=0, i[src] dies!") new /obj/effect/debris/cleanable/spiderling_remains(src.loc) return ..() /obj/structure/spider/spiderling/process(delta_time) if(travelling_in_vent) if(istype(src.loc, /turf)) travelling_in_vent = 0 entry_vent = null else if(entry_vent) if(get_dist(src, entry_vent) <= 1) var/obj/machinery/atmospherics/component/unary/vent_pump/exit_vent = get_safe_ventcrawl_target(entry_vent) if(!exit_vent) return spawn(rand(20,60)) // todo: remove this shit if(QDELETED(src)) return forceMove(exit_vent) var/travel_time = round(get_dist(loc, exit_vent.loc) / 2) spawn(travel_time) // todo: remove this shit if(QDELETED(src)) return if(!exit_vent || exit_vent.welded) forceMove(entry_vent) entry_vent = null return if(prob(50)) src.visible_message("You hear something squeezing through the ventilation ducts.",2) sleep(travel_time) // todo: remove this shit if(QDELETED(src)) return if(!exit_vent || exit_vent.welded) forceMove(entry_vent) entry_vent = null return forceMove(exit_vent) entry_vent = null var/area/new_area = get_area(loc) if(new_area) new_area.Entered(src) if(isturf(loc)) skitter() else if(isorgan(loc)) if(amount_grown < 0) 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, DAMAGE_TYPE_BRUTE, O.organ_tag) else if(prob(1)) O.owner.apply_damage(1, DAMAGE_TYPE_TOX, O.organ_tag) if(world.time > last_itch + 30 SECONDS) last_itch = world.time to_chat(O.owner, "Your [O.name] itches...") else if(prob(1)) src.visible_message("\The [src] skitters.") if(amount_grown >= 0) amount_grown += rand(0,2) /obj/structure/spider/spiderling/proc/skitter() if(isturf(loc)) if(prob(25)) var/list/nearby = trange(5, src) - loc if(nearby.len) var/target_atom = pick(nearby) walk_to(src, target_atom, 5) if(prob(25)) src.visible_message("\The [src] skitters[pick(" away"," around","")].") else if(prob(5)) //vent crawl! for(var/obj/machinery/atmospherics/component/unary/vent_pump/v in view(7,src)) if(!v.welded) entry_vent = v walk_to(src, entry_vent, 5) break if(amount_grown >= 100) var/spawn_type = pick(grow_as) var/mob/living/simple_mob/animal/giant_spider/GS = new spawn_type(src.loc, src) if(stunted) spawn(2) // todo: remove this shit if(QDELETED(src)) return GS.make_spiderling() qdel(src) //Rather than kneecap all spiderlings, I figure I'll just make a spiderling cousin that doesn't have the ability. /obj/structure/spider/spiderling/no_crawl /obj/structure/spider/spiderling/no_crawl/skitter() if(isturf(loc)) if(prob(25)) var/list/nearby = trange(5, src) - loc if(nearby.len) var/target_atom = pick(nearby) walk_to(src, target_atom, 5) if(prob(25)) src.visible_message("\The [src] skitters[pick(" away"," around","")].") else if(prob(0)) //vent crawl! for(var/obj/machinery/atmospherics/component/unary/vent_pump/v in view(7,src)) if(!v.welded) entry_vent = v walk_to(src, entry_vent, 5) break if(amount_grown >= 100) var/spawn_type = pick(grow_as) var/mob/living/simple_mob/animal/giant_spider/GS = new spawn_type(src.loc, src) if(stunted) spawn(2) // todo: remove this shit if(QDELETED(src)) return GS.make_spiderling() qdel(src) /obj/structure/spider/spiderling/stunted stunted = TRUE grow_as = list(/mob/living/simple_mob/animal/giant_spider, /mob/living/simple_mob/animal/giant_spider/hunter) /obj/effect/debris/cleanable/spiderling_remains name = "spiderling remains" desc = "Green squishy mess." icon = 'icons/effects/effects.dmi' icon_state = "greenshatter" /obj/structure/spider/cocoon name = "cocoon" desc = "Something wrapped in silky spider web" icon_state = "cocoon1" integrity = 30 integrity_max = 30 /obj/structure/spider/cocoon/Initialize(mapload) . = ..() icon_state = pick("cocoon1","cocoon2","cocoon3") /obj/structure/spider/cocoon/Destroy() src.visible_message("\The [src] splits open.") for(var/atom/movable/A in contents) A.loc = src.loc return ..()