Merge pull request #3499 from Yoshax/iamsolazy

Lazyports artifact containers from Bay
This commit is contained in:
Anewbe
2017-06-07 16:27:51 -05:00
committed by GitHub
4 changed files with 54 additions and 0 deletions
+10
View File
@@ -5,6 +5,16 @@
recieving object instead, so that's the default action. This allows you to drag
almost anything into a trash can.
*/
/atom/proc/CanMouseDrop(atom/over, var/mob/user = usr)
if(!user || !over)
return FALSE
if(user.incapacitated())
return FALSE
if(!src.Adjacent(user) || !over.Adjacent(user))
return FALSE // should stop you from dragging through windows
return TRUE
/atom/MouseDrop(atom/over)
if(!usr || !over) return
if(!Adjacent(usr) || !over.Adjacent(usr)) return // should stop you from dragging through windows
@@ -0,0 +1,43 @@
/obj/structure/anomaly_container
name = "anomaly container"
desc = "Used to safely contain and move anomalies."
icon = 'icons/obj/xenoarchaeology.dmi'
icon_state = "anomaly_container"
density = 1
var/obj/machinery/artifact/contained
/obj/structure/anomaly_container/initialize()
..()
var/obj/machinery/artifact/A = locate() in loc
if(A)
contain(A)
/obj/structure/anomaly_container/attack_hand(var/mob/user)
release()
/obj/structure/anomaly_container/attack_robot(var/mob/user)
if(Adjacent(user))
release()
/obj/structure/anomaly_container/proc/contain(var/obj/machinery/artifact/artifact)
if(contained)
return
contained = artifact
artifact.forceMove(src)
underlays += image(artifact)
desc = "Used to safely contain and move anomalies. \The [contained] is kept inside."
/obj/structure/anomaly_container/proc/release()
if(!contained)
return
contained.dropInto(src)
contained = null
underlays.Cut()
desc = initial(desc)
/obj/machinery/artifact/MouseDrop(var/obj/structure/anomaly_container/over_object)
if(istype(over_object) && Adjacent(over_object) && CanMouseDrop(over_object, usr))
Bumped(usr)
over_object.contain(src)
Binary file not shown.

Before

Width:  |  Height:  |  Size: 62 KiB

After

Width:  |  Height:  |  Size: 63 KiB

+1
View File
@@ -2129,6 +2129,7 @@
#include "code\modules\virus2\helpers.dm"
#include "code\modules\virus2\isolator.dm"
#include "code\modules\virus2\items_devices.dm"
#include "code\modules\xenoarcheaology\anomaly_container.dm"
#include "code\modules\xenoarcheaology\boulder.dm"
#include "code\modules\xenoarcheaology\effect.dm"
#include "code\modules\xenoarcheaology\manuals.dm"