Advertisement
TheoAllen

Theo - Difficulty Setting 1.2

Mar 3rd, 2013
1,407
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 9.10 KB | None | 0 0
  1. # =============================================================================
  2. # ♫ ~ Difficulty setting by parameter by TheoAllen ~ ♫
  3. # Version  : 1.2d
  4. # Requires : (Optional) YEA - System Option for in game difficulty change
  5. # Contact  : www.rpgmakerid.com
  6. # =============================================================================
  7. # ♫ UPDATES :
  8. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  9. # 2013.10.12 - Fixed another bug in Game Troop
  10. # 2013.06.03 - Fixed another bug in Scene Shop
  11. # 2013.04.27 - Fixed bug in Scene Shop
  12. # 2013.03.02 - Begin and finished rewrite script
  13. #            - Simplify variable use
  14. # 2013.03.01 - Add shop price change
  15. #            - Add exp gain change
  16. #            - Add gold drop change
  17. #            - Compatibility Patch
  18. # 2013.02.24 - Fixed bugs
  19. # 2013.02.24 - Started and finished script
  20. #
  21. # =============================================================================
  22. # ♫ DESCRIPTION :
  23. # This script allow you to change enemy's parameter for difficulty setting.
  24. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  25. # ♫ INSTRUCTION :
  26. # Put this script below material but above main in script editor. Don't forget
  27. # to save.
  28. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  29. # ♫ HOW TO USE :
  30. # Just edit the configuration below
  31. # =============================================================================
  32. # ♫ TERMS OF USE :
  33. # - Credit me, TheoAllen. If you think it's necessary.
  34. # - You may use this script both commercial and non-commercial purposes or even
  35. #   adult game as long as you don't claim it's yours.
  36. # - I'll be glad if you give me a free copy of your game if you use this script
  37. #   in your commercial project.
  38. # =============================================================================
  39. $imported = {} if $imported.nil?
  40. $imported["Theo-DiffSetting"] = true
  41. # =============================================================================
  42. # ♫ CONFIGURATIONS ~ ♫
  43. # =============================================================================
  44. module THEOLIZED
  45.   module DIFFSETTING
  46.  
  47.   VAR_ID          = 9 # variable id. 0 to disable
  48.   DIFFICULTY_HASH = { # <- don't touch this
  49.  
  50. # variable value => [modifiers in percent]
  51. # value => [mhp ,mmp ,atk ,def ,mat ,mdf ,agi ,luk , exp,gold, buy,sell]  
  52.       1 => [100 ,100 ,100 ,100 ,100 ,100 ,100 ,100 , 100, 100, 100, 100],
  53.       2 => [100 ,100 ,100 ,100 ,100 ,100 ,100 ,100 , 100, 100, 100, 100],
  54.       3 => [100 ,100 ,100 ,100 ,100 ,100 ,100 ,100 , 100, 100, 100, 100],
  55.       4 => [100 ,100 ,100 ,100 ,100 ,100 ,100 ,100 , 100, 100, 100, 100],
  56.       5 => [100 ,100 ,100 ,100 ,100 ,100 ,100 ,100 , 100, 100, 100, 100],
  57.          
  58.   } # <- don't touch this
  59.  
  60.   end
  61. end
  62. # =============================================================================
  63. # ♫ Do not edit unless you know what to do ~ ♫
  64. # =============================================================================
  65. # SCRIPT INFOS:
  66. # ------------------------------------------
  67. # Rewriten method : N/A
  68. # ------------------------------------------
  69. # Aliased method :
  70. # - Game_Enemy
  71. #     def initialize
  72. #     def mhp
  73. #     def mmp
  74. #     def atk
  75. #     def def
  76. #     def mat
  77. #     def mdf
  78. #     def agi
  79. #     def luk
  80. # - Game_Troop
  81. #     def initialize
  82. #     def exp_total
  83. #     def gold_total
  84. # - Scene_Shop
  85. #     def buying_price
  86. #     def selling_price
  87. # =============================================================================
  88. # ♫ Game_Enemy ~ ♫
  89. # =============================================================================
  90. class Game_Enemy < Game_Battler
  91.   def var_value
  92.     $game_variables[THEOLIZED::DIFFSETTING::VAR_ID]
  93.   end
  94.  
  95.   def check_var
  96.     @diff_hash = THEOLIZED::DIFFSETTING::DIFFICULTY_HASH
  97.     THEOLIZED::DIFFSETTING::VAR_ID > 0 &&
  98.     @diff_hash.include?(var_value)
  99.   end
  100.   #--------------------------------------------------------------------------
  101.   # ♫ Maximum hit point
  102.   #--------------------------------------------------------------------------
  103.   alias theolized_mhp mhp
  104.   def mhp  
  105.     check_var ? theolized_mhp*@diff_hash[var_value][0]/100 : theolized_mhp  
  106.   end
  107.   #--------------------------------------------------------------------------
  108.   # ♫ Maximum magic point
  109.   #--------------------------------------------------------------------------
  110.   alias theolized_mmp mmp
  111.   def mmp
  112.     check_var ? theolized_mmp*@diff_hash[var_value][1]/100 : theolized_mmp
  113.   end
  114.   #--------------------------------------------------------------------------
  115.   # ♫ Attack point
  116.   #--------------------------------------------------------------------------
  117.   alias theolized_atk atk
  118.   def atk  
  119.     check_var ? theolized_atk*@diff_hash[var_value][2]/100 : theolized_atk
  120.   end
  121.   #--------------------------------------------------------------------------
  122.   # ♫ Defense point
  123.   #--------------------------------------------------------------------------
  124.   alias theolized_def def
  125.   def def
  126.     check_var ? theolized_def*@diff_hash[var_value][3]/100 : theolized_def
  127.   end
  128.   #--------------------------------------------------------------------------
  129.   # ♫ Magic attack
  130.   #--------------------------------------------------------------------------
  131.   alias theolized_mat mat
  132.   def mat
  133.     check_var ? theolized_mat*@diff_hash[var_value][4]/100 : theolized_mat  
  134.   end
  135.   #--------------------------------------------------------------------------
  136.   # ♫ Magic defense
  137.   #--------------------------------------------------------------------------
  138.   alias theolized_mdf mdf
  139.   def mdf  
  140.     check_var ? theolized_mdf*@diff_hash[var_value][5]/100 : theolized_mdf  
  141.   end
  142.   #--------------------------------------------------------------------------
  143.   # ♫ Agility point
  144.   #--------------------------------------------------------------------------
  145.   alias theolized_agi agi
  146.   def agi
  147.     check_var ? theolized_agi*@diff_hash[var_value][6]/100 : theolized_agi
  148.   end
  149.   #--------------------------------------------------------------------------
  150.   # ♫ Luck point
  151.   #--------------------------------------------------------------------------
  152.   alias theolized_luk luk
  153.   def luk
  154.     check_var ? theolized_luk*@diff_hash[var_value][7]/100 : theolized_luk
  155.   end
  156.   #--------------------------------------------------------------------------
  157.   # ♫ Get variable id
  158.   #--------------------------------------------------------------------------
  159.  
  160. end
  161. # =============================================================================
  162. # ♫ Game_Troop ♫
  163. # =============================================================================
  164. class Game_Troop < Game_Unit
  165.  
  166.   alias theolized_diffset_init initialize
  167.   def initialize
  168.     theolized_diffset_init
  169.     @diff_hash = THEOLIZED::DIFFSETTING::DIFFICULTY_HASH.dup
  170.   end
  171.  
  172.   def check_var
  173.     THEOLIZED::DIFFSETTING::VAR_ID > 0 &&
  174.     @diff_hash.include?(var_value)
  175.   end
  176.  
  177.   def var_value
  178.     $game_variables[THEOLIZED::DIFFSETTING::VAR_ID]
  179.   end
  180.   #--------------------------------------------------------------------------
  181.   # * Calculate Total Experience
  182.   #--------------------------------------------------------------------------
  183.   alias theolized_exp_total exp_total
  184.   def exp_total
  185.     check_var ? theolized_exp_total*@diff_hash[var_value][8]/100 : theolized_exp_total
  186.   end
  187.   #--------------------------------------------------------------------------
  188.   # * Calculate Total Gold
  189.   #--------------------------------------------------------------------------
  190.   alias theolized_gold_total gold_total
  191.   def gold_total
  192.     check_var ? theolized_gold_total*@diff_hash[var_value][9]/100 : theolized_gold_total
  193.   end
  194.  
  195. end
  196. # =============================================================================
  197. # ♫ Scene_Shop ♫
  198. # =============================================================================
  199. class Scene_Shop < Scene_MenuBase
  200.  
  201.   alias theolized_diffset_start start
  202.   def start
  203.     theolized_diffset_start
  204.     @diff_hash = THEOLIZED::DIFFSETTING::DIFFICULTY_HASH.dup
  205.   end
  206.  
  207.   def check_var
  208.     THEOLIZED::DIFFSETTING::VAR_ID > 0 &&
  209.     @diff_hash.include?(var_value)
  210.   end
  211.  
  212.   def var_value
  213.     $game_variables[THEOLIZED::DIFFSETTING::VAR_ID]
  214.   end
  215.   #--------------------------------------------------------------------------
  216.   # ♫ Get Purchase Price
  217.   #--------------------------------------------------------------------------
  218.   alias theolized_buy_price buying_price
  219.   def buying_price
  220.     check_var ? theolized_buy_price*@diff_hash[var_value][10]/100 : theolized_buy_price
  221.   end
  222.   #--------------------------------------------------------------------------
  223.   # ♫ Get Sale Price
  224.   #--------------------------------------------------------------------------
  225.   alias theolized_sell_price selling_price
  226.   def selling_price
  227.     check_var ? theolized_sell_price*@diff_hash[var_value][11]/100 : theolized_sell_price
  228.   end
  229.  
  230.  
  231. end
  232. # =============================================================================
  233. # ♫ End of Script ♫
  234. # =============================================================================
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement