Files
CHOMPStation2/code/game/objects/effects/portals.dm
johnsonmt88@gmail.com 867b21c7ce File restructuring!
This brings down a bunch of defines from /code/defines/obj.dm unto their appropriate files.

I've moved morgue.dm from game/machinery into game/objects/structures since that file contains no machines.

I've reorganized the objects/items/stacks folder and made a 'sheets' and 'tiles' folder to keep things separate

I've separated stool_chair_bed.dm into its own folder which now contains the files: stools.dm, chairs.dm, bed.dm and alien_nests.dm to make it a little easier to go through.

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@4582 316c924e-a436-60f5-8080-3fe189b3f50e
2012-08-29 18:00:30 +00:00

48 lines
1.1 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/failchance = 5
var/obj/item/target = null
var/creator = null
anchored = 1.0
/obj/effect/portal/Bumped(mob/M as mob|obj)
spawn(0)
src.teleport(M)
return
return
/obj/effect/portal/HasEntered(AM as mob|obj)
spawn(0)
src.teleport(AM)
return
return
/obj/effect/portal/New()
spawn(300)
del(src)
return
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 ))
del(src)
return
if (istype(M, /atom/movable))
if(prob(failchance)) //oh dear a problem, put em in deep space
src.icon_state = "portal1"
do_teleport(M, locate(rand(5, world.maxx - 5), rand(5, world.maxy -5), 3), 0)
else
do_teleport(M, target, 1) ///You will appear adjacent to the beacon