ID:912393
 
(See the best response by NNAAAAHH.)
Essentially, I'm trying to make a technique that will create a 5x3 tile area in front of the user that will not only cage anyone in the area, but also drain their energy.

I also want the cage to be destructible, I thought i could do this by setting up the outside wall as a 'wall' object, then overlap the entire area with a 'roof' object that will stop outsiders peering in.

I started doing this, and then decided there must be an easier way of doing it, here is where I got too:

                        usr.CoolDowns+=src.CD
var/x
var/y
switch(usr.dir)
if(NORTH)
for(x=-2,x<3, x++)
for(y=1,y<3,y++)
if(y!=2)
var/obj/Technique/Ultimate/Wall/K = new()
K.loc=locate(usr.x+x,usr.y+y,usr.z)
else
if(x==-2||x==3)
var/obj/Technique/Ultimate/Wall/K = new()
K.loc=locate(usr.x+x,usr.y+y,usr.z)
for(x=-1, x<2, x++)
for(y=-1, y<2, y++)
var/obj/Technique/Ultimate/Roof/D = new()
D.loc = locate(usr.x+x,usr.y+y,usr.z)
Bump?
Best response
obj/Cage
var/hp=100
proc/Damage(N as num)
if(N>hp) M=hp
hp-=N
if(!hp) del(obj)
New()
spawn(600) del src
while(src)
for(var/mob/m in oview(src,0))
m.Damage(5)
sleep(10)//this'll run once per second, dealing 5 damage per second until 1 minute has passed.

You could use this with Exit() to determain where a person is so to prevent them from moving. Making a Damage proc for mobs is logical to do, adding a secondary input for the proc is also logical. A third aswell.

You can add illusionary effects with the cage, spawning additional parts with pixel_x and pixel_y offsets. Or you could just make one big cage.

Of course you'd have to rewrite this code to your liking, and it clearly needs to be redone anyway, not being the best it could be.
Thanks a lot!