verb/get()//global verb for all object under the /obj/weapons
set src in oview(1)
set category = null
src.Move(usr)//You picked it up
verb/equip()
set src in usr
set category = null
if(!usr.equiped)
usr.Attack+=src.attackadd//The power of the the weapon is now with you
src.verbs+=/obj/weapons/proc/unequip//Now you can unequip the weapon
src.verbs-=/obj/weapons/verb/equip//No longer have the equip verb
src.suffix+="Equiped"//Shows it as equiped
usr.equiped = 1
else
usr << "You already have something equiped!"
proc/unequip()
set src in usr
if(!usr.equiped)//Extra precautions
usr << "You don't have anything equiped!"
else
usr.Attack-=src.attackadd//You can no longer use the power of the weapon
src.verbs-=/obj/weapons/proc/unequip
src.verbs+=/obj/weapons/verb/equip
src.suffix = ""//No longer shows it as equiped
usr.equiped = 0
whan a person saves the game and logs out and logs back in, the weapon they have equiped shows as equiped, but it won't let you un-equip it.
is it in my equip/unequip? or could it be my save?
mob
usr
icon = 'character.dmi'
mob
Login()
alert("the game is still being made. do not ask for gm, or how to play.. clicking OK means Psychotic OwNs you.!")
world << "<b>[src]</b> has logged in."
src.loc = locate(3,3,1)
icon_state = gender
..()
switch(input("What do you want to do?")in list("Make new character", "Continue with old character", "Quit"))
if("Quit")
del(usr)
if("Make new character")
switch(input("Are you sure? If you have an old character, it will be erased.")in list("Yes", "No"))
if("No")
return ..()
if("Yes")
var/savefile/F = new(key)
Write(F)
if("Continue with old character")
switch(input("If you haven't already played on this server you will need to go back and create a new character. ?")in list("Yes", "No"))
if("Yes")
var/savefile/F = new(ckey)
Read(F)
if("No")
return ..()
The first, and most severe, is design. An equipment system should never ever give the items a var that's just 1 for equipped, 0 for unequipped. The reason that's wrong is that it's infinitely more useful to know which item if any is equipped than to know if a particular one is supposed to be. Make a var like mob/var/obj/weapons/weapon, and that will be null by default (no weapon) or set to the weapon itself.
The second problem is that your code isn't correct for the design. You have a var called usr.equiped, for which its spelling is the least of its problems. If this was supposed to be just a yes/no var like it's being used as, then the var should belong to the item, not the mob. (However, I strenuously repeat that you should not make this change. Make the change from the previous paragraph. Here I'm only explaining a reason why the current method is failing; you're implementing the incorrect design with incorrect code. Fix the design and this problem is moot.)
The third problem is that verbs added to mob.verbs don't save. You need to re-add the verbs when the character is finished loading. (The simplest approach is to create an obj proc called AddVerbs() that will add verbs as needed when the character loads, depending on the status of the item. So you could call this for each item in inventory, and it might for example add an unequip verb if the item is in use.)
Additionally, there are a couple of bogus bits to fix:
usr is a var. You really really don't want a type path called /mob/usr. Really. Get rid of that usr line.
return ..()
The only problem with that line (which appears twice) in Login() is that ..() was already called. You should under no circumstances call ..() twice in Login(), and almost never in any other proc either. ..() is really only meant to be called once, since it basically says "Do what this proc does by default." Unless you want the regular Login() called twice, this is bad.
Lummox JR