ID:146620
 
Code:
            SpiritShield()
set name = "Spirit Shield"
set category = "Spirit Moves"
if(spiritshield == 1)
view(src) << "[src]'s Spirit Shield de-energized!"
usr.SA -= 5
usr.Defense -= 5
sleep(1)
spiritshield = 0
usr.overlays -= new/obj/Shield
return()
if(spiritshield == 0)
if(SE >= 1)
view(src) << "[src]: Spirit Shield!"
var/obj/Shield/S = new
src.overlays += S
src.sa += 1
Level()
spiritshield = 1
usr.SA += 5
usr.Defense += 5
usr.SE -= 3
sleep(10)
drain()
else
usr << "You dont have enough Spirit Energy!"
return()


Problem description:
Overlays go under you <_< which makes it look really stupid
When you use an object (or any atom, I believe) as an overlay, rather than an image, it will use the layer of that object rather than the "overlay layer". You can remedy this by setting the object's layer to FLOAT_LAYER before adding it as an overlay. The reference is quite explicit on all of this in the entry for overlays.
In response to DerDragon
heh thanks <_<..it works =P
Incidentally, you don't need brackets after return.

Don't use checks like if(spiritshield==1) and if(spiritshield==0). It's far more robust to just stick in if(spiritshield) and if(!spiritshield). Quicker, too.

Why do you use usr in one bit of the verb and src in another? Standardise it, it makes more sense. I'd suggest using src the whole way through, because it allows you to turn their spiritshield on or off from other procedures safely.

why do you have a variable sa and a variable SA? The distinction is important. If they are seperate variables, it's probably not a good idea to call them the same thing with different capitalisation. If they're the same variable, case matters with respect to BYOND stuff.
Or, Try making the Shields layer = MOB_LAYER + 1