MV Legend of Dragoon Item Attack

I want to approach like Legend of Dragoon game where the damage dealt higher when button hit a lot



My closest approach is something like this
1766577144049.png

1766576995900.png


The main idea is to use if statement and increase variable value (Assume variable no. 5) for each time button is pressed (For instance spamming ok button), and then use it on damage formula (Like (a.atk - b.def) * v[5])

But this cause a heavy load(?) that cause lag and crash due to loop (Edit: This maybe because I open the console as well)
1766577326761.png


Any better approach when using common event?
I wont recomment "Input.isPressed" but Input.isTriggered("button")
as this must be released.

as pressed can fire constantly so it can deal extremely high dmg when
held down (which you want to avoid).

but you can increase a variable = 0 than loop and +1.
than dmg * variable value or + variable value whatever you try to achieve.

if * value, you may need * 100/value number for a % or by every x triggered,
add a specific value, but I don't know the game though.

you may want an interval as well (my HTML UnifiedFusionBridge) can help you
to break the loop faster if its outside the interval (but that is totally up to you).
I wont recomment "Input.isPressed" but Input.isTriggered("button")
as this must be released.
I was looking this word (Triggered) since I forgot the correct one for my issue

but you can increase a variable = 0 than loop and +1.
than dmg * variable value or + variable value whatever you try to achieve.

if * value, you may need * 100/value number for a % or by every x triggered,
add a specific value, but I don't know the game though.
Yes! This is actually what I want in the first place
The damage formula will be damage * variable with variable in percentage. For instance, value is 200, which means 200/100 = 2x damage than before. Same as Legend of Dragoon approach but that game limited to around 186%, also per button hit increase by 2% in that game

you may want an interval as well (my HTML UnifiedFusionBridge) can help you
to break the loop faster if its outside the interval (but that is totally up to you).
I think i don't need it for now. I rework a bit about the content and it should be like this
1766582944718.png


Which is work as intended like what I want (I spam the enter button)
1766583014468.png


I will adjust it later to make it balance damage

The issue before is I'm using isPressed and without wait for frame which is causing game break and doesn't work as intended

Thanks for assistance and enlightenment @ShadowDragon ! My issue has been solved

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/legend-of-dragoon-item-attack.181596/