Request: Strike different Random Enemy per Skill Repeat

Right now, when you have a Skill set to 1 Random Enemy with a Repeat of more than 1, the Skill selects the Random Enemy, then executes all Repeats on that one enemy.

I want a notetag on skills that allow it to select a new Random Enemy for each Repeat the skill has.

Ex:

There are 5 enemies.

You use the skill 5-Hit (Has scope of 1 Random Enemy, 5 Repeat). It Hits 1 random enemy once, selects a new random enemy and hits it, ect. Until 5 hits have hit any 5 random enemies.
Bump
Hey ♫

This took less than an hour, so its free for use in all non-commercial projects. Just save it in the plugins folder under the name NonRepeatRandom.js.

Spoiler
Code:
/*=======================================NonRepeatRandom.js======================================= /*: * @plugindesc Non Repeating Random * @author Kaimonkey * @param True for all skills? * @desc Setting to true will mean that this plugin affects skills without the <norepeat> tag * @default false * * @help  * ============================================================================ * Terms and Conditions * ============================================================================  * The plug in may only be used for NONCOMMERCIAL projects. If you wish to * use this plug in in a commercial product, please contact Kaimonkey for a  * licience * * While reasonable effort will be made to fix any faults in the product, the  * product comes "as is", and Kaimonkey is under no legal obligation to do so.    * ============================================================================ * Intro * ============================================================================ * This script means that any skill with the repeat property, the scope of "one * random enemy", and the <norepeat> tag will never target the same enemy twice.  * If not enough targets are avaiable the skill will target each enemy once.  *  */(function() { //Start Plugin    var parameters = PluginManager.parameters('NonRepeatRandom');    var all_skills = String(parameters["True for all skills?"]) !== "false";    var _km_action_numTargets = Game_Action.prototype.numTargets;	Game_Action.prototype.numTargets = function() {		if(this.is_non_repeat()){			return this.item().repeats;		}	    return _km_action_numTargets.call(this);	};		Game_Action.prototype.is_non_repeat = function(){		return this.item().scope == 3 && (all_skills || this.item().note.includes("<norepeat>"));	};	var _km_action_numRepeats = Game_Action.prototype.numRepeats;	Game_Action.prototype.numRepeats = function() {	    if(this.is_non_repeat()){	    	return 1;	    }	    return _km_action_numRepeats.call(this);	};	var _km_action_targetsForOpponents = Game_Action.prototype.targetsForOpponents;	Game_Action.prototype.targetsForOpponents = function() {		if(this.is_non_repeat()){	   		var members = shuffle(this.opponentsUnit().aliveMembers().clone());	   		var targets = [];	        for (var i = 0; i < this.numTargets(); i++) {	            if(members.length!=0)	           		targets.push(members.pop());	           	else	           		return targets;	        }	        return targets;		}	    return _km_action_targetsForOpponents.call(this);	};	function shuffle(o){	    for(var j, x, i = o.length; i; j = Math.floor(Math.random() * i), x = o[--i], o[i] = o[j], o[j] = x);	    return o;	}})(); //Close Plugin
Thanks for replying!

I can't get it to work with other plugins I have, so I am trying to see what plugin(s) are causing issues.

However, you have one major issue that make me not able to use your script. You have the script to "will never target the same enemy twice". I do not want this. I want each repeat to just select 1 enemy at random to attack, not attack each enemy only a max of once each...

EDIT:

It seems as if your plugin is not compatible with the Yanfly Battle Core... 
Hey ♫
 
Oh, well, haha! I completely assumed that was what you wanted- my bad!
 
Well, here is the modified version of the script (Which would have taken much less time to produce! Damn my presumptuousness!)
 
This one is called RepeatRandom.js

Spoiler
/*=======================================RepeatRandom.js=======================================  /*: * @plugindesc Repeating Random * @author Kaimonkey  * @param True for all skills? * @desc Setting to true will mean that this plugin affects skills without the * <repeatrandom> tag * @default false * * @help  * ============================================================================ * Terms and Conditions * ============================================================================  * The plug in may only be used for NONCOMMERCIAL projects. If you wish to * use this plug in in a commercial product, please contact Kaimonkey for a  * licience * * While reasonable effort will be made to fix any faults in the product, the  * product comes "as is", and Kaimonkey is under no legal obligation to do so.    * ============================================================================ * Intro * ============================================================================ * This script means that any skill with the repeat property, the scope of "one * random enemy", and the <repeatrandom> tag will repeat against different  * targets  *  */ (function() { //Start Plugin    var parameters = PluginManager.parameters('RepeatRandom');     var all_skills = String(parameters["True for all skills?"]) !== "false";     var _km_action_numTargets = Game_Action.prototype.numTargets;Game_Action.prototype.numTargets = function() {if(this.is_non_repeat()){return this.item().repeats;}   return _km_action_numTargets.call(this);}; Game_Action.prototype.is_non_repeat = function(){return this.item().scope == 3 && (all_skills || this.item().note.includes("<repeatrandom>"));}; var _km_action_numRepeats = Game_Action.prototype.numRepeats;Game_Action.prototype.numRepeats = function() {   if(this.is_non_repeat()){    return 1;   }   return _km_action_numRepeats.call(this);};  })(); //Close Plugin
 
As for the compatibility issue it is vital when making script/plug in requests to list links to other scripts which you are using, especially those which interact with the same components. (So in this case, combat and skills)
The code was designed for comparability (No methods are overridden, only added to) so you must have some kind of combat system script which simply never make references to the parts of the core code which I changed.

Post a link to the scripts you are using and I will see what I can do

/Kai
Alright, That looks better 😛 sorry for that confusion!

Here is the link to the BattleCore: http://yanfly.moe/plugins/en/YEP_BattleEngineCore.js

Also, I am using a plugin that randomizes the repeat value for certain skills (Like a range of 2-5 repeats). Here is that plugin: http://himeworks.com/files/rmmv/scripts/RandomRepeats.js
Have you happened to look into making it compatible with these two plugins yet?
(Bump)
(Bump)
Bump
Created my own plugin as a solution.

Instead of creating the effect with Repeats, I simple randomized the number of Random Enemies in the Scope.

http://forums.rpgmakerweb.com/index.php?/topic/54737-tdw-x-random-enemies-scope/ 

Original thread: https://forums.rpgmakerweb.com/threads/request-strike-different-random-enemy-per-skill-repeat.50253/