by Dargor
Version 1.1
Introduction
This script let you have as many game difficulty settings as you want.
Features
- Can have as many difficulties as you want
- Difficulties can have a name and a description
- Difficulty selection screen after new game
- Modify enemies HP MP ATK DEF SPI AGI Hit and Evasion
Screenshots
Imagine a slime with muscles.
Script
Code:
#==============================================================================
# ** Difficulties
#------------------------------------------------------------------------------
# © Dargor, 2008
#Â 24/06/08
#Â Version 1.1
#Â Requested by van hellblaze
#------------------------------------------------------------------------------
#Â VERSION HISTORY:
#Â - 1.0 (24/06/08), Initial release
#Â - 1.1 (24/06/08), Added EXP and Gold modifiers
#------------------------------------------------------------------------------
#Â INSTRUCTIONS:
#Â - Paste this above main
#Â - Edit the constants in Difficulty moduleÂ
#==============================================================================
#==============================================================================
# ** Difficulty Configuration Module
#==============================================================================
module Difficulty
 # Default difficulty
 Default = 1 # medium
 # Difficulty names
 Names = [
      'Easy',
      'Medium',
      'Hard',
      'Extrem'
     ]
 # Difficulty descriptions
 Descriptions = [
         'Piece of cake.',
         'A good practice.',
         'They know how to kill.',
         "You're already dead."
        ]
 # Enemy Stats modifiers
 # HP MP ATK DEF SPI AGI Hit Evasion EXP Gold
 Modifiers = [
        [0.5, 0.5, 0.5, 0.5 ,0.5 ,0.5, 0.5 ,0.5, 0.5, 0.5],
        [1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
        [1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1, 1],
        [3, 3, 3, 3, 3, 3, 3, 3, 0.5, 0.5]
       ]
 # Available in Title Screen?
 In_Title = true
end
#==============================================================================
# ** Game_System
#------------------------------------------------------------------------------
#Â This class handles system-related data. Also manages vehicles and BGM, etc.
# The instance of this class is referenced by $game_system.
#==============================================================================
class Game_System
 #--------------------------------------------------------------------------
 # * Public Instance Variables
 #--------------------------------------------------------------------------
 attr_accessor :difficulty_id
 #--------------------------------------------------------------------------
 # * Alias Listing
 #--------------------------------------------------------------------------
 alias dargor_vx_difficulty_system_initialize initialize
 #--------------------------------------------------------------------------
 # * Object Initialization
 #--------------------------------------------------------------------------
 def initialize
  dargor_vx_difficulty_system_initialize
  @difficulty_id = Difficulty::Default
 end
 #--------------------------------------------------------------------------
 # * Get Difficulty
 #--------------------------------------------------------------------------
 def difficulty
  return Difficulty::Modifiers[@difficulty_id]
 end
end
#==============================================================================
# ** Game_Enemy
#------------------------------------------------------------------------------
#Â This class handles enemy characters. It's used within the Game_Troop class
# ($game_troop).
#==============================================================================
class RPG::Enemy
 #--------------------------------------------------------------------------
 # * Alias Listing
 #--------------------------------------------------------------------------
 alias dargor_vx_difficulty_enemy_maxhp maxhp
 alias dargor_vx_difficulty_enemy_maxmp maxmp
 alias dargor_vx_difficulty_enemy_atk atk
 alias dargor_vx_difficulty_enemy_def def
 alias dargor_vx_difficulty_enemy_spi spi
 alias dargor_vx_difficulty_enemy_agi agi
 alias dargor_vx_difficulty_enemy_hit hit
 alias dargor_vx_difficulty_enemy_eva eva
 alias dargor_vx_difficulty_enemy_exp exp
 alias dargor_vx_difficulty_enemy_gold gold
 #--------------------------------------------------------------------------
 # * Get Maximum HP
 #--------------------------------------------------------------------------
 def maxhp
  difficulty = $game_system.difficulty
  result = dargor_vx_difficulty_enemy_maxhp * difficulty[0]
  return result.round
 end
 #--------------------------------------------------------------------------
 # * Get Maximum MP
 #--------------------------------------------------------------------------
 def maxmp
  difficulty = $game_system.difficulty
  result = dargor_vx_difficulty_enemy_maxmp * difficulty[1]
  return result.round
 end
 #--------------------------------------------------------------------------
 # * Get Attack
 #--------------------------------------------------------------------------
 def atk
  difficulty = $game_system.difficulty
  result = dargor_vx_difficulty_enemy_atk * difficulty[2]
  return result.round
 end
 #--------------------------------------------------------------------------
 # * Get Defense
 #--------------------------------------------------------------------------
 def def
  difficulty = $game_system.difficulty
  result = dargor_vx_difficulty_enemy_def * difficulty[3]
  return result.round
 end
 #--------------------------------------------------------------------------
 # * Get Spirit
 #--------------------------------------------------------------------------
 def spi
  difficulty = $game_system.difficulty
  result = dargor_vx_difficulty_enemy_spi * difficulty[4]
  return result.round
 end
 #--------------------------------------------------------------------------
 # * Get Agility
 #--------------------------------------------------------------------------
 def agi
  difficulty = $game_system.difficulty
  result = dargor_vx_difficulty_enemy_agi * difficulty[5]
  return result.round
 end
 #--------------------------------------------------------------------------
 # * Get Hit Rate
 #--------------------------------------------------------------------------
 def hit
  difficulty = $game_system.difficulty
  result = dargor_vx_difficulty_enemy_hit * difficulty[6]
  result = [result, 100].min
  return result.round
 end
 #--------------------------------------------------------------------------
 # * Get Evasion Rate
 #--------------------------------------------------------------------------
 def eva
  difficulty = $game_system.difficulty
  result = dargor_vx_difficulty_enemy_eva * difficulty[7]
  result = [result, 100].min
  return result.round
 end
 #--------------------------------------------------------------------------
 # * Get EXP
 #--------------------------------------------------------------------------
 def exp
  difficulty = $game_system.difficulty
  result = dargor_vx_difficulty_enemy_exp * difficulty[6]
  return result.round
 end
 #--------------------------------------------------------------------------
 # * Get Gold
 #--------------------------------------------------------------------------
 def gold
  difficulty = $game_system.difficulty
  result = dargor_vx_difficulty_enemy_gold * difficulty[7]
  return result.round
 end
end
#==============================================================================
# ** Scene_Title
#------------------------------------------------------------------------------
#Â This class performs the title screen processing.
#==============================================================================
class Scene_Title < Scene_Base
 #--------------------------------------------------------------------------
 # * Alias Listing
 #--------------------------------------------------------------------------
 alias dargor_vx_difficulty_title_start start
 alias dargor_vx_difficulty_title_terminate terminate
 alias dargor_vx_difficulty_title_update update
 #--------------------------------------------------------------------------
 # * Start processing
 #--------------------------------------------------------------------------
 def start
  dargor_vx_difficulty_title_start
  create_difficulty_window
 end
 #--------------------------------------------------------------------------
 # * Termination Processing
 #--------------------------------------------------------------------------
 def terminate
  dargor_vx_difficulty_title_terminate
  @difficulty_window.dispose
  @help_window.dispose
 end
 #--------------------------------------------------------------------------
 # * Termination Processing
 #--------------------------------------------------------------------------
 def create_difficulty_window
  names = []
  for name in Difficulty::Names
   names << name
  end
  @difficulty_window = Window_Command.new(172, names)
  @difficulty_window.x = @command_window.x
  @difficulty_window.y = @command_window.y
  @difficulty_window.height = @command_window.height
  @difficulty_window.visible = false
  @difficulty_window.active = false
  @help_window = Window_Help.new
  @help_window.openness = 0
 end
 #--------------------------------------------------------------------------
 # * Frame Update
 #--------------------------------------------------------------------------
 def update
  @difficulty_window.update
  @help_window.update
  if @difficulty_window.active
   update_difficulty_window
   return
  end
  if @command_window.methods.include?('selection')
   condition = '@command_window.selection == Vocab::new_game'
  else
   condition = '@command_window.index == 0'
  end
  if Input.trigger?(Input::C) && eval(condition)
   if !@difficulty_window.active && Difficulty::In_Title
    Sound.play_decision
    @difficulty_window.visible = true
    @difficulty_window.active = true
    @help_window.open
    @command_window.visible = false
    @command_window.active = false
    return
   end
  end
  dargor_vx_difficulty_title_update
 end
 #--------------------------------------------------------------------------
 # * Frame Update (Difficulty)
 #--------------------------------------------------------------------------
 def update_difficulty_window
  if self.methods.include?('create_map_background')
   @spriteset.update
   $game_map.interpreter.update
   $game_map.update
  end
  if Input.trigger?(Input::B)
   Sound.play_cancel
   @difficulty_window.visible = false
   @difficulty_window.active = false
   @help_window.close
   @command_window.visible = true
   @command_window.active = true
  end
  if Input.trigger?(Input::C)
   close_difficulty_window
   command_new_game
  end
  id = $game_system.difficulty_id = @difficulty_window.index
  @help_window.set_text(Difficulty::Descriptions[id])
 end
 #--------------------------------------------------------------------------
 # * Close Command Window
 #--------------------------------------------------------------------------
 def close_difficulty_window
  @difficulty_window.close
  @help_window.close
  begin
   @difficulty_window.update
   @help_window.update
   Graphics.update
  end until @difficulty_window.openness == 0
 end
end
Credits and Thanks
Thanks to van helblaze for requesting this script.