Skill idea

So uhh each time you use it on a enemy, it deals more damage to said enemy up to x times,
but when you stop using it, the damage resets
How would i be able to code that?
This thread was moved from RPG Maker MV Resources to RPG Maker MV Support.
okay here's an autistic idea-

make 3 variables: DMG_Increase (for damage increases and add it to the skill damage formula however you want) and Combo (for skill usage) and Old_Combo (we are updating this one for checks on continuous usage of the skill), set them all to 0

now, lets assume each usage of the skill adds up 10 damage, and caps out at 30

when you use the skill, it adds 10 to DMG_Increase and 1 to combo, and have an if statement:
If (DMG_Increase > 30) if yes, then DMG_increase = 30

every turn will have an if statement: if (Combo == Old_Combo) if yes, reset all 3 variables to 0, else it would do Combo = Old_Combo

i think that should do the trick!

Edit: changed the name to Old_Combo instead of the other way around cuz it was making weird emojis XDDD
okay here's an autistic idea-
I don't think that's a necessary part of the suggested solution.

You can do this more simply (without using game variables) by putting a property onto the target.

The trick is this:
when you stop using it, the damage resets
What does that mean? How do you define it?

Do you have only one actor in the party, and the counter resets if that actor does anything beside use that skill on that enemy?

Do you have multiple actors, and the counter resets if any of them does anything beside use that skill on that enemy? Or only if that specific actor does something different on their turn?

If you can clarify how that should work, we can tell you how to implement it.
I don't think that's a necessary part of the suggested solution.

apologies, in programming all my peers call my way of programming in c++ autistic, i guess it sounded funnier in my head- sorry again!
I don't think that's a necessary part of the suggested solution.

You can do this more simply (without using game variables) by putting a property onto the target.

The trick is this:

What does that mean? How do you define it?

Do you have only one actor in the party, and the counter resets if that actor does anything beside use that skill on that enemy?

Do you have multiple actors, and the counter resets if any of them does anything beside use that skill on that enemy? Or only if that specific actor does something different on their turn?

If you can clarify how that should work, we can tell you how to implement it.
It's gonna be used by one character only, and if the next action isn't said skill the damage bonus resets
Would it also reset if the actor attacked a different enemy?
Even with the same skill?
It's gonna be used by one character only, and if the next action isn't said skill the damage bonus resets
You'd use Yanfly's Skill Core, Buffs and States Core, and Auto Passive States.

Attach a passive state to the skill (or directly to the actor, whatever).

You never said exactly how the skill should function, just "deal more damage," nor how many times it should stack, so I'll just make up what it does and you can change as necessary.


Code:
<Custom Initiate Effect>
if (user.stackTarget)
{
// Insert your skill's ID where it says X, no leading zeros
    if (target != user.stackTarget || this.isSkill() && this.item().id != X)
    {
        delete user.stackTarget.damStack;
        delete user.stackTarget;
    }
}
// Insert your skill's ID where it says X, no leading zeros
else if (this.isSkill() && this.item().id == X)
   user.stackTarget = target;
</Custom Initiate Effect>

Give the skill the notetag:
Code:
<Pre-Damage Eval>
target.damStack = target.damStack || 0;
target.damStack++;
// do +10% damage per stack
value += value * target.damStack * .1;
</Pre-Damage Eval>
ok thx

Original thread: https://forums.rpgmakerweb.com/threads/skill-idea.171456/