Sword
icon='sword.dmi'
icon_state="sword"
str=40
firerate=3.5
layer=MOB_LAYER-1
Click()
if(usr.incar==0)
if(src in usr)
if(usr.weapon==null)
if (usr.meleeweapon<10) usr<<"You arn't skilled enough in Melee Weapons. (Level 10 Required)"
else
src.suffix="Equipped"
usr.overlays+='sword.dmi'
usr.icon_state="weapon2"
view()<<sound('sword_on.wav',0,0,0)
usr.weapon=src
usr<<"<font color=gray>You wield the <font color=gray>Sword<font color=gray> like a Jedi!"
layer=MOB_LAYER+10
return
if(usr.weapon==src)
src.suffix=null
usr.icon_state=""
usr.overlays-='sword.dmi'
view()<<sound('sword_off.wav',0,0,0)
usr.weapon=null
usr<<"<font color=gray>You unwield the <font color=gray>Sword<font color=gray> in style."
layer=MOB_LAYER-1
return
So, im thinking it needs to be added when the item is spawned. My code for that looks something like this:
new/obj/pickup/Sword(M.loc)
view()<<"<B><font color=white>A </font><font color=grey>Sword</font> <font color=white>bounces to the ground!</font></b>"
This is also the code for equipping the item:
Sword
icon='sword.dmi'
icon_state="sword"
str=40
firerate=3.5
layer=MOB_LAYER-1
Click()
if(usr.incar==0)
if(src in usr)
if(usr.weapon==null)
if (usr.meleeweapon<10) usr<<"You arn't skilled enough in Melee Weapons. (Level 10 Required)"
else
src.suffix="Equipped"
usr.overlays+='sword.dmi'
usr.icon_state="weapon2"
view()<<sound('sword_on.wav',0,0,0)
usr.weapon=src
usr<<"<font color=gray>You wield the <font color=gray>Sword<font color=gray> like a Master!"
layer=MOB_LAYER+10
return
if(usr.weapon==src)
src.suffix=null
usr.icon_state=""
usr.overlays-='sword.dmi'
view()<<sound('sword_off.wav',0,0,0)
usr.weapon=null
usr<<"<font color=gray>You unwield the <font color=gray>Sword<font color=gray> in style."
layer=MOB_LAYER-1
return