MZ Selection step for skills that randomly hit or hit all enemies

Whenever a skill is used that either randomly hits targets or hits all targets, there is no intermediary step where enemy selection normally goes (for example: single target skills don't confirm skill activation until you select an enemy). All of this makes sense, however I would like to have that intermediary step for the all targets/random targets skills, as odd as that sounds. Is there a plugin or setting I can change in order to have this?
try saving this as a .js file and adding it to your project as a plugin
Code:
Game_Action.prototype.needsSelection = function() {
    return this.checkItemScope([1, 7, 9, 12]) || this.isForRandom() || this.isForAll();
};
i think at that point the only skills that wont need selection are user scope ones
try saving this as a .js file and adding it to your project as a plugin
Code:
Game_Action.prototype.needsSelection = function() {
    return this.checkItemScope([1, 7, 9, 12]) || this.isForRandom() || this.isForAll();
};
i think at that point the only skills that wont need selection are user scope ones
This will work for what I want, thanks.
Though if possible there's one little thing I'd like to add on.
When using this to have the selection screen come up for all targets or random targets, is it possible to have every target highlighted at once instead of only one at a time?

Edit: nevermind, a friend and I managed to figure something out. Thanks for making the base plugin though.
This will work for what I want, thanks.
Though if possible there's one little thing I'd like to add on.
When using this to have the selection screen come up for all targets or random targets, is it possible to have every target highlighted at once instead of only one at a time?

Edit: nevermind, a friend and I managed to figure something out. Thanks for making the base plugin though.

Mind if I ask what you managed to do? I'm hoping to solve this issue as well.
Mind if I ask what you managed to do? I'm hoping to solve this issue as well.
I didn't change anything to the plugin given; instead it was a change made in another plugin my friend and I were working on. Here, I'll send both to you.
Basically I wanted to display hit chance when selecting a target. I needed this plugin to give an intermediary step for selection when using random/all targeted skills.
I didn't change anything to the plugin given; instead it was a change made in another plugin my friend and I were working on. Here, I'll send both to you.
Basically I wanted to display hit chance when selecting a target. I needed this plugin to give an intermediary step for selection when using random/all targeted skills.

Thanks! Unfortunately, it does look confusing when selecting all enemies that only one enemy is visually selected at a time, especially with VisuMZ Battle Cursor.

For now, I'm using a simple Show Choices command, taking advantage of the STB battle system's extra action command so cancelling the action doesn't spend a turn. And that way I can position and change the text with each skill/item's common event.
Thanks! Unfortunately, it does look confusing when selecting all enemies that only one enemy is visually selected at a time, especially with VisuMZ Battle Cursor.

For now, I'm using a simple Show Choices command, taking advantage of the STB battle system's extra action command so cancelling the action doesn't spend a turn. And that way I can position and change the text with each skill/item's common event.
Yeah, I couldn't figure out how to stop it from having the selection cursor present. Might take another shot at fixing that.
Why not take a look at the window that already does that to see how it does it? Using a skill that affects all allies from the map screen requires you to confirm the activation while looking at the actor list. That means Window_MenuActor already covers the logic you need, so then all you need to do is figure out how to do the same thing in Window_BattleEnemy and/or Window_BattleActor.
Hmmm, I tried aliasing the VS cursor update and setting the opacity to 0 depending on the inputting action + aliasing the base updateSelectionEffect (it might need VS for that battler method though) and depending on the inputting action making it target all the alive enemy sprites. It seemed to work, but I didn't test it much.

const MyVisuEdit1_Sprite_BattleSelectCursor_update = Sprite_BattleSelectCursor.prototype.update;

Sprite_BattleSelectCursor.prototype.update = function() {
MyVisuEdit1_Sprite_BattleSelectCursor_update.call(this);
const action = BattleManager.inputtingAction();
if (action && action.item() && action.isForAll()) {
this.opacity = 0;
}
}

const MyEdit1_Sprite_Battler_updateSelectionEffect = Sprite_Battler.prototype.updateSelectionEffect;

Sprite_Battler.prototype.updateSelectionEffect = function() {
const action = BattleManager.inputtingAction();
if (action && action.item() && action.isForAll()) {
if (this._battler.isSelected()) {
this._selectionEffectCount++;
if (this._selectionEffectCount % 30 < 15) {
$gameTroop.aliveMembers().forEach(member => member.battler().setBlendColor([255, 255, 255, 64]));
} else {
$gameTroop.aliveMembers().forEach(member => member.battler().setBlendColor([0, 0, 0, 0]));
}
} else if (this._selectionEffectCount > 0) {
this._selectionEffectCount = 0;
$gameTroop.aliveMembers().forEach(member => member.battler().setBlendColor([0, 0, 0, 0]));
}
} else {
MyEdit1_Sprite_Battler_updateSelectionEffect.call(this);
}
};

EDIT: This is for all targets though. For random targets you'd need to do more.

EDIT2: Oh and yeah, for that updateselectioneffect edit, it's currently just checking actions vs. enemies. If you want the update to work with actors too, you'll have to add a check to see which side is targeted and depending on that use it on $gameParty.aliveMembers()
Hmmm, I tried aliasing the VS cursor update and setting the opacity to 0 depending on the inputting action + aliasing the base updateSelectionEffect (it might need VS for that battler method though) and depending on the inputting action making it target all the alive enemy sprites. It seemed to work, but I didn't test it much.

This works pretty nicely, thanks a lot!
There seems to be a lot of other factors for the "all allies" scope, especially since I use a bunch of VisuMZ plugins that handle much of the battle UI, but I could use this for enemies and my simple "show choice" method for selecting all allies, as long as I stick with STB battle system.

Original thread: https://forums.rpgmakerweb.com/threads/selection-step-for-skills-that-randomly-hit-or-hit-all-enemies.180194/