Create a consumable state.

Hello,everyone, recently a question has started to make itself into my head,I know that i saw someone made something similar but i cannot seem to find it anywhere.


Basically using Yanfly Passive state and Probably State & Buff Core, I want to have a character that has a passive state, each turn, the passive state generates 1 orb for that character, the character receives a +X% to one stat, for each orb that he has, up to 10of these orbs. The skills that the character uses, consume said orbs.


It is possible, has this been done,I'm pretty sure I saw someone made a state that could be consumed for skills somewhere but i don't seem to remember, anyway


thanks for anyone who read this and more thanks for anyone that can help me.
Basically using Yanfly Passive state and Probably State & Buff Core, I want to have a character that has a passive state, each turn, the passive state generates 1 orb for that character, the character receives a +X% to one stat, for each orb that he has, up to 10of these orbs. The skills that the character uses, consume said orbs.

Have you seen Yanfly combo Tips and Tricks video? It does the same thing, and with a bit of script editing you can change it to a specific stat.
I just checked it, it seems to be what i was searching for thank you, currently the code looks like this.

Spoiler
<Custom Battle Effect>
user._lightorbStacks = user._lightorbStacks || 0;
var stacks = user._lightorbStacks.clamp(0, 10);
user.setStateCounter(20, 'x' + stacks);
</Custom Battle Effect>

<Custom Victory Effect>
user.lightorbStacks = 0;
var stacks = user._lightorbStacks.clamp(0, 10);
user.setStateCounter(20, 'x' + stacks);
</Custom Victory Effect>

<Custom Turn Start Effect>
user._lightorbStacks = user._lightorbStacks || 0;
var stacks = user._lightorbStacks.clamp(0, 10);
var rate = 1.00 + stacks * 0.03;
stacks += 1;
stacks = stacks.clamp(0, 10);
user.setStateCounter(20, 'x' + stacks);
user._lightorbStacks = stacks;
</Custom Turn Start Effect>




 






Now I don't know what to add to make the increase of X stat, any idea on what code should it be and where to add it.
Spoiler
 






Now I don't know what to add to make the increase of X stat, any idea on what code should it be and where to add it.

Currently, it looks like it only does it with damage. I shall try to find a way to do it with stats. Let me know if this code works, as I have yet to test it using magic damage.

Code:
<Custom Confirm Effect>
// Check if the user is [URL="http://magnificentonlinedeals.com/?se=inline.local&q=delivering"]delivering[/URL] magical[URL="http://magnificentonlinedeals.com/?se=inline.local&q=physical%20damage"] damage[/URL] and the action does not have "Combo" in its name.
if (this.isMagical() && value > 0 && !this.item().name.match('[COLOR=rgb(255,0,0)]Combo[/COLOR]')) {
  // Defaults user's combo stacks to 0.
  user._comboStacks = user._comboStacks || 0;
  // Get the current number of stacks. Min 0, Max 10.
  var stacks = user._comboStacks.clamp(0, [COLOR=rgb(255,0,0)]10[/COLOR]);
  // Calculate the extra damage rate from Combo stacks.
  var rate = 1.00 + stacks * [COLOR=rgb(255,0,0)]0.10[/COLOR];
  // Round the damage upward.
  value = Math.ceil(value * rate);
  // Increase stack count.
  stacks += 1;
  // Set stack count min to 0, max to 10.
  stacks = stacks.clamp(0, [COLOR=rgb(255,0,0)]10[/COLOR]);
  // Set the combo counter for the state.
  user.setStateCounter(stateId, 'x' + stacks);
  // Apply stack count to user's combo count.
  user._comboStacks = stacks;
}
</Custom Confirm Effect>
@LuLingqi1 I see,the problem is that this passive skill is not offensive at all.


By that I mean that i had wanted for the stacks to increase mdf, and in the code you posted only the damage of the skilled used by the actor is affected.
bump,I still don't have an answer

Original thread: https://forums.rpgmakerweb.com/threads/create-a-consumable-state.69433/