Hello! I'm sure this kind of thing has been asked before, but I couldn't find anything.
I want to make a buff system that works by using states rather than parameters. This is because, rather than modifying the parameters, I want to directly affect damage dealt/taken and hit+avoid, same as the buff system in recent Shin Megami Tensei titles.
For those unfamiliar, it's a pretty basic buff system: the buffs/debuffs stack up to two times (so the stages are -2, -1, 0, +1, and +2), and buffs/debuffs stack on eachother (If I gain +1 Attack while having -1 Attack, both cancel eachother out, while if I gain +2 Attack while having -1 Attack, I instead gain +1 Attack. etc...). Buffs/debuffs last 3 turns, and when a buff is updated, the duration of the new stage is reset to 3.
I remember doing this once already using Yanfly's Buff & States Core (as well as States Categories but that's not relevant right now) but then changing my mind about 2 years ago when I last opened up the editor (I know, I know...), but now that it's been a while, I can't for the life of me remember how I did it...
Looking back at my older project, this is what I found in the notetags of my Attack Up State:
I tried using the Custom Apply Effect to write logic for other stages, checking if the Attack Up x1, Attack Down x1, and Attack Down x2 stages were on the user and then adding/removing states accordingly, but I came to the sudden realization that the Custom Apply Effect takes place right after the state is already applied. So for example, if I were to add Attack Up x1 to a battler who has no buffs, it would add Attack Up x1, then notice that the battler indeed has Attack Up x1 already and replace it with Attack Up x2. I'm also having some other issues that no doubt stem from my rustiness and incompetence, but one thing at a time...
I want to make a buff system that works by using states rather than parameters. This is because, rather than modifying the parameters, I want to directly affect damage dealt/taken and hit+avoid, same as the buff system in recent Shin Megami Tensei titles.
For those unfamiliar, it's a pretty basic buff system: the buffs/debuffs stack up to two times (so the stages are -2, -1, 0, +1, and +2), and buffs/debuffs stack on eachother (If I gain +1 Attack while having -1 Attack, both cancel eachother out, while if I gain +2 Attack while having -1 Attack, I instead gain +1 Attack. etc...). Buffs/debuffs last 3 turns, and when a buff is updated, the duration of the new stage is reset to 3.
I remember doing this once already using Yanfly's Buff & States Core (as well as States Categories but that's not relevant right now) but then changing my mind about 2 years ago when I last opened up the editor (I know, I know...), but now that it's been a while, I can't for the life of me remember how I did it...
Looking back at my older project, this is what I found in the notetags of my Attack Up State:
Note: States 20-25 are, respectively, "Attack Up", "Defense Up", "Agility Up", "Attack Down", "Defense Down", "Agility Down". You may notice there is no "second stage" to the buffs/debuffs, which is because in that project I changed my mind and made buffs/debuffs only stack once.
I tried using the Custom Apply Effect to write logic for other stages, checking if the Attack Up x1, Attack Down x1, and Attack Down x2 stages were on the user and then adding/removing states accordingly, but I came to the sudden realization that the Custom Apply Effect takes place right after the state is already applied. So for example, if I were to add Attack Up x1 to a battler who has no buffs, it would add Attack Up x1, then notice that the battler indeed has Attack Up x1 already and replace it with Attack Up x2. I'm also having some other issues that no doubt stem from my rustiness and incompetence, but one thing at a time...