Hello! I need help of making 2 skills:
- Skill 1: gets stronger when the user has 2 or more buffs.
- Skill 2: gets stronger when the target has 2 or more buffs.
I know I need to use variables on my buffs, but I just could not figure how to make it work..
Thanks for your time!
I'm still hoping for someone to help me with this.
Would it help if replacing a state instead a buff?
If I had to guess, some plugin you're using is changing how buffs are handled. By default, the _buffs array contains a series of integers that correspond to each stat (hp, mp, atk, def, etc). Any value of 0 means no change, any negative value means x number of debuff stacks, while a positive number (what the reduce function is tallying) means x number of buff stacks. It's possible some plugin is storing buff data as something other than an integer, in which case it'd result in NaN (not a number) which falls back on 1. (That's what the || 1 part means)
Besides yanfly's buffs/states plugin, are you using anything else that changes how buffs work?
In the game where it doesn't work, load a saved game, go to the dev console, and type
$gameParty.members()[0]._buffs
The result should look something like this:
> (8) [0, 0, 0, 0, 0, 0, 0, 0]
Now, type
$gameParty.members()[0].addBuff(2, 10)
Then finally, a second time:
$gameParty.members()[0]._buffs
And now, it should look like this:
> (8) [0, 0, 1, 0, 0, 0, 0, 0]
If it isn't, post a screenshot of what shows up.