obj/var/equipable = 0
var/occupied = 0
var/weapon_occupied = 0
var/armor_occupied = 0
obj // needs to be tested and ask forum if they can help with making available both types
verb
equip()
set src in usr.contents
if(!equipable)
usr << "You can not equip this item."
return
if(equipable)
usr << "[weapon_occupied]"
while(weapon_occupied)
usr << "You already have something equiped."
return
while(armor_occupied)
usr << "You already have something equiped."
return
if(src.equip_types == "Weapon")
weapon_occupied = 1
occupied = 1
usr.added_on_attack += src.weapon_attack
src.suffix = " Equip"
usr << "You equip [src.name]."
usage = "Equip"
usr << "[weapon_occupied]"
usr << "[armor_occupied]"
if(src.equip_types == "Armor")
armor_occupied = 1
occupied = 1
usr.added_on_defense += src.armor_defense
src.suffix = " Equip"
usr << "You equip [src.name]."
usage = "Equip"
Problem description:Ok, as you can see, I have some debuging code. Now when weapon_occupied = 1, you're not allowed to equip another weapon. But, for some reason, when weapon_occupied is set to 1, so is armor_occupied. This then makes it so I can only equip either a weapon or an armor, when I should be able to equip 1 of each. Why?
What you did was check if something was equipped, and if it was, the whole proc was stopped. This way, it checks the src.type and checks if you have the src.type equipped already.
Thank you, thank you very much.