Create a consumable state.

emelian65

Veteran
Veteran
Joined
Sep 13, 2015
Messages
190
Reaction score
50
First Language
Spanish
Primarily Uses
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.
 

LuLingqi1

A Spellthief With A Bone To Pick
Veteran
Joined
Jun 23, 2016
Messages
175
Reaction score
66
First Language
English
Primarily Uses
N/A
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.
 
Last edited by a moderator:

emelian65

Veteran
Veteran
Joined
Sep 13, 2015
Messages
190
Reaction score
50
First Language
Spanish
Primarily Uses
I just checked it, it seems to be what i was searching for thank you, currently the code looks like this.

<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.
 

LuLingqi1

A Spellthief With A Bone To Pick
Veteran
Joined
Jun 23, 2016
Messages
175
Reaction score
66
First Language
English
Primarily Uses
N/A
 






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>
 

emelian65

Veteran
Veteran
Joined
Sep 13, 2015
Messages
190
Reaction score
50
First Language
Spanish
Primarily Uses
@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.
 

emelian65

Veteran
Veteran
Joined
Sep 13, 2015
Messages
190
Reaction score
50
First Language
Spanish
Primarily Uses
bump,I still don't have an answer
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

Don't forget, aspiring writers: Personality isn't what your characters do, it is WHY they do it.
Hello! I would like to know if there are any pluggings or any way to customize how battles look?
I was thinking that when you start the battle for it to appear the eyes of your characters and opponents sorta like Ace Attorney.
Sadly I don't know how that would be possible so I would be needing help! If you can help me in any way I would really apreciate it!
The biggest debate we need to complete on which is better, Waffles or Pancakes?
rux
How is it going? :D
Day 9 of giveaways! 8 prizes today :D

Forum statistics

Threads
106,048
Messages
1,018,545
Members
137,834
Latest member
EverNoir
Top