Advertisement
trevync

Stat Manager Plugin: Param Modifiers

May 28th, 2014
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 4.56 KB | None | 0 0
  1. if $imported_trvc_params
  2. $imported_trvc_param_modifiers = true
  3. # =============================================================================
  4. # ======== INTRODUCTION =======================================================
  5. # =============================================================================
  6. #   Name:    Stat Manager Plugin: Param Modifiers
  7. #   Author:  Trevyn MC (http://trevync.wordpress.com/)
  8. #   Version: 1.0 (5/28/14)
  9. #  
  10. #   Purpose: Extend the functionality of my stat manager script to modify
  11. #            params, xparams and sparams
  12. #
  13. #   Dependencies: Stat Manager version 1.0 or later
  14. #
  15. #   Terms Of Use:
  16. #     1 Always give credit
  17. #     2 Let me know when you release a game (a response to the forum post about
  18. #       this script is enough)
  19. #     3 Always include the full introduction section with the script
  20. #    
  21. #        Otherwise you are free to use and modify as you see fit for both
  22. #        commercial or non_commercial projects
  23. #
  24. #   Compatibility:
  25. #       Alias: 4 Methods
  26. #          Game_BattlerBase
  27. #              param_plus
  28. #              param_rate
  29. #              xparam
  30. #              sparam
  31. #      
  32. #       compatibility should be pretty good. but just be careful of mixing this
  33. #       script with others that do the same thing. Results could be potentially
  34. #       unpredictable.
  35. #  
  36. #   Change_log:
  37. #
  38. # =============================================================================
  39. # ========= INSTRUCTIONS ======================================================
  40. # =============================================================================
  41. #  Put this script below materials and above main.
  42. #  Put this script below my stat manager
  43. #
  44. #  Script is plug and play. no customizing required
  45. #
  46. #  Put notetags with the form
  47. #  <stat: (+-*) value>
  48. #  in the note field of Skills, States, Equips, Classes, Actors or Enemies
  49. #  Example
  50. #  <mrg: + 0.05> add 5% mana regen
  51. #  <hrg: * 2>    double heath regen
  52. #  <atk: + 21>   add 21 to atk
  53. #  <mev: - 0.2>  lower magic evade by 20%
  54. #  These tags allow you to either multiply or add to any parameter from objects
  55. #  That normally don't support those options. (skills for example)
  56. #
  57. #
  58. #
  59. module Trvc_Params
  60.  
  61.   Params +=[[[:param, 0],["mhp"]],
  62.             [[:param, 1],["mmp"]],
  63.             [[:param, 2],["atk"]],
  64.             [[:param, 3],["def"]],
  65.             [[:param, 4],["mat"]],
  66.             [[:param, 5],["mdf"]],
  67.             [[:param, 6],["agi"]],
  68.             [[:param, 7],["luk"]],
  69.             [[:xparam,0],["hit"]],
  70.             [[:xparam,1],["eva"]],
  71.             [[:xparam,2],["cri"]],
  72.             [[:xparam,3],["cev"]],
  73.             [[:xparam,4],["mev"]],
  74.             [[:xparam,5],["mrf"]],
  75.             [[:xparam,6],["cnt"]],
  76.             [[:xparam,7],["hrg"]],
  77.             [[:xparam,8],["mrg"]],
  78.             [[:xparam,9],["trg"]],
  79.             [[:sparam,0],["tgr"]],
  80.             [[:sparam,1],["grd"]],
  81.             [[:sparam,2],["rec"]],
  82.             [[:sparam,3],["pha"]],
  83.             [[:sparam,4],["mcr"]],
  84.             [[:sparam,5],["tcr"]],
  85.             [[:sparam,6],["pdr"]],
  86.             [[:sparam,7],["mdr"]],
  87.             [[:sparam,8],["fdr"]],
  88.             [[:sparam,9],["exr"]],]
  89.            
  90.   #
  91. end
  92.  
  93.          
  94. class Game_BattlerBase
  95.   #--------------------------------------------------------------------------
  96.   # Alias param_plus
  97.   #--------------------------------------------------------------------------
  98.   alias trvc_param_plus_alias param_plus
  99.   def param_plus(param_id)
  100.     (t_param(:param, param_id).plus + trvc_param_plus_alias(param_id) )
  101.   end
  102.  
  103.   #--------------------------------------------------------------------------
  104.   # Alias param_rate
  105.   #--------------------------------------------------------------------------
  106.   alias trvc_param_rate_alias param_rate
  107.   def param_rate(param_id)
  108.     t_param(:param, param_id).rate * trvc_param_rate_alias(param_id)
  109.   end
  110.   #--------------------------------------------------------------------------
  111.   # Alias xparam
  112.   #--------------------------------------------------------------------------
  113.   alias trvc_xparam xparam
  114.   def xparam(xparam_id)
  115.     (trvc_xparam(xparam_id) + t_param(:xparam, xparam_id).plus) * t_param(:xparam, xparam_id).rate
  116.   end
  117.   #--------------------------------------------------------------------------
  118.   # Alias sparam
  119.   #--------------------------------------------------------------------------
  120.   alias trvc_sparam sparam
  121.   def sparam(sparam_id)
  122.     (trvc_sparam(sparam_id) + t_param(:sparam, sparam_id).plus) * t_param(:sparam, sparam_id).rate
  123.   end
  124. end
  125.  
  126. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement