One thing I noticed was that during tests with yanfly's battle core, the "all battlers" skill executed one at a time.
This is because while the target logic was correct, I'm still missing the check for whether it's "for all?" or not.
I'm assuming yanfly uses this to determine how the animation should be processed.
Certainly a random selection from among enemies or allies. All battlers, enemies or allies who meet a specific condition, like possessing a certain status effect or meeting certain parameter thresholds (like having 50 or greater Mat, or having less than half their MaxHp). Also, a single target from among those who meet that specific condition, as well as a random target from among those who meet that condition.
Based on the first suggestion, there is the idea of having a "conditional" scope.
For example, your condition might be
- if the target has a state
- if the target's level that is a multiple of 5
- if the target has less than 50% HP
Those are all conditions that determine whether the action has any effect on the target.
For example, if you think of a "Level 5" skill which does something to anyone with a level that is a multiple of 5 (eg: 5, 10, 15, 20, ... ), there are a couple different ways to describe it.
You could say:
It is a skill that targets everyone whose level is a multiple of 5
Which means your target selection logic will only show the targets that qualify.
This is similar to the "is dead?" scope, which will only allow you to select dead allies.
On the other hand, you could say this:
It is a skill that targets everyone, but only affects those whose level is a multiple of 5
Which is quite different in logic.
This means that "everyone" will show up in the target selection, but during action resolution, only the ones that actually meet that requirement will proceed with the effect.
Being able to weight random scopes would be useful too; for example, a fire-elemental random hit skill that's more likely to hit enemies with a lower resistance to Fire attacks. There could also be a random hit scope that can only target any given enemy once; if an attack with that scope had three targets and there were only two valid targets on the field, the extra would be wasted. A similar scope would be a random target with the most even possible spread: If there are two targets and two enemies, it would target each enemy once. If there were three targets and two enemies, it would target each enemy at least once and a random enemy a second time.
Hmm, I wonder if it would be possible to allow users to define their own "weight" formula, and then the game uses it to determine which targets would be selected randomly.
This would be something interesting to explore, as it would give you an opportunity to learn to turn your requirements into code, without having to code everything.
Another possibility would be an attack with multiple targets that are each chosen like a 1 Enemy skill, such that, say, if I'm fighting a Bat and a Minotaur, I could choose to target the Bat and the Minotaur, or just target the Bat twice. Something like that would require two or more hit confirmations, one for each target.
Potentially with numbers, to show the order that they will be attacked.
If an enemy has been defeated previously, the attacks that were meant for that target will follow the default "smoothing" logic where it picks the next target over.
There was an idea on my
patreon post that said you might choose which weapon to use for each attack.
So if you had a fire sword and ice sword, you would decide which weapon you'll use for each attack as well.
This can be an idea to explore further, once we have the 'numbered' attacks.
I'm not seriously suggesting you implement all of these: This was mostly brainstorming, lol.
All ideas are welcome.