Yes direction fix would be a great addition.
Also is there any plans for adding a flash enemy to the skill settings? Similar to what is currently available in the animations section where you can make the default enemy sprites flash.
Coincidentally, I've thrown together a really hacky target flash custom function. It's not the best way probably, but it seems to get the job done for now.
Step 1 The following code goes into my personal master plugin JavaScript file that I use to override other plugins or write my custom functions. It goes at the bottom of all my plugins to ensure it will be the last to run.
Code:
Skill_Sequencer.prototype.targetFlash = function(action, targets) {
if ( targets.length ) {
// TODO: find more efficient way to make sprite blink
targets[0].setOpacity(0);
setTimeout( function(){ targets[0].setOpacity(0); } , 100 );
setTimeout( function(){ targets[0].setOpacity(255); } , 150 );
setTimeout( function(){ targets[0].setOpacity(0); } , 200 );
setTimeout( function(){ targets[0].setOpacity(255); }, 250 );
setTimeout( function(){ targets[0].setOpacity(0); } , 300 );
setTimeout( function(){ targets[0].setOpacity(255); } , 350 );
setTimeout( function(){ targets[0].setOpacity(0); } , 400 );
setTimeout( function(){ targets[0].setOpacity(255); } , 450 );
}
}
I used targets[0] temporarily to just target the first enemy in the array of possible enemies within attack range. To target all enemies in range, you can use a loop iterating on variable i, and replace targets[0] with targets[i ]
Then I aliased the "startOnDamageTargetAction" function to add this extra switch case:
Code:
var _Skill_Sequencer_startOnDamageTargetAction = Skill_Sequencer.prototype.startOnDamageTargetAction;
Skill_Sequencer.prototype.startOnDamageTargetAction = function(action, targets) {
var cmd = action[0].toLowerCase();
if ( cmd === 'flash' ) {
return this.targetFlash(action, targets);
}
_Skill_Sequencer_startOnDamageTargetAction.call(this, action, targets);
};
Edited again to prevent action.shift() from happening twice. It seems if I use action[0] to reference the first action item but not remove it from the array, then action.shift() from the original plugin function can still run without error. Otherwise, action.shift() will return null, and toLowerCase() cannot be used on a null object, which throws an error. Oddly, the call() function at the end of this example runs even though there's a return statement above. Does anyone know why?
Please let me know if there's a better way to go about this anyone. Thanks.
Step 2
For the skill where you want this animation to happen, place somewhere between the <absOnDamage> note tag