Hi,
I have been trying to get a Counterattack state on a character that counters enemies with a AOE basic attack.
But for some reason it's only attacking with a single enemy per counterattack.
Even if I use a friends plugin for it.
Any idea what might cause it or if there is a way to solve it?
/*:
* @target MZ
* @plugindesc Enables counterattacks with a specified skill hitting all enemies.
*
* @command ApplyCounterattack
* @text Apply Counterattack
* @desc Apply counterattack with a specific skill to all enemies.
*
* @arg user
* @text Actor ID
* @desc The ID of the actor performing the counterattack.
* @type actor
*
* @arg skill
* @text Skill ID
* @desc The ID of the skill to be used for the counterattack.
* @type skill
*
* @Help CounterattackAllPlugin.js
*
*
* Plugin Command:
* ApplyCounterattack user: actorId skill: skillId
* - user: The ID of the actor performing the counterattack.
* - skill: The ID of the skill used for the counterattack.
*
*/
(function() {
// Register the plugin command
PluginManager.registerCommand('CounterattackAllPlugin', 'ApplyCounterattack', function(args) {
// Get the user and target
const user = $gameActors.actor(args.user);
const targets = $gameTroop.aliveMembers();
// Apply the counterattack skill to all enemies
targets.forEach(function(target) {
user.useSkill(args.skill, target._index);
});
});
})();
I have been trying to get a Counterattack state on a character that counters enemies with a AOE basic attack.
But for some reason it's only attacking with a single enemy per counterattack.
Even if I use a friends plugin for it.
Any idea what might cause it or if there is a way to solve it?
/*:
* @target MZ
* @plugindesc Enables counterattacks with a specified skill hitting all enemies.
*
* @command ApplyCounterattack
* @text Apply Counterattack
* @desc Apply counterattack with a specific skill to all enemies.
*
* @arg user
* @text Actor ID
* @desc The ID of the actor performing the counterattack.
* @type actor
*
* @arg skill
* @text Skill ID
* @desc The ID of the skill to be used for the counterattack.
* @type skill
*
* @Help CounterattackAllPlugin.js
*
*
* Plugin Command:
* ApplyCounterattack user: actorId skill: skillId
* - user: The ID of the actor performing the counterattack.
* - skill: The ID of the skill used for the counterattack.
*
*/
(function() {
// Register the plugin command
PluginManager.registerCommand('CounterattackAllPlugin', 'ApplyCounterattack', function(args) {
// Get the user and target
const user = $gameActors.actor(args.user);
const targets = $gameTroop.aliveMembers();
// Apply the counterattack skill to all enemies
targets.forEach(function(target) {
user.useSkill(args.skill, target._index);
});
});
})();