Guest User

Untitled

a guest
Jan 1st, 2016
634
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //=============================================================================
  2. // SilvStamina_GV.js
  3. // Version: 1.01
  4. //=============================================================================
  5. /*:
  6.  * @plugindesc v1.01 Addon script for my dash-script to store stamina in a gamevariable
  7.    <SilverStamina_GameVariable>
  8.  * @author Silver
  9.  *
  10.  * @param Game Variable Number
  11.  * @desc Must be 1 or higher.
  12.  * @default 1
  13.  *
  14.  * @help
  15.  * Required Silvers Dash Stamina and must be placed below it.
  16.  *
  17.  */
  18. // Imported
  19. var Imported = Imported || {};
  20. Imported.SILV_SilvStamina_GV = 1.01;
  21.  
  22. // #Parameters
  23. var Silv = Silv || {};
  24. Silv.Parameters = $plugins.filter(function(p) { return p.description.contains('<SilverStamina_GameVariable>'); })[0].parameters;
  25. Silv.DashStamina_GV = Silv.DashStamina_GV || {};
  26. Silv.DashStamina_GV.StaminaGVNumber = parseInt(Silv.Parameters['Game Variable Number']);
  27.  
  28. // Dependency Check
  29. if (!('Silv_DashStamina' in Imported) || Imported.Silv_DashStamina < 1.03) { throw Error('ERROR: Silvers Stamina GV requires Silvers Dash Stamina v1.02 or higher. It must be placed above this script.'); }
  30.  
  31. (function()
  32. {
  33. //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  34. // Script
  35. //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  36. var silv_alias_dashStamina_GV_Game_Map_update = Game_Map.prototype.update;
  37. Game_Map.prototype.update = function(sceneActive)
  38. {
  39.     silv_alias_dashStamina_GV_Game_Map_update.call(this, sceneActive);
  40.     if (sceneActive) { $gameVariables.setValue(Silv.DashStamina_GV.StaminaGVNumber, $gamePlayer.dashStamina); }
  41. };
  42. //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  43. })();
  44. //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  45. // This is the end of this awesome script!
  46. //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Add Comment
Please, Sign In to add comment