Increased Consecutive-Damage Skills

Broken_squirrel

Veteran
Veteran
Joined
Nov 14, 2016
Messages
36
Reaction score
1
First Language
English
Primarily Uses
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.
 

Heirukichi

Veteran
Veteran
Joined
Sep 24, 2015
Messages
1,421
Reaction score
596
First Language
Italian
Primarily Uses
RMVXA
I 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:

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





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.
 
Last edited by a moderator:

Broken_squirrel

Veteran
Veteran
Joined
Nov 14, 2016
Messages
36
Reaction score
1
First Language
English
Primarily Uses
I'm trying this out now, thank you for the quick reply!
 

Heirukichi

Veteran
Veteran
Joined
Sep 24, 2015
Messages
1,421
Reaction score
596
First Language
Italian
Primarily Uses
RMVXA
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.
 

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

Latest Threads

Latest Profile Posts

People3_5 and People3_8 added!

so hopefully tomorrow i get to go home from the hospital i've been here for 5 days already and it's driving me mad. I miss my family like crazy but at least I get to use my own toiletries and my own clothes. My mom is coming to visit soon i can't wait to see her cause i miss her the most. :kaojoy:
Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.

Forum statistics

Threads
105,868
Messages
1,017,081
Members
137,582
Latest member
Spartacraft
Top