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
@@ -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