Ellye

Ellye Random Skill VFX

Nov 15th, 2015
1,156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // Place file inside /js/plugins
  2. // Remember to save after adding plugins or changing parameters.
  3. // Made by request.
  4. //=============================================================================
  5. // Skills with multiple possible Visual Effects
  6. //=============================================================================
  7. /*:
  8.  * Version: 2015-11-16-0304
  9.  *
  10.  * CHANGE LOG:
  11.  * 2015-11-16-0304 - Released.
  12.  *
  13.  *
  14.  * @plugindesc Ver.2015-11-16-0304. Skills with multiple possible visual effects.
  15.  * <Ellye Random VFX>
  16.  * @author https://ellyeblog.wordpress.com/ || http://steamcommunity.com/id/Ellye
  17.  *
  18.  * @help In any skill or activable battle item, you can use type the following text in your note field:
  19.  * <random_vfx:ANIMATION_ID_1,ANIMATION_ID2,ANIMATION_ID3,etc>
  20.  *
  21.  * For example, a skill with:
  22.  * <random_vfx:14,45,67,32>
  23.  * Will randomly play the animations with ID 14, 45, 67 or 32 when used during battle.
  24.  * Leave the "Aniamtion" field blank, otherwise two animations will be played;
  25.  * Unless you actually want both animation to play at the same time, some cool stuff can be done with that.
  26.  *
  27.  */
  28.  
  29. var Imported = Imported || {};
  30. Imported.Ellye_RVFX = true;
  31.  
  32. (function() {
  33.  
  34.     _alias_window_batlelog_startaction = Window_BattleLog.prototype.startAction;
  35.     Window_BattleLog.prototype.startAction = function(subject, action, targets) {
  36.         _alias_window_batlelog_startaction.call(this, subject, action, targets);
  37.         var item = action.item();
  38.         if (typeof item.meta !== 'undefined' && typeof item.meta.random_vfx !== 'undefined')
  39.         {
  40.             eval("var random_vfx = [" + item.meta.random_vfx + "]");
  41.             var vfx = random_vfx[Math.floor(Math.random() * random_vfx.length)];
  42.             this.push('showAnimation', subject, targets.clone(), vfx);
  43.         }
  44.     };
  45. })();
Advertisement
Add Comment
Please, Sign In to add comment