How would I create a skill that dealt more damage as it was used consecutively up to a maximum. If there was a stop in use, the damage would return to it's initial amount.
Increased Consecutive-Damage Skills
RPG Maker MV SupportI would do that increasing a variable value in the formula.
Example: I have a skill and I want that skill to deal X basic damage + Y for every consecutive use.
My skill formula will then be X + (Y * variable) where variable is your variable. This covers only the damage part. Now we hve to tell the game that this skill has been used and to increase the variable in the damage formula to empower our next attack.
1st option: let your skill call a common event and let that event increase your variable by 1 and turn on a switch (let's say SKILL_USED_SWITCH).
2nd option: the same but instead of using a common event you put it in the damage formula.
Important: if your attack misses your skill formula won't be evaluated!
Keep this in mind and manage your switch and variable in the correct place according to your needs (common event if you want your variable to increase even if the skill misses, formula if you want it to reset when the skill misses).
This is how you manage your variable and your skill in the formula:
This tells your game that the skill has been used and calculates damage using your variable, but you will still have a problem. Once you use your skill your switch will be activated and so it tells the game that you used your skill even if you don't!
To avoid this you have to set up troops events. The best way is probably to put an event at the end of each turn that checks if the switch is on. If the switch is off it sets your variable to 0.
EDIT (I decided to add this part to correct a previous mistake):
But this way you can carry your rampage between different battles. To avoid this add another troop event that sets your variable to 0 and turns off your switch at the beginning of each battle.
Now you have your rampaging skill.
Of course the same event that increases your variable can check if that variable reached the maximum ammount you want. In case it has the event won't increase it.
Example: I have a skill and I want that skill to deal X basic damage + Y for every consecutive use.
My skill formula will then be X + (Y * variable) where variable is your variable. This covers only the damage part. Now we hve to tell the game that this skill has been used and to increase the variable in the damage formula to empower our next attack.
1st option: let your skill call a common event and let that event increase your variable by 1 and turn on a switch (let's say SKILL_USED_SWITCH).
2nd option: the same but instead of using a common event you put it in the damage formula.
Important: if your attack misses your skill formula won't be evaluated!
Keep this in mind and manage your switch and variable in the correct place according to your needs (common event if you want your variable to increase even if the skill misses, formula if you want it to reset when the skill misses).
This is how you manage your variable and your skill in the formula:
$gameSwitches.setValue(num, true/false); $gameVariables.setValue(var, value); real_formula_here
This tells your game that the skill has been used and calculates damage using your variable, but you will still have a problem. Once you use your skill your switch will be activated and so it tells the game that you used your skill even if you don't!
To avoid this you have to set up troops events. The best way is probably to put an event at the end of each turn that checks if the switch is on. If the switch is off it sets your variable to 0.
EDIT (I decided to add this part to correct a previous mistake):
You can even use the event to increase your variable instead of doing it in your skill formula. If you want to do that you should use this formula:
$gameSwitches.setValue(num, true/false); real_formula_here
Then increase your variable in the event if the switch is on. The event has to reset the variable when the switch is off anyway. That doesn't change.
$gameSwitches.setValue(num, true/false); real_formula_here
Then increase your variable in the event if the switch is on. The event has to reset the variable when the switch is off anyway. That doesn't change.
But this way you can carry your rampage between different battles. To avoid this add another troop event that sets your variable to 0 and turns off your switch at the beginning of each battle.
Now you have your rampaging skill.
Of course the same event that increases your variable can check if that variable reached the maximum ammount you want. In case it has the event won't increase it.
I'm trying this out now, thank you for the quick reply!
I just noticed that I increased your variable value twice. If you are going to use that formula don't increase the variable in your troop event OR don't increase your variable in the formula. I'll edit the post to add this info as well.
Original thread: https://forums.rpgmakerweb.com/threads/increased-consecutive-damage-skills.71281/