RPG Starter

by Falacy
An Open Source Demo/Game with everything you'll need to get started on your very own BYOND Game!
ID:292244
 
Code:
magik_shield()
if("magik shield" in src.ToggledSkills)
src.ToggledSkills-="magik shield"
src.CanMove=1
for(var/obj/SkillSups/BMShield/P in src.Cache) {src.overlays-=P;del P}
else
src.ToggledSkills+="magik shield"
var/obj/SkillSups/BMShield/P=new()
//src.dir=get_dir(EAST,src)
if(src.dir==get_dir(EAST,usr))
P.pixel_x+=32
src.CanMove=0
if(src.dir=="West")
P.pixel_x-=32
src.CanMove=0
if(src.dir=="North")
P.pixel_y+=32
src.CanMove=0
if(src.dir=="South")
P.pixel_y+=32
src.CanMove=0
P.icon_state="magik shield";src.Cache+=P;src.overlays+=P


Problem description:
Well, i cant seem to get the shield to spawn 32 pixels ahead of the user's direction, nor can i get it to read the direction of the object, it seems to only work AND lock movement when poitned south, but wont work again taking off the shield and freeing movement when used again. Any help fal?
"Direction" won't work. You can either use DIRECTION, in all caps with no quotes, or the numerical bit flag 1-10.
In response to Falacy
Falacy wrote:
"Direction" won't work. You can either use DIRECTION, in all caps with no quotes, or the numerical bit flag 1-10.

sooo

if(src.dir==EAST)

should work?

EDIT: K it worked, but the src.CanMove=1 wont... it allows him to use it and stop him from moving, but then he cant not use it.