diff --git a/code/datums/helper_datums/teleport_vr.dm b/code/datums/helper_datums/teleport_vr.dm index 4075bc70f0..b3054a44c0 100644 --- a/code/datums/helper_datums/teleport_vr.dm +++ b/code/datums/helper_datums/teleport_vr.dm @@ -1,3 +1,11 @@ +//wrapper +/proc/do_noeffect_teleport(ateleatom, adestination, aprecision=0, afteleport=1, aeffectin=null, aeffectout=null, asoundin=null, asoundout=null, local=TRUE) + new /datum/teleport/instant/science/noeffect(arglist(args)) + return + +/datum/teleport/instant/science/noeffect/setEffects(datum/effect/effect/system/aeffectin,datum/effect/effect/system/aeffectout) + return 1 + /datum/teleport/proc/try_televore() //Destination is in a belly if(isbelly(destination.loc)) diff --git a/code/modules/multiz/structures_vr.dm b/code/modules/multiz/structures_vr.dm new file mode 100644 index 0000000000..7307b7ad30 --- /dev/null +++ b/code/modules/multiz/structures_vr.dm @@ -0,0 +1,57 @@ +/obj/structure/portal_subtle + name = "portal" + desc = "Looks unstable. Best to test it with the clown." + icon = 'icons/obj/stationobjs.dmi' + icon_state = "portal" + density = 1 + unacidable = 1//Can't destroy energy portals. + var/failchance = 0 + anchored = 1 + var/obj/structure/portal/target + +/obj/structure/portal/Destroy() + if(target) + target.target = null + target = null + return ..() + +/obj/structure/portal/Bumped(mob/M as mob|obj) + if(istype(M,/mob) && !(istype(M,/mob/living))) + return //do not send ghosts, zshadows, ai eyes, etc + spawn(0) + src.teleport(M) + return + return + +/obj/structure/portal/Crossed(AM as mob|obj) + if(istype(AM,/mob) && !(istype(AM,/mob/living))) + return //do not send ghosts, zshadows, ai eyes, etc + spawn(0) + src.teleport(AM) + return + return + +/obj/structure/portal/attack_hand(mob/user as mob) + if(istype(user) && !(istype(user,/mob/living))) + return //do not send ghosts, zshadows, ai eyes, etc + spawn(0) + src.teleport(user) + return + return + +/obj/structure/portal/proc/teleport(atom/movable/M as mob|obj) + if(istype(M, /obj/effect)) //sparks don't teleport + return + if (M.anchored&&istype(M, /obj/mecha)) + return + if (icon_state == "portal1") + return + if (!( target )) + qdel(src) + return + if (istype(M, /atom/movable)) + if(prob(failchance)) //oh dear a problem, put em in deep space + src.icon_state = "portal1" + do_noeffect_teleport(M, locate(rand(5, world.maxx - 5), rand(5, world.maxy -5), 3), 0) + else + do_noeffect_teleport(M, target, 0) ///You will appear adjacent to the beacon diff --git a/vorestation.dme b/vorestation.dme index 6277b52989..55e977b92c 100644 --- a/vorestation.dme +++ b/vorestation.dme @@ -2457,6 +2457,7 @@ #include "code\modules\multiz\open_space_controller.dm" #include "code\modules\multiz\pipes.dm" #include "code\modules\multiz\structures.dm" +#include "code\modules\multiz\structures_vr.dm" #include "code\modules\multiz\turf.dm" #include "code\modules\multiz\zshadow.dm" #include "code\modules\nano\nanoexternal.dm"