I'm trying to create an alternate Basic Attack for a weapon type where each use of the skill adds a stack of Combo, which increases the user's physical damage by 10% for each stack, but gets reset when the user doesn't use the basic attack.
Preferably I'd want the states to be added after the skill is finished, as the attack has multiple hits. Putting the addState function in the damage formula would add too many stacks at once.
There's really no reason to put addState in the damage formula – adding it as an effect will be exactly the same. Pretty sure that's still once per hit rather than once per attack, though.
Without plugins, probably the only way to do something once per attack when the attack has multiple hits is with a common event… and since it needs to reference the last target, it's only possible without plugins in MZ. For MV you'd need at minimum a plugin that lets you refer to the last target in a common event.
Sorry, I haven't used this in a while so I haven't updated it. I am using MZ.
I do have a handful of VisuStella's plugins for a few other attacks, and I've looked through all the custom functions but either haven't understood it properly or haven't found what I'm looking for.
I'll go through how I want the State/Attack to function:
Basic Attack is Used -> Attack Hits, All Hits Connect -> Gain a stack of Combo
Player has 7 stacks of Combo, +10% ATK per Stack
Player Guards -> Clears all stacks of Combo
Okay, so the initial applying of Combo and clearing of Combo work, but it doesn't seem to be giving me any extra damage. Looking over the code, I think it's because the state only ever applies once since the skill can only ever exist once (to my knowledge).
Lack of a visual indicator also doesn't really help, but I would have no idea on where to even start on that.
Okay, I've been messing around a bit and I don't think anything in <JS On Add State> function is going off. Not only that, but user.paramBase(x) also doesn't seem to work properly.
I've managed to make the Attack and Combo Stacks work in (mostly) the way that I want it to, though I'm having trouble with how I want it to clear the stacks.
Attacking with the Gauntlets' Basic Attack specifically gives you a stack, and using a skill that isn't the Basic Attack or Swapping Weapons doesn't cause it to clear... but I only want the Gauntlets' Basic Attack to not clear the stacks. If I swap to a different weapon and use its Basic Attack, the stacks don't clear.
I haven't been able to find the script or function to make it work, though I might need to find an additional plugin to make it work the way I want it to.
Basically:
(Assuming Gauntlets are already equipped at the start)
Basic Attack -> +1 Stack of Combo
Swap Weapon to Different Weapon -> Keep Stacks
Attack with Different Weapon/Do literally anything else -> Clear Stacks (after damage)
There's probably a different, more efficient way to work this, but I am going to try making it so that each Non-Gauntlet Basic Attack clears Combo Stacks in the Notetags.