Fixes #15065 - green terrors laying eggs while in vents (#15067)

* Fixes #15065 - greens laying eggs while in vents

* AA suggestion

Co-authored-by: AffectedArc07 <25063394+AffectedArc07@users.noreply.github.com>

Co-authored-by: Kyep <Kyep@users.noreply.github.com>
Co-authored-by: AffectedArc07 <25063394+AffectedArc07@users.noreply.github.com>
This commit is contained in:
Kyep
2020-12-08 12:31:33 +00:00
committed by GitHub
co-authored by AffectedArc07 Kyep
parent 15fa644a28
commit a6d048f719
4 changed files with 13 additions and 0 deletions
@@ -137,6 +137,9 @@
/mob/living/simple_animal/hostile/poison/terror_spider/proc/Web()
if(!web_type)
return
if(!isturf(loc))
to_chat(src, "<span class='danger'>Webs can only be spun while standing on a floor.</span>")
return
var/turf/mylocation = loc
visible_message("<span class='notice'>[src] begins to secrete a sticky substance.</span>")
if(do_after(src, delay_web, target = loc))
@@ -50,6 +50,10 @@
if(!(eggtype in eggtypes))
to_chat(src, "<span class='danger'>Unrecognized egg type.</span>")
return 0
if(!isturf(loc))
// This has to be checked after we ask the user what egg type. Otherwise they could trigger prompt THEN move into a vent.
to_chat(src, "<span class='danger'>Eggs can only be laid while standing on a floor.</span>")
return
if(fed < feedings_to_lay)
// We have to check this again after the popup, to account for people spam-clicking the button, then doing all the popups at once.
to_chat(src, "<span class='warning'>You must wrap more humanoid prey before you can do this!</span>")
@@ -72,6 +72,9 @@
if(regen_points < jelly_cost)
to_chat(src, "<span class='danger'>You only have [regen_points] of the [jelly_cost] regeneration points you need to do this.</span>")
return
if(!isturf(loc))
to_chat(src, "<span class='danger'>You can only secrete jelly while standing on a floor.</span>")
return
var/turf/mylocation = get_turf(src)
if(isspaceturf(mylocation))
to_chat(src, "<span class='danger'>Cannot secrete jelly in space.</span>")
@@ -279,6 +279,9 @@
if(eggtype == null || numlings == null)
to_chat(src, "<span class='danger'>Cancelled.</span>")
return
if(!isturf(loc))
to_chat(src, "<span class='danger'>Eggs can only be laid while standing on a floor.</span>")
return
// Actually lay the eggs.
if(canlay < numlings)
// We have to check this again after the popups, to account for people spam-clicking the button, then doing all the popups at once.