Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. #★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
  2. #
  3. #This script manages enemy strength with variables (ver1.10)
  4. #
  5. #★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
  6. =begin
  7. Update log
  8. ver1.10  Modified to calculate the reinforcement value from the variable
  9. =end
  10.  
  11. module MARU_degree
  12.  
  13. #-----------------------------------------------------------------------------
  14. #Setting
  15.   #Variable number used for difficulty change
  16.   VARIABLES = 3
  17.  
  18.   #Ratio of enhancement to the value of the variable
  19.   #(If default is 0.01, the variable of 1000 is factored of 0.01 times 10)
  20.   DEGREE_RATE = 0.01
  21.  
  22.   #Parameter to change strength (0 = do not change, 1 = change)
  23.   #[HP, MP, Attack, Defense, Magic, Magic Defense, Agility, Luck]
  24.   PALAM = [1,0,1,0,1,0,0,0]
  25. #End of setting
  26. #-----------------------------------------------------------------------------
  27. end
  28.  
  29. #==============================================================================
  30. # ■ Game_Enemy
  31. #------------------------------------------------------------------------------
  32. # This class is used inside the Game_Troop ($game_troop).
  33. #==============================================================================
  34.  
  35. class Game_Enemy < Game_Battler
  36.   #--------------------------------------------------------------------------
  37.   # ● Acquisition of normal ability value
  38.   #--------------------------------------------------------------------------
  39.   alias maru_param param
  40.   def param(param_id)
  41.     value = param_base(param_id) + param_plus(param_id)
  42.     value *= param_rate(param_id) * param_buff_rate(param_id) * degree(param_id)
  43.     [[value, param_max(param_id)].min, param_min(param_id)].max.to_i
  44.   end
  45.   #--------------------------------------------------------------------------
  46.   # ● Rate of change by difficulty
  47.   #--------------------------------------------------------------------------
  48.   def degree(param_id)
  49.     return 1.0 if $game_variables[MARU_degree::VARIABLES] == 0
  50.     return MARU_degree::DEGREE_RATE * $game_variables[MARU_degree::VARIABLES] if MARU_degree::PALAM[param_id] == 1
  51.     return 1.0
  52.   end
  53. end