Advertisement
roninator2

Doctor Todd Difficulty - Mod - EXP & Gold

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