verb/EquipUnequip()
if (src.Equiped == 0)
if (src.weapon == 1)
if (usr.weapon == "")
src.Equiped = 1
src.layer = 8
usr.overlays += src
usr.weapon = "[src]"
usr.attack += src.attack
usr << "You equip the [src]."
src.suffix="Equiped" // It's called suffix
else
usr << "You have a weapon equiped! Unequip your [usr.weapon]."
else
if (src.shield == 1)
if (usr.shield == "")
src.Equiped = 1
src.layer = 7
usr.overlays += src
usr.shield = "[src]"
usr.defence += src.defence
usr << "You equip the [src]."
src.suffix="Equiped" // It's called suffix
else
usr << "You have a shield equiped! Unequip your [usr.shield]."
else
if (Equipable == 1)
src.Equiped = 1
src.layer = 6
usr.overlays += src
usr << "You equip the [src]."
src.suffix="Equiped" // It's called suffix
else
usr << "You can't equip this."
else
if (src.weapon == 1)
if (usr.weapon == "[src]")
src.Equiped = 0
src.suffix="" // It's called suffix
usr.overlays -= src
usr.weapon = ""
usr << "You unequip the [src]."
else
if (src.shield == 1)
if (usr.shield == "[src]")
src.Equiped = 0
src.suffix="" // It's called suffix
usr.overlays -= src
usr.shield = ""
usr << "You unequip the [src]."
else
src.Equiped = 0
src.suffix="" // It's called suffix
usr.overlays -= src
usr << "You unequip the [src]."
Problem description: The code worked fine when I didn't add the Suffixs - The Overlay doesn't disappear if I unequip that item. Don't say this code don't work, as this is a code from a previous game of mine, but just adding those damn Suffixs.
I don't might if you shorten it. I just want the Overlay thing sorted.
In Unequiping, I placed the Suffix there as I thought they where causing the problem. (I thought they registered the same item different because of it)
This is techinically plug and play. Instead of 'usr.overlays+=src', you now add 'usr.update(src)'.