ID:146110
 
Code:
obj/item
armor
icon = 'armor.dmi'
var
def
overlayiconstate
Use()
var/mob/User=src.loc
if(User)
if(ismob(User))
if((src in User.equipped))
src.suffix=""
User.overlays-=src.overlayiconstate
User.Armor = 0
User.equipped.Remove(src,null)
else
if(!User.Armor)
src.suffix="<Armor>"
User.overlays+=src.overlayiconstate
User.Armor = src.def
User.equipped.Add(src)
ChainMail
icon_state = "chain"
def = 15
overlayiconstate = "chaino"


Problem description:

I have been trying to get overlays to work with no success. I have experimented with many demos and got them to work, but I would like to use a system in which the overlay could be defined as an icon_state other than the actual objects icon_state. Also be able to use it with the generic Use() Armor proc.