Advertisement
roninator2

Doctor Todd Difficulty - Mod - EXP & Gold

Dec 7th, 2024
27
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 13.19 KB | None | 0 0
  1. #===============================================================================
  2. #
  3. # DT's Difficulty
  4. # Author: DoctorTodd
  5. # Date (15/12/2019)
  6. # Version: (1.0.1) (VXA)
  7. # Level: (Medium)
  8. # Email: Todd@beacongames.com
  9. #
  10. #===============================================================================
  11. #
  12. # NOTES: 1)This script will only work with ace.
  13. #        2)A difficulty must be selected before the first battle or the game WILL
  14. #        CRASH.
  15. #
  16. #===============================================================================
  17. #
  18. # Description: Lets the player select the games difficulty.
  19. #
  20. # Credits: Me (DoctorTodd), D&P3 for saving bug fix.
  21. # Additions by Roninator2
  22. #===============================================================================
  23. #
  24. # Instructions
  25. # Paste above main.
  26. #
  27. #===============================================================================
  28. #
  29. # Free for any use as long as I'm credited.
  30. #
  31. #===============================================================================
  32. #
  33. # Editing begins 38 and ends on 81.
  34. #
  35. #===============================================================================
  36. module TODDDIFFICULTY  
  37. #Easy Text.  
  38. EASYT = "Easy"  
  39. #Normal Text.  
  40. NORMALT = "Normal"  
  41. #Heroic Text.  
  42. HEROICT = "Heroic"  
  43. #Hard Text.  
  44. HARDT = "Legendary"  
  45. #Easy enemy parameters multiplier.  
  46. EASYM = 0.75  
  47. #Heroic enemy parameters multiplier (Normal is skipped since it's what put  
  48. #you into the database).  
  49. HEROICM = 1.25  
  50. #Hard enemy parameters multiplier.  
  51. HARDM = 1.5    
  52. #Easy enemy experience multiplier.  
  53. EASYEXPM = 0.75  
  54. #Heroic enemy experience multiplier (Normal is skipped since it's what put  
  55. #you into the database).  
  56. HEROICEXPM = 1.25  
  57. #Hard enemy experience multiplier.  
  58. HARDEXPM = 1.5    
  59. #Easy enemy gold multiplier.  
  60. EASYGOLDM = 0.75  
  61. #Heroic enemy gold multiplier (Normal is skipped since it's what put  
  62. #you into the database).  
  63. HEROICGOLDM = 1.25  
  64. #Hard enemy gold multiplier.  
  65. HARDGOLDM = 2      
  66. #Easy enemy drop multiplier.  
  67. EASYDROPM = 0.75  
  68. #Heroic enemy drop multiplier (Normal is skipped since it's what put  
  69. #you into the database).  
  70. HEROICDROPM = 1.25  
  71. #Hard enemy drop multiplier.  
  72. HARDDROPM = 1.5  
  73. #The text above where the selection is made.  
  74. TEXT = "Please select a difficulty:"  
  75. #Menu command?  
  76. MENU = true  
  77. #Sound effect to play when difficulty is selected.  
  78. SE = "Darkness8"  
  79. #Switch to allow cancelling the difficulty selection.  
  80. #MUST NOT BE ON WHEN SELECTING FOR THE FIRST TIME.  
  81. SWITCH = 5
  82.  
  83. end
  84. #==============================================================================
  85. # ** Game_Enemy
  86. #------------------------------------------------------------------------------
  87. #  This class handles enemies. It used within the Game_Troop class
  88. # ($game_troop).
  89. #==============================================================================
  90.  
  91. class Game_Enemy < Game_Battler  
  92. #--------------------------------------------------------------------------  
  93. # * Get Base Value of Parameter  
  94. #--------------------------------------------------------------------------  
  95.     alias todd_difficulty_gmen_param_base param_base  
  96.     def param_base(param_id, *args)  
  97.         n1 = todd_difficulty_gmen_param_base(param_id, *args)  
  98.         n2 = case $game_system.todd_difficulty  
  99.         when 0
  100.             TODDDIFFICULTY::EASYM  
  101.         when 1
  102.             1  
  103.         when 2
  104.             TODDDIFFICULTY::HEROICM  
  105.         when 3
  106.             TODDDIFFICULTY::HARDM  
  107.         end  
  108.         return n1 * n2
  109.     end  
  110.     #--------------------------------------------------------------------------  
  111.     # * Get Experience  
  112.     #--------------------------------------------------------------------------  
  113.     def exp    
  114.         case $game_system.todd_difficulty    
  115.         when 0
  116.             enemy.exp * TODDDIFFICULTY::EASYEXPM    
  117.         when 1
  118.             enemy.exp          
  119.         when 2
  120.             enemy.exp * TODDDIFFICULTY::HEROICEXPM    
  121.         when 3
  122.             enemy.exp * TODDDIFFICULTY::HARDEXPM  
  123.         end
  124.     end  
  125.     #--------------------------------------------------------------------------  
  126.     # * Get Gold  
  127.     #--------------------------------------------------------------------------  
  128.     def gold    
  129.         case $game_system.todd_difficulty    
  130.         when 0
  131.             enemy.gold * TODDDIFFICULTY::EASYGOLDM    
  132.         when 1
  133.             enemy.gold    
  134.         when 2
  135.             enemy.gold * TODDDIFFICULTY::HEROICGOLDM    
  136.         when 3
  137.             enemy.gold * TODDDIFFICULTY::HARDGOLDM  
  138.         end  
  139.     end  
  140.     #--------------------------------------------------------------------------  
  141.     # * Create Array of Dropped Items  
  142.     #--------------------------------------------------------------------------  
  143.     def make_drop_items    
  144.         case $game_system.todd_difficulty    
  145.             when 0
  146.                 @DropMulti = TODDDIFFICULTY::EASYDROPM    
  147.             when 1
  148.                 @DropMulti = 1    
  149.             when 2
  150.                 @DropMulti = TODDDIFFICULTY::HEROICDROPM    
  151.             when 3
  152.                 @DropMulti = TODDDIFFICULTY::HARDDROPM  
  153.         end    
  154.         enemy.drop_items.inject([]) do |r, di|      
  155.         if di.kind > 0 && rand * di.denominator < drop_item_rate * @DropMulti
  156.             r.push(item_object(di.kind, di.data_id))      
  157.         else
  158.             r      
  159.         end    
  160.         end  
  161.     end
  162. end
  163.  
  164. #==============================================================================
  165. # ** Game_System
  166. #------------------------------------------------------------------------------
  167. #  This class handles system data. It saves the disable state of saving and
  168. # menus. Instances of this class are referenced by $game_system.
  169. #==============================================================================
  170.  
  171. class Game_System  
  172. #--------------------------------------------------------------------------  
  173. # * Public Instance Variables  
  174. #--------------------------------------------------------------------------  
  175.     attr_accessor :todd_difficulty # save forbidden  
  176. #--------------------------------------------------------------------------  
  177. # * Object Initialization  
  178. #--------------------------------------------------------------------------  
  179.     alias todd_difficulty_gamesystem_init initialize  
  180.     def initialize    
  181.         @todd_difficulty = 0    
  182.         todd_difficulty_gamesystem_init
  183.     end
  184. end
  185.  
  186. #==============================================================================
  187. # ** Window_DifficultySelection
  188. #==============================================================================
  189.  
  190. class Window_DifficultySelection < Window_HorzCommand  
  191. #--------------------------------------------------------------------------  
  192. # * Object Initialization  
  193. #--------------------------------------------------------------------------  
  194.     def initialize    
  195.         super(0, 0)
  196.     end  
  197.     #--------------------------------------------------------------------------  
  198.     # * Get Window Width  
  199.     #--------------------------------------------------------------------------  
  200.     def window_width    
  201.         Graphics.width/2 + 20  
  202.     end  
  203.     #--------------------------------------------------------------------------  
  204.     # * Get Digit Count  
  205.     #--------------------------------------------------------------------------
  206.     def col_max    
  207.         return 4  
  208.     end  
  209.     #--------------------------------------------------------------------------  
  210.     # * Create Command List  
  211.     #--------------------------------------------------------------------------  
  212.     def make_command_list    
  213.         add_command(TODDDIFFICULTY::EASYT,     :easy)    
  214.         add_command(TODDDIFFICULTY::NORMALT,   :normal)    
  215.         add_command(TODDDIFFICULTY::HEROICT,    :heroic)    
  216.         add_command(TODDDIFFICULTY::HARDT, :hard)  
  217.     end
  218. end
  219. #==============================================================================
  220. # ** Window_DifficultyName
  221. #==============================================================================
  222.  
  223. class Window_DifficultyName < Window_Base  
  224. #--------------------------------------------------------------------------  
  225. # * Object Initialization  
  226. #--------------------------------------------------------------------------  
  227.     def initialize    
  228.         super(0, 0, window_width, fitting_height(1))    
  229.         refresh  
  230.     end  
  231.     #--------------------------------------------------------------------------  
  232.     # * Get Window Width  
  233.     #--------------------------------------------------------------------------  
  234.     def window_width    
  235.         return Graphics.width/2 + 20  
  236.     end  
  237.     #--------------------------------------------------------------------------  
  238.     # * Refresh  
  239.     #--------------------------------------------------------------------------  
  240.     def refresh    
  241.         contents.clear    
  242.         draw_text(15, -27, 400, 80, TODDDIFFICULTY::TEXT)  
  243.     end
  244. end
  245. #==============================================================================
  246. # ** Scene_Difficulty
  247. #==============================================================================
  248.  
  249. class Scene_Difficulty < Scene_MenuBase  
  250. #--------------------------------------------------------------------------  
  251. # * Start Processing  
  252. #--------------------------------------------------------------------------  
  253.     def start    
  254.         super    
  255.         create_command_window    
  256.         create_name_window  
  257.     end  
  258.     #--------------------------------------------------------------------------  
  259.     # * Create Command Window  
  260.     #--------------------------------------------------------------------------  
  261.     def create_command_window    
  262.         @command_window = Window_DifficultySelection.new    
  263.         @command_window.set_handler(:easy,      method(:command_easy))    
  264.         @command_window.set_handler(:normal,     method(:command_normal))  
  265.         @command_window.set_handler(:heroic,     method(:command_heroic))    
  266.         @command_window.set_handler(:hard,    method(:command_hard))    
  267.         @command_window.set_handler(:cancel,    method(:return_scene))if $game_switches[TODDDIFFICULTY::SWITCH] == true    
  268.         @command_window.x = Graphics.width/2 - 170    
  269.         @command_window.y = Graphics.height/2 - 50  
  270.     end  
  271.     #--------------------------------------------------------------------------  
  272.     # * Create Difficulty Window  
  273.     #--------------------------------------------------------------------------  
  274.     def create_name_window    
  275.         @name_window = Window_DifficultyName.new    
  276.         @name_window.x = Graphics.width/2 - 170    
  277.         @name_window.y = Graphics.height/2 - 97  
  278.     end  
  279.     #--------------------------------------------------------------------------  
  280.     # * [easy] Command  
  281.     #--------------------------------------------------------------------------  
  282.     def command_easy    
  283.         $game_system.todd_difficulty = 0    
  284.         Audio.se_play("Audio/SE/" + TODDDIFFICULTY::SE, 100, 100)    
  285.         return_scene  
  286.     end  
  287.     #--------------------------------------------------------------------------  
  288.     # * [normal] Command  #--------------------------------------------------------------------------  
  289.     def command_normal    
  290.         $game_system.todd_difficulty = 1  
  291.         Audio.se_play("Audio/SE/" + TODDDIFFICULTY::SE, 100, 100)    
  292.         return_scene  
  293.     end  
  294.     #--------------------------------------------------------------------------  
  295.     # * [heroic] Command  
  296.     #--------------------------------------------------------------------------  
  297.     def command_heroic    
  298.         $game_system.todd_difficulty = 2      
  299.         Audio.se_play("Audio/SE/" + TODDDIFFICULTY::SE, 100, 100)    
  300.         return_scene  
  301.     end  
  302.     #--------------------------------------------------------------------------  
  303.     # * [hard] Command  
  304.     #--------------------------------------------------------------------------
  305.     def command_hard    
  306.         $game_system.todd_difficulty = 3        
  307.         Audio.se_play("Audio/SE/" + TODDDIFFICULTY::SE, 100, 100)  
  308.         return_scene  
  309.     end
  310. end
  311.  
  312. if TODDDIFFICULTY::MENU == true
  313. #==============================================================================
  314. # ** Scene_Menu
  315. #------------------------------------------------------------------------------
  316. #  This class performs the menu screen processing.
  317. #==============================================================================
  318.  
  319.     class Scene_Menu < Scene_MenuBase  
  320.     #--------------------------------------------------------------------------  
  321.     # * Create Command Window  
  322.     #--------------------------------------------------------------------------  
  323.     alias todd_dif_menu_add_menu_command create_command_window  
  324.     def create_command_window  
  325.         todd_dif_menu_add_menu_command    
  326.         @command_window.set_handler(:dif, method(:command_dif))  
  327.     end
  328. end  
  329.     #--------------------------------------------------------------------------  
  330.     # * [Difficulty] Command  
  331.     #--------------------------------------------------------------------------  
  332.     def command_dif  
  333.         SceneManager.call(Scene_Difficulty)
  334.     end
  335. end
  336.  
  337. if TODDDIFFICULTY::MENU == true
  338. #==============================================================================
  339. # ** Window_MenuCommand
  340. #------------------------------------------------------------------------------
  341. #  This command window appears on the menu screen.
  342. #==============================================================================
  343.  
  344.     class Window_MenuCommand < Window_Command  
  345.     #--------------------------------------------------------------------------  
  346.     # * Add Main Commands to List  
  347.     #--------------------------------------------------------------------------  
  348.         alias todd_dif_menu_command_add_to_menu add_main_commands  
  349.         def add_main_commands    
  350.             todd_dif_menu_command_add_to_menu    
  351.             add_command("Difficulty", :dif, main_commands_enabled)  
  352.         end
  353.     end
  354. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement