Advertisement
Guest User

Untitled

a guest
Dec 7th, 2015
177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //=============================================================================
  2. // SilvStamina_GV.js
  3. // Version: 1.00
  4. //=============================================================================
  5. /*:
  6.  * @plugindesc v1.00 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.  
  19. //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  20. // #Parameters
  21. //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  22. var Silv = Silv || {};
  23. Silv.Plugins = Silv.Plugins || {};
  24. if (!('DashStamina' in Silv.Plugins) || Silv.Plugins.DashStamina < 1.02) { throw 'ERROR: Silvers Stamina GV requires Silvers Dash Stamina v1.02 or higher. It must be placed above this script.'; }
  25. Silv.Plugins.DashStamina_GameVariables = 1.00;
  26. Silv.Parameters = $plugins.filter(function(p) { return p.description.contains('<SilverStamina_GameVariable>'); })[0].parameters;
  27. Silv.DashStamina_GV = Silv.DashStamina_GV || {};
  28. Silv.DashStamina_GV.StaminaGVNumber = parseInt(Silv.Parameters['Game Variable Number']);
  29. //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  30. // Script
  31. //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  32. (function()
  33. {
  34.  
  35. var silv_alias_dashStamina_GV_Game_Map_update = Game_Map.prototype.update;
  36. Game_Map.prototype.update = function(sceneActive)
  37. {
  38.     silv_alias_dashStamina_GV_Game_Map_update.call(this, sceneActive);
  39.     if (sceneActive) { $gameVariables.setValue(Silv.DashStamina_GV.StaminaGVNumber, $gamePlayer.dashStamina); }
  40. };
  41. //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  42. })();
  43. //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  44. // End of script
  45. //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement