Spider updates (#2562)

CHANGES:

Spiders will no longer create massive stacks of cocoons under dead comrades. Fixes #2448
Limbs infested with spider eggs will now take longer to burst. When they do burst, the limb is gibbed.
Infested limbs will give out more warning now past a certain stage.
Modified the spider event. The moderate severity one will now no longer spawn nurses, so they can't multiply.
Added a major severity spider event. It spawns more spiders than the moderate severity one along with nurses.
This commit is contained in:
skull132
2017-06-04 19:55:18 +03:00
committed by GitHub
parent 5ce2fc79ef
commit 08fc62966d
6 changed files with 185 additions and 102 deletions
+95 -41
View File
@@ -54,9 +54,12 @@
/obj/effect/spider/stickyweb
icon_state = "stickyweb1"
New()
if(prob(50))
icon_state = "stickyweb2"
/obj/effect/spider/stickyweb/Initialize()
. = ..()
if(prob(50))
icon_state = "stickyweb2"
/obj/effect/spider/stickyweb/CanPass(atom/movable/mover, turf/target, height=0, air_group=0)
if(air_group || (height==0)) return 1
@@ -75,14 +78,16 @@
desc = "They seem to pulse slightly with an inner life"
icon_state = "eggs"
var/amount_grown = 0
New()
pixel_x = rand(3,-3)
pixel_y = rand(3,-3)
START_PROCESSING(SSprocessing, src)
var/last_itch = 0
/obj/effect/spider/eggcluster/Initialize(var/mapload, var/atom/parent)
. = ..(mapload)
pixel_x = rand(3,-3)
pixel_y = rand(3,-3)
START_PROCESSING(SSprocessing, src)
/obj/effect/spider/eggcluster/New(var/location, var/atom/parent)
get_light_and_color(parent)
..()
/obj/effect/spider/eggcluster/Destroy()
STOP_PROCESSING(SSprocessing, src)
@@ -94,17 +99,23 @@
/obj/effect/spider/eggcluster/process()
amount_grown += rand(0,2)
var/obj/item/organ/external/O = null
if(isorgan(loc))
O = loc
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<num, i++)
var/spiderling = new /obj/effect/spider/spiderling(src.loc, src)
var/spiderling = new /obj/effect/spider/spiderling(src.loc, src, 0.75)
if(O)
O.implants += spiderling
qdel(src)
else if (O && O.owner && prob(1))
if(world.time > last_itch + 30 SECONDS)
last_itch = world.time
to_chat(O.owner, "<span class='notice'>Your [O.name] itches.</span>")
/obj/effect/spider/spiderling
name = "spiderling"
@@ -118,16 +129,23 @@
var/growth_rate = 1
var/obj/machinery/atmospherics/unary/vent_pump/entry_vent
var/travelling_in_vent = 0
var/list/possible_offspring
/obj/effect/spider/spiderling/Initialize(var/mapload, var/atom/parent, var/new_rate = 1, var/list/spawns = typesof(/mob/living/simple_animal/hostile/giant_spider))
. = ..(mapload)
/obj/effect/spider/spiderling/New(var/location, var/atom/parent)
pixel_x = rand(6,-6)
pixel_y = rand(6,-6)
START_PROCESSING(SSprocessing, src)
//50% chance to grow up
if(prob(50))
amount_grown = 1
growth_rate = new_rate
possible_offspring = spawns
get_light_and_color(parent)
..()
/obj/effect/spider/spiderling/Destroy()
STOP_PROCESSING(SSprocessing, src)
@@ -191,9 +209,7 @@
new_area.Entered(src)
else
entry_vent = null
//=================
else if(prob(25))
else if(prob(25) && isturf(loc))
var/list/nearby = oview(5, src)
if(nearby.len)
var/target_atom = pick(nearby)
@@ -208,33 +224,69 @@
walk_to(src, entry_vent, 5)
break
if(prob(1))
src.visible_message(span("notice", "\the [src] chitters."))
if(isturf(loc) && amount_grown > 0)
amount_grown += (rand(0,2)*growth_rate)
if(amount_grown >= 100)
var/spawn_type = pick(typesof(/mob/living/simple_animal/hostile/giant_spider))
new spawn_type(src.loc, src)
qdel(src)
if(isturf(loc) && amount_grown >= 100)
var/spawn_type = pick(possible_offspring)
new spawn_type(src.loc, src)
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("<span class='warning'>\A [src] makes its way out of [O.owner ? "[O.owner]'s [O.name]" : "\the [O]"]!</span>")
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 << "<span class='notice'>Your [O.name] itches...</span>"
if(amount_grown > 70)
burst_out(O)
if (O.owner)
if(amount_grown > 40 && prob(1))
O.owner.apply_damage(1, TOX, O.limb_name)
if(world.time > last_itch + 30 SECONDS)
last_itch = world.time
O.owner.visible_message(
"<span class='warning'>You think you see something moving around in \the [O.owner]'s [O.name].</span>",
"<span class='warning'>You [prob(25) ? "see" : "feel"] something large move around in your [O.name]!</span>")
else if (prob(1))
if(world.time > last_itch + 30 SECONDS)
last_itch = world.time
to_chat(O.owner, "<span class='notice'>You feel something large move around in your [O.name]!</span>")
else if(prob(1))
src.visible_message("<span class='notice'>\The [src] skitters.</span>")
if(amount_grown)
amount_grown += rand(0,2)
if (amount_grown > -1)
amount_grown += (rand(0, 1) * growth_rate)
/**
* Makes the organ spew out all of the spiderlings it has. It's triggered at the point
* of the first spiderling reaching 80% of more amount grown. This stops them from growing
* to full size inside a human.
*
* The proc also drops the limb if it's on a human, or gibs it if it's on the floor. For
* maximum drama, of course!
*
* @param O The organ/external limb the src is located inside of.
*/
/obj/effect/spider/spiderling/proc/burst_out(obj/item/organ/external/O = src.loc)
if (!istype(O))
return
if (O.owner)
O.owner.visible_message(
"<span class='danger'>A group of [src] burst out of [O.owner]'s [O]!</span>",
"<span class='danger'>A group of [src] burst out of your [O]!</span>")
O.owner.emote("scream")
else
O.visible_message("<span class='danger'>A group of [src] burst out of \the [O]!</span>")
var/target_loc = O.owner ? O.owner.loc : O.loc
// Swarm all of the spiders out so we can gib the limb.
for (var/obj/effect/spider/spiderling/S in O.implants)
O.implants -= S
S.forceMove(target_loc)
// if owner, dismember the shit out of it.
if (O.owner)
O.droplimb(0, DROPLIMB_BLUNT)
else
O.visible_message("<span class='danger'>\The [O] explodes into a pile of gore!</span>")
gibs(target_loc)
qdel(O)
/obj/effect/decal/cleanable/spiderling_remains
name = "spiderling remains"
@@ -248,7 +300,9 @@
icon_state = "cocoon1"
health = 60
/obj/effect/spider/cocoon/New()
/obj/effect/spider/cocoon/Initialize()
. = ..()
icon_state = pick("cocoon1","cocoon2","cocoon3")
/obj/effect/spider/cocoon/Destroy()
+3 -2
View File
@@ -163,7 +163,7 @@ var/global/list/severity_to_string = list(EVENT_LEVEL_MUNDANE = "Mundane", EVENT
new /datum/event_meta(EVENT_LEVEL_MODERATE, "Radiation Storm", /datum/event/radiation_storm, 100),
new /datum/event_meta(EVENT_LEVEL_MODERATE, "Random Antagonist", /datum/event/random_antag, 0, list(ASSIGNMENT_ANY = 1, ASSIGNMENT_SECURITY = 1),0,10,125, list("Extended")),
new /datum/event_meta(EVENT_LEVEL_MODERATE, "Rogue Drones", /datum/event/rogue_drone, 50, list(ASSIGNMENT_SECURITY = 25)),
new /datum/event_meta(EVENT_LEVEL_MODERATE, "Spider Infestation", /datum/event/spider_infestation, 50, list(ASSIGNMENT_SECURITY = 25)),
new /datum/event_meta(EVENT_LEVEL_MODERATE, "Moderate Spider Infestation",/datum/event/spider_infestation/moderate,50, list(ASSIGNMENT_SECURITY = 25)),
new /datum/event_meta(EVENT_LEVEL_MODERATE, "Viral Infection", /datum/event/viral_infection, 0, list(ASSIGNMENT_MEDICAL = 12), 1),
new /datum/event_meta(EVENT_LEVEL_MODERATE, "Major Vermin Infestation", /datum/event/infestation, 60, list(ASSIGNMENT_JANITOR = 15, ASSIGNMENT_SECURITY = 15))
)
@@ -177,7 +177,8 @@ var/global/list/severity_to_string = list(EVENT_LEVEL_MUNDANE = "Mundane", EVENT
new /datum/event_meta(EVENT_LEVEL_MAJOR, "Meteor Wave", /datum/event/meteor_wave, 40, list(ASSIGNMENT_ENGINEER = 10),1),
new /datum/event_meta(EVENT_LEVEL_MAJOR, "Space Vines", /datum/event/spacevine, 75, list(ASSIGNMENT_ENGINEER = 10, ASSIGNMENT_GARDENER = 20), 1),
new /datum/event_meta(EVENT_LEVEL_MAJOR, "Viral Infection", /datum/event/viral_infection, 20, list(ASSIGNMENT_MEDICAL = 15), 1),
new /datum/event_meta(EVENT_LEVEL_MAJOR, "Bluespace Bears", /datum/event/bear_attack, 25, list(ASSIGNMENT_SECURITY = 10), 1)
new /datum/event_meta(EVENT_LEVEL_MAJOR, "Bluespace Bears", /datum/event/bear_attack, 25, list(ASSIGNMENT_SECURITY = 10), 1),
new /datum/event_meta(EVENT_LEVEL_MAJOR, "Spider Infestation",/datum/event/spider_infestation, 25, list(ASSIGNMENT_SECURITY = 10, ASSIGNMENT_MEDICAL = 5), 1)
)
#undef ASSIGNMENT_ANY
+9 -3
View File
@@ -4,16 +4,17 @@
announceWhen = 90
var/spawncount = 1
ic_name = "unidentified lifesigns"
var/list/possible_spiders
/datum/event/spider_infestation/setup()
announceWhen = rand(announceWhen, announceWhen + 60)
spawncount = rand(4 * severity, 6 * severity) //spiderlings only have a 50% chance to grow big and strong
sent_spiders_to_station = 0
possible_spiders = typesof(/mob/living/simple_animal/hostile/giant_spider)
/datum/event/spider_infestation/announce()
command_announcement.Announce("Unidentified lifesigns detected coming aboard [station_name()]. Secure any exterior access, including ducting and ventilation.", "Lifesign Alert", new_sound = 'sound/AI/aliens.ogg')
/datum/event/spider_infestation/start()
var/list/vents = list()
for(var/obj/machinery/atmospherics/unary/vent_pump/temp_vent in world)
@@ -21,8 +22,13 @@
if(temp_vent.network.normal_members.len > 50)
vents += temp_vent
while((spawncount >= 1) && vents.len)
while(spawncount && vents.len)
var/obj/vent = pick(vents)
new /obj/effect/spider/spiderling(vent.loc)
new /obj/effect/spider/spiderling(vent.loc, spawns = possible_spiders)
vents -= vent
spawncount--
// Moderate event cannot spawn nurses, ergo, they only terrorize but do not replicate.
/datum/event/spider_infestation/moderate/setup()
..()
possible_spiders -= /mob/living/simple_animal/hostile/giant_spider/nurse
@@ -84,7 +84,7 @@
var/mob/living/carbon/human/H = .
if(prob(poison_per_bite))
var/obj/item/organ/external/O = pick(H.organs)
if(!(O.status & ORGAN_ROBOT))
if(!(O.status & (ORGAN_ROBOT|ORGAN_ADV_ROBOT)) && !O.cannot_amputate)
var/eggs = new /obj/effect/spider/eggcluster(O, src)
O.implants += eggs
H << "<span class='warning'>The [src] injects something into your [O.name]!</span>"
@@ -100,17 +100,11 @@
move_targets.Add(T)*/
stop_automated_movement = 1
walk_to(src, pick(orange(20, src)), 1, move_to_delay)
spawn(50)
stop_automated_movement = 0
walk(src,0)
addtimer(CALLBACK(src, .proc/stop_walking), 50, TIMER_UNIQUE)
/mob/living/simple_animal/hostile/giant_spider/nurse/proc/GiveUp(var/C)
spawn(100)
if(busy == MOVING_TO_TARGET)
if(cocoon_target == C && get_dist(src,cocoon_target) > 1)
cocoon_target = null
busy = 0
stop_automated_movement = 0
/mob/living/simple_animal/hostile/giant_spider/proc/stop_walking()
stop_automated_movement = 0
walk(src, 0)
/mob/living/simple_animal/hostile/giant_spider/nurse/Life()
..()
@@ -126,7 +120,7 @@
busy = MOVING_TO_TARGET
walk_to(src, C, 1, move_to_delay)
//give up if we can't reach them after 10 seconds
GiveUp(C)
addtimer(CALLBACK(src, .proc/GiveUp, C), 100, TIMER_UNIQUE)
return
//second, spin a sticky spiderweb on this tile
@@ -135,11 +129,7 @@
busy = SPINNING_WEB
src.visible_message("<span class='notice'>\The [src] begins to secrete a sticky substance.</span>")
stop_automated_movement = 1
spawn(40)
if(busy == SPINNING_WEB)
new /obj/effect/spider/stickyweb(src.loc)
busy = 0
stop_automated_movement = 0
addtimer(CALLBACK(src, .proc/finalize_web), 40, TIMER_UNIQUE)
else
//third, lay an egg cluster there
var/obj/effect/spider/eggcluster/E = locate() in get_turf(src)
@@ -147,14 +137,7 @@
busy = LAYING_EGGS
src.visible_message("<span class='notice'>\The [src] begins to lay a cluster of eggs.</span>")
stop_automated_movement = 1
spawn(50)
if(busy == LAYING_EGGS)
E = locate() in get_turf(src)
if(!E)
new /obj/effect/spider/eggcluster(loc, src)
fed--
busy = 0
stop_automated_movement = 0
addtimer(CALLBACK(src, .proc/finalize_eggs), 50, TIMER_UNIQUE)
else
//fourthly, cocoon any nearby items so those pesky pinkskins can't use them
for(var/obj/O in can_see)
@@ -176,42 +159,71 @@
src.visible_message("<span class='notice'>\The [src] begins to secrete a sticky substance around \the [cocoon_target].</span>")
stop_automated_movement = 1
walk(src,0)
spawn(50)
if(busy == SPINNING_COCOON)
if(cocoon_target && istype(cocoon_target.loc, /turf) && get_dist(src,cocoon_target) <= 1)
var/obj/effect/spider/cocoon/C = new(cocoon_target.loc)
var/large_cocoon = 0
C.pixel_x = cocoon_target.pixel_x
C.pixel_y = cocoon_target.pixel_y
for(var/mob/living/M in C.loc)
if(istype(M, /mob/living/simple_animal/hostile/giant_spider))
continue
large_cocoon = 1
fed++
src.visible_message("<span class='warning'>\The [src] sticks a proboscis into \the [cocoon_target] and sucks a viscous substance out.</span>")
M.loc = C
C.pixel_x = M.pixel_x
C.pixel_y = M.pixel_y
break
for(var/obj/item/I in C.loc)
I.loc = C
for(var/obj/structure/S in C.loc)
if(!S.anchored)
S.loc = C
large_cocoon = 1
for(var/obj/machinery/M in C.loc)
if(!M.anchored)
M.loc = C
large_cocoon = 1
if(large_cocoon)
C.icon_state = pick("cocoon_large1","cocoon_large2","cocoon_large3")
busy = 0
stop_automated_movement = 0
addtimer(CALLBACK(src, .proc/finalize_cocoon), 50, TIMER_UNIQUE)
else
busy = 0
stop_automated_movement = 0
/mob/living/simple_animal/hostile/giant_spider/nurse/proc/GiveUp(var/C)
if(busy == MOVING_TO_TARGET)
if(cocoon_target == C && get_dist(src,cocoon_target) > 1)
cocoon_target = null
busy = 0
stop_automated_movement = 0
/mob/living/simple_animal/hostile/giant_spider/nurse/proc/finalize_eggs()
if(busy == LAYING_EGGS)
if(!(locate(/obj/effect/spider/eggcluster) in get_turf(src)))
new /obj/effect/spider/eggcluster(loc, src)
fed--
busy = 0
stop_automated_movement = 0
/mob/living/simple_animal/hostile/giant_spider/nurse/proc/finalize_web()
if(busy == SPINNING_WEB)
new /obj/effect/spider/stickyweb(src.loc)
busy = 0
stop_automated_movement = 0
/mob/living/simple_animal/hostile/giant_spider/nurse/proc/finalize_cocoon()
if(busy == SPINNING_COCOON)
if(cocoon_target && istype(cocoon_target.loc, /turf) && get_dist(src,cocoon_target) <= 1)
var/obj/effect/spider/cocoon/C = new(cocoon_target.loc)
var/large_cocoon = 0
C.pixel_x = cocoon_target.pixel_x
C.pixel_y = cocoon_target.pixel_y
for (var/A in C.loc)
var/atom/movable/aa = A
if (ismob(aa))
var/mob/M = aa
if(istype(M, /mob/living/simple_animal/hostile/giant_spider) && M.stat != DEAD)
continue
large_cocoon = 1
fed++
src.visible_message("<span class='warning'>\The [src] sticks a proboscis into \the [cocoon_target] and sucks a viscous substance out.</span>")
M.forceMove(C)
C.pixel_x = M.pixel_x
C.pixel_y = M.pixel_y
break
if (istype(aa, /obj/item))
var/obj/item/I = aa
I.forceMove(C)
if (istype(aa, /obj/structure))
var/obj/structure/S = aa
if(!S.anchored)
S.forceMove(C)
large_cocoon = 1
if (istype(aa, /obj/machinery))
var/obj/machinery/M = aa
if(!M.anchored)
M.forceMove(C)
large_cocoon = 1
if(large_cocoon)
C.icon_state = pick("cocoon_large1","cocoon_large2","cocoon_large3")
busy = 0
stop_automated_movement = 0
#undef SPINNING_WEB
#undef LAYING_EGGS
#undef MOVING_TO_TARGET
+10
View File
@@ -0,0 +1,10 @@
author: Skull132
delete-after: True
changes:
- bugfix: "Spiders will no longer create massive stacks of cocoons under dead comrades."
- tweak: "Limbs infested with spider eggs will now take longer to burst. When they do burst, the limb is gibbed."
- tweak: "Infested limbs will give out more warning now past a certain stage."
- tweak: "Modified the spider event. The moderate severity one will now no longer spawn nurses, so they can't multiply."
- rscadd: "Added a major severity spider event. It spawns more spiders than the moderate severity one along with nurses."
Binary file not shown.