In the game I'm developing, I had a problem where when equipping an item and then unequipping it, the system simply continues with the item's status, and if you equip it again it adds to the current status.
To make it easier to understand, it goes something like this:
let's say my current stats are 1 atk, and now I equipped a knife (which increases my atk by 2) and my stats are 3 atk.
When removing this knife from my hand, the game shows that I still have 3 attack but when equipping it again it shows that I have 5 atk, and by doing this without stopping, I can reach numbers of four spaces (which for a game where enemies have 100 hp is a lot!).
But I tested this in two different games, mine and my brother's (who is 7 years old).
What I just said happened on mine, but on his it worked, removing the statuses when unequipping the weapon.
I don't know if this is a problem with the data or the system (or if my brother is more intelligent than me
._.) but I'm asking for help from someone who already had the same "defect" and managed to fix it.
I was originally as confused as you, below the line you can see my original reply I've left it in for reference.
After some playing around I found out that any stat that appears on the hero or class is lowered when un-equipping, but stats that don't appear there are not lowered, look:
My class adventurer has Ph.Atk hard-coded to stay 0:
My Warrior does not have them set, so they effectively start at 0 but there's a caveat I'll get to in a bit:
Now, when Adventurers un-equip their sword their stats get set back to 0 quite nicely:
Warriors on the other hand do not get it lowered back, because they don't actually have a base value set!
So if there is a stat that needs to stay 0 without equipment, hard-code them to 0 in the editor!
I second this, I've run into this as well recently; some equipment's effects are not removed on un-equip but they are applied again and stacked on re-equip. In my project it only seems to affect stats that would otherwise drop to 0 on un-equip:
1. Un-equipping this sword does not lower any stats (I expected it would lower Ph.Atk by -2)
2. Re-equipping the sword does raise Ph.Atk by 2... Again. (I expected it would be 0 without sword, 2 with sword; but instead it got raised by 2 permanently on each equip)
I can repeat these steps infinitely for infinite Ph.Atk; it never lowers on un-equip!
3. Replacing one weapon with another always works fine for some reason (the dagger gives +1 Ph.Atk & +1 Prc while the Sword gives +2 Ph.Atk only; this is completely according to expectations!)
4. Even if I do this the other way around it works fine! I can repeat these two steps infinitely, it will never behave out of line!
Are you ready for this to get real spicy? Read on:
5. Un-equipping the dagger does lower Prc by 1, that's good! It does not lower Ph.Atk by 1, that's a bug! It seems this only works as expected on stats that would not be 0 without equipment?
6. Re-equipping the dagger does raise both Ph.Atk and Prc each by 1, meaning that Prc works as expected but Ph.Atk gets raised into infinity! (it should lower both stats by 1 on un-equip in the first place, even Ph.Atk)