ID:268581
 
            Equip()
set category = null
if(usr.Righthand == null)
if(usr.Pwr >= src.PwrReq)
if(usr.Dex >= src.DexReq)
if(usr.Lvl >= LvlReq)
usr.Righthand = src
usr << "You equip the [usr.Righthand]!"
src.suffix += "Equiped"
usr.Str += src.PwrUp
usr.Spd += src.DexUp
usr.Str -= src.PwrDwn
usr.Spd -= src.DexDwn
else
usr << "Your level is too low to equip [src]!"
else
usr << "You are not powerful enough to equip [src]!"
else
usr << "You are not powerful enough to equip [src]!"
else
usr << "You already have a [usr.Righthand] equiped!"

That, is my equip system...
        Gold_Cane
icon = 'Weapons.dmi'
icon_state = "goldcane"
desc = "I wonder what kind of person this cane was made for..."
PwrUp = 5
DexDwn = 3
MaxDurability = 20
Durability = 20
PwrReq = 3
DexReq = 1
LvlReq = 1

That's my object.

The Mob's stats surpass the Requirements, yet, it won't let me equip them... =/
Help will be appreciated...
_> Credit of a section of the Equip System goes to Dragon Lord(Unknown Person)...
Where is equip being called?
I don't see your bug, but I have some strong recommendations to make for this system. Although you'll note below, I found that one of your "you can't do that" messages was a duplicate, which might be obscuring the problem for you.

  • You're best off ditching the system of adding to and subtracting from strength and power vars. Just add your weapon's boosts on whenever you need them, perhaps via a proc. By adding and subtracting each time you change equipment, you risk one of these vars changing permanently during a bug.
  • Instead of a bunch of nested ifs, try simply bailing out when conditions aren't met. This results in much cleaner code.
if(usr.Pwr < PwrReq)
usr << "You are not powerful enough to equip [src]!"
return
if(usr.Dex < src.DexReq)
// the message that goes with the usr.Dex test in your code is actually
// a copy of the usr.Pwr message; I changed it here
usr << "You are not dextrous enough to equip [src]!"
return
...


  • Instead of telling the player they already have something else equipped, it's better to simply unequip it automatically so changing weapons can be done on the fly. I'd do the power/dexterity/level tests first, based on what those stats would be without the current weapon if any, and then unequip if necessary.

    Lummox JR
In response to Lummox JR
Thanks Lummox.
And, Death, they're all under one branch, like...
obj
weapon
verb
Equip()

And so on.
In response to Hell Ramen
Is it still not working?