Crowbars can't open robots when not Adjacent (#8307)

* Crowbars can't open robots when not Adjacent

* Adds some messages to the user when they are too far away.
This commit is contained in:
mikomyazaki
2020-02-19 01:25:47 -03:00
committed by GitHub
parent 5ad6486c5c
commit 4127da9ee1
2 changed files with 12 additions and 0 deletions
@@ -616,6 +616,9 @@
if(cell)
user.visible_message("<span class='notice'>\The [user] begins clasping shut \the [src]'s maintenance hatch.</span>", "<span class='notice'>You begin closing up \the [src].</span>")
if(do_after(user, 50/W.toolspeed, src))
if(!Adjacent(user))
to_chat(user, SPAN_NOTICE("You are too far from \the [src]'s to open its hatch."))
return
to_chat(user, "<span class='notice'>You close \the [src]'s maintenance hatch.</span>")
opened = 0
updateicon()
@@ -667,6 +670,9 @@
else
user.visible_message("<span class='notice'>\The [user] begins prying open \the [src]'s maintenance hatch.</span>", "<span class='notice'>You start opening \the [src]'s maintenance hatch.</span>")
if(do_after(user, 50/W.toolspeed, src))
if(!Adjacent(user))
to_chat(user, SPAN_NOTICE("You are too far from \the [src]'s to close its hatch."))
return
to_chat(user, "<span class='notice'>You open \the [src]'s maintenance hatch.</span>")
opened = 1
updateicon()