mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-01-25 08:34:23 +00:00
Fixes issue #2236. Removed some spawn() calls. Removed the chance of fail from the portal effects (the blue portals made with hand teleporters). The portal datums will now return 0 if the teleport failed, and now use a new proc, start(), instead of New() to handle themselves. Standarized teleport.dm from the helper_datums folder. Removed the checks for centcomm z level and away missions z level for teleports. Now you can go there. changed the /red messages from the teleports datum to span classes. The "[something] bounces off of the portal!" were replaced for "The portal rejects [something]". Removed an extra "the" on those messages.
50 lines
1.2 KiB
Plaintext
50 lines
1.2 KiB
Plaintext
/obj/effect/portal
|
|
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/obj/item/target = null
|
|
var/creator = null
|
|
anchored = 1.0
|
|
|
|
/obj/effect/portal/Bumped(mob/M as mob|obj)
|
|
src.teleport(M)
|
|
|
|
/obj/effect/portal/Crossed(AM as mob|obj)
|
|
src.teleport(AM)
|
|
|
|
/obj/effect/portal/New(loc, turf/target, creator, lifespan=300)
|
|
portals += src
|
|
src.loc = loc
|
|
src.target = target
|
|
src.creator = creator
|
|
for(var/mob/M in src.loc)
|
|
src.teleport(M)
|
|
if(lifespan > 0)
|
|
spawn(lifespan)
|
|
qdel(src)
|
|
return
|
|
|
|
/obj/effect/portal/Destroy()
|
|
portals -= src
|
|
if(istype(creator, /obj/item/weapon/hand_tele))
|
|
var/obj/item/weapon/hand_tele/O = creator
|
|
O.active_portals--
|
|
return ..()
|
|
|
|
/obj/effect/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))
|
|
do_teleport(M, target, 1) ///You will appear adjacent to the beacon
|
|
|