Difficulty Selection

Discussion in 'RGSS3 Scripts (RMVX Ace)' started by Todd, Jun 26, 2012.

    Tags:
  1. Todd

    Todd Game Developer Member

    Messages:
    269
    Likes Received:
    41
    First Language:
    English
    Primarily Uses:
    N/A
    Difficulty Selection 1.0.0

    by Todd (or DoctorTodd on RMRK)

    Introduction

    Lets the player select the games difficulty. Each difficulty multiplies the enemies parameters.

    Screenshot:

    http://desmond.image...png&res=landing

    Features

    • Option to add to menu.
    • Pick between easy, normal, heroic, hard.
    How to UsePaste above main.

    Configure the script to the way you like it.

    Script

    #===============================================================================## DT's Difficulty# Author: DoctorTodd# Date (06/24/2012)# Version: (1.0.0) (VXA)# Level: (Medium)# Email: Todd@beacongames.com##===============================================================================## NOTES: 1)This script will only work with ace.# 2)A difficulty must be selected before the first battle or the game WILL# CRASH.##===============================================================================## Description: Lets the player select the games difficulty.## Credits: Me (DoctorTodd), D&P3 for saving bug fix.##===============================================================================## Instructions# Paste above main.##===============================================================================## Free for any use as long as I'm credited.##===============================================================================## Editing begins 38 and ends on 71.##===============================================================================module TODDDIFFICULTY #Easy Text. EASYT = "Easy" #Normal Text. NORMALT = "Normal" #Heroic Text. HEROICT = "Heroic" #Hard Text. HARDT = "Hard" #Easy enemy parameters multiplier. EASYM = 0.5 #Heroic enemy parameters multiplier (Normal is skipped since it's what put #you into the database). HEROICM = 1.5 #Hard enemy parameters multiplier. HARDM = 2 #The text above where the selection is made. TEXT = "Please select a difficulty:" #Menu command? MENU = true #Sound effect to play when difficulty is selected. SE = "Darkness8" #Switch to allow cancelling the difficulty selection. #MUST NOT BE ON WHEN SELECTING FOR THE FIRST TIME. SWITCH = 5end#==============================================================================# ** Game_Enemy#------------------------------------------------------------------------------# This class handles enemies. It used within the Game_Troop class# ($game_troop).#==============================================================================class Game_Enemy < Game_Battler #-------------------------------------------------------------------------- # * Get Base Value of Parameter #-------------------------------------------------------------------------- alias todd_difficulty_gmen_param_base param_base def param_base(param_id, *args) n1 = todd_difficulty_gmen_param_base(param_id, *args) n2 = case $game_system.todd_difficulty when 0 then TODDDIFFICULTY::EASYM when 1 then 1 when 2 then TODDDIFFICULTY::HEROICM when 3 then TODDDIFFICULTY::HARDM end return n1 * n2 endend#==============================================================================# ** Game_System#------------------------------------------------------------------------------# This class handles system data. It saves the disable state of saving and# menus. Instances of this class are referenced by $game_system.#==============================================================================class Game_System #-------------------------------------------------------------------------- # * Public Instance Variables #-------------------------------------------------------------------------- attr_accessor :todd_difficulty # save forbidden #-------------------------------------------------------------------------- # * Object Initialization #-------------------------------------------------------------------------- alias todd_difficulty_gamesystem_init initialize def initialize @todd_difficulty = 0 todd_difficulty_gamesystem_init endend#==============================================================================# ** Window_DifficultySelection#==============================================================================class Window_DifficultySelection < Window_HorzCommand #-------------------------------------------------------------------------- # * Object Initialization #-------------------------------------------------------------------------- def initialize super(0, 0) end #-------------------------------------------------------------------------- # * Get Window Width #-------------------------------------------------------------------------- def window_width Graphics.width/2 + 20 end #-------------------------------------------------------------------------- # * Get Digit Count #-------------------------------------------------------------------------- def col_max return 4 end #-------------------------------------------------------------------------- # * Create Command List #-------------------------------------------------------------------------- def make_command_list add_command(TODDDIFFICULTY::EASYT, :easy) add_command(TODDDIFFICULTY::NORMALT, :normal) add_command(TODDDIFFICULTY::HEROICT, :heroic) add_command(TODDDIFFICULTY::HARDT, :hard) endend#==============================================================================# ** Window_DifficultyName#==============================================================================class Window_DifficultyName < Window_Base #-------------------------------------------------------------------------- # * Object Initialization #-------------------------------------------------------------------------- def initialize super(0, 0, window_width, fitting_height(1)) refresh end #-------------------------------------------------------------------------- # * Get Window Width #-------------------------------------------------------------------------- def window_width return Graphics.width/2 + 20 end #-------------------------------------------------------------------------- # * Refresh #-------------------------------------------------------------------------- def refresh contents.clear draw_text(15, -27, 400, 80, TODDDIFFICULTY::TEXT) endend#==============================================================================# ** Scene_Difficulty#==============================================================================class Scene_Difficulty < Scene_MenuBase #-------------------------------------------------------------------------- # * Start Processing #-------------------------------------------------------------------------- def start super create_command_window create_name_window end #-------------------------------------------------------------------------- # * Create Command Window #-------------------------------------------------------------------------- def create_command_window @command_window = Window_DifficultySelection.new @command_window.set_handler:)easy, method:)command_easy)) @command_window.set_handler:)normal, method:)command_normal)) @command_window.set_handler:)heroic, method:)command_heroic)) @command_window.set_handler:)hard, method:)command_hard)) @command_window.set_handler:)cancel, method:)return_scene))if $game_switches[TODDDIFFICULTY::SWITCH] == true @command_window.x = Graphics.width/2 - 170 @command_window.y = Graphics.height/2 - 50 end #-------------------------------------------------------------------------- # * Create Difficulty Window #-------------------------------------------------------------------------- def create_name_window @name_window = Window_DifficultyName.new @name_window.x = Graphics.width/2 - 170 @name_window.y = Graphics.height/2 - 97 end #-------------------------------------------------------------------------- # * [easy] Command #-------------------------------------------------------------------------- def command_easy $game_system.todd_difficulty = 0 Audio.se_play("Audio/SE/" + TODDDIFFICULTY::SE, 100, 100) return_scene end #-------------------------------------------------------------------------- # * [normal] Command #-------------------------------------------------------------------------- def command_normal $game_system.todd_difficulty = 1 Audio.se_play("Audio/SE/" + TODDDIFFICULTY::SE, 100, 100) return_scene end #-------------------------------------------------------------------------- # * [heroic] Command #-------------------------------------------------------------------------- def command_heroic $game_system.todd_difficulty = 2 Audio.se_play("Audio/SE/" + TODDDIFFICULTY::SE, 100, 100) return_scene end #-------------------------------------------------------------------------- # * [hard] Command #-------------------------------------------------------------------------- def command_hard $game_system.todd_difficulty = 3 Audio.se_play("Audio/SE/" + TODDDIFFICULTY::SE, 100, 100) return_scene end end if TODDDIFFICULTY::MENU == true#==============================================================================# ** Scene_Menu#------------------------------------------------------------------------------# This class performs the menu screen processing.#==============================================================================class Scene_Menu < Scene_MenuBase #-------------------------------------------------------------------------- # * Create Command Window #-------------------------------------------------------------------------- alias todd_dif_menu_add_menu_command create_command_window def create_command_window todd_dif_menu_add_menu_command @command_window.set_handler:)dif, method:)command_dif)) endend #-------------------------------------------------------------------------- # * [Difficulty] Command #-------------------------------------------------------------------------- def command_dif SceneManager.call(Scene_Difficulty) endendif TODDDIFFICULTY::MENU == true#==============================================================================# ** Window_MenuCommand#------------------------------------------------------------------------------# This command window appears on the menu screen.#==============================================================================class Window_MenuCommand < Window_Command #-------------------------------------------------------------------------- # * Add Main Commands to List #-------------------------------------------------------------------------- alias todd_dif_menu_command_add_to_menu add_main_commands def add_main_commands todd_dif_menu_command_add_to_menu add_command("Difficulty", :dif, main_commands_enabled) end endend 
    FAQ

    None right now.

    Credit and Thanks

    - Todd

    Author's Notes

    See the header of the script.
     
    Last edited by a moderator: Jun 1, 2013
    #1
  2. Chaos_Prime

    Chaos_Prime Villager Member

    Messages:
    20
    Likes Received:
    2
    First Language:
    English
    I'm wondering how would this be effective?

    I mean what does it ultimately change?

    It's a good idea if you want to change difficulty for it, but to be honest

    there's lacking information as to what this does.

    Does it change the stats on the enemies, change how much items cost,

    change how much exp and gold you obtain per monster/battle, and also

    change how much damage the heroes do in battle?
     
    #2
  3. Todd

    Todd Game Developer Member

    Messages:
    269
    Likes Received:
    41
    First Language:
    English
    Primarily Uses:
    N/A
    Each difficulty multiplies the enemies parameters, so HP, MP, attack, ect. I'll edit my post to give more detail.
     
    Last edited by a moderator: Jun 26, 2012
    #3
  4. AlaiaVee

    AlaiaVee Villager Member

    Messages:
    76
    Likes Received:
    21
    First Language:
    English
    Might be just me, but when I hear "Heroic" I think of something much more difficult to perform than "Hard".

    As for the concept, I love games with increasing difficulty that force me to come up with new strategies. Some games pull this off well and others not so much. When it's just the same enemies as in the "Normal" level that take longer to kill and more potions to keep me alive because they have more hit points and hit harder, well, frankly that gets old quick. I'd recommend if you do use this that you try to make enemies use new skills or more intelligent strategies on the harder levels so that the player has to adapt.
     
    #4
  5. Todd

    Todd Game Developer Member

    Messages:
    269
    Likes Received:
    41
    First Language:
    English
    Primarily Uses:
    N/A
    Your the second person to say that. :lol:

    You get to customize the names any way but I do see what your saying. I kind of did the names like Halo 3.
     
    #5
  6. Camupins

    Camupins Villager Member

    Messages:
    17
    Likes Received:
    0
    First Language:
    English
    Maybe I'm not seeing it, but what is the script call for this window if I don't want it to show on the menu? :(
     
    #6
  7. Todd

    Todd Game Developer Member

    Messages:
    269
    Likes Received:
    41
    First Language:
    English
    Primarily Uses:
    N/A
    Oh sorry.



    Code:
    SceneManager.call(Scene_Difficulty)
     
    #7
  8. Camupins

    Camupins Villager Member

    Messages:
    17
    Likes Received:
    0
    First Language:
    English
    Thank you! Nice script btw. :)
     
    #8
  9. Todd

    Todd Game Developer Member

    Messages:
    269
    Likes Received:
    41
    First Language:
    English
    Primarily Uses:
    N/A
    Thanks. :)
     
    #9
  10. Lorenze

    Lorenze Veteran Veteran

    Messages:
    813
    Likes Received:
    437
    Location:
    United States
    First Language:
    English
    Primarily Uses:
    RMMV
    Awesome script, I'm definetly using this.

    By the way, if you're thinking of adding more features, it'd be cool

    to have a switch turn on depending on what difficulty level you've chosen. This could

    lock/unlock stuff in the game (if you're on Hard, more dungeons accessible, etc.)
     
    #10
  11. Todd

    Todd Game Developer Member

    Messages:
    269
    Likes Received:
    41
    First Language:
    English
    Primarily Uses:
    N/A
    Like this. :)

    Code:
    #===============================================================================
    #
    # DT's Difficulty
    # Author: DoctorTodd
    # Date (06/24/2012)
    # Version: (1.0.1) (VXA)
    # Level: (Medium)
    # Email: Todd@beacongames.com
    #
    #===============================================================================
    #
    # NOTES: 1)This script will only work with ace.
    # 2)A difficulty must be selected before the first battle or the game WILL
    # CRASH.
    #
    #===============================================================================
    #
    # Description: Lets the player select the games difficulty.
    #
    # Credits: Me (DoctorTodd)
    #
    #===============================================================================
    #
    # Instructions
    # Paste above main.
    #
    #===============================================================================
    #
    # Free for any use as long as I'm credited.
    #
    #===============================================================================
    #
    # Editing begins 38 and ends on 83.
    #
    #===============================================================================
    module TODDDIFFICULTY
    
    #Easy Text.
    EASYT = "Easy"
    
    #Normal Text.
    NORMALT = "Normal"
    
    #Heroic Text.
    HEROICT = "Heroic"
    
    #Hard Text.
    HARDT = "Hard"
    
    #Easy enemy parameters multiplier.
    EASYM = 0.5
    
    #Heroic enemy parameters multiplier (Normal is skipped since it's what put
    #you into the database).
    HEROICM = 1.5
    
    #Hard enemy parameters multiplier.
    HARDM = 2
    
    #The text above where the selection is made.
    TEXT = "Please select a difficulty:"
    
    #Menu command?
    MENU = true
    
    #Sound effect to play when difficulty is selected.
    SE = "Darkness8"
    
    #Switch to allow cancelling the difficulty selection.
    #MUST NOT BE ON WHEN SELECTING FOR THE FIRST TIME.
    SWITCH = 5
    
    #Easy Switch (Switch to be activated)
    ES = 1
    
    #Normal Switch (Switch to be activated)
    ES = 1
    
    #heroic Switch (Switch to be activated)
    HS = 1
    
    #Hard Switch (Switch to be activated)
    HAS = 1
    end
    #==============================================================================
    # ** Game_Enemy
    #------------------------------------------------------------------------------
    # This class handles enemies. It used within the Game_Troop class
    # ($game_troop).
    #==============================================================================
    
    class Game_Enemy < Game_Battler
    #--------------------------------------------------------------------------
    # * Get Base Value of Parameter
    #--------------------------------------------------------------------------
    def param_base(param_id)
    case $difficulty
    when 0
    enemy.params[param_id] * TODDDIFFICULTY::EASYM
    when 1
    enemy.params[param_id]
    when 2
    enemy.params[param_id] * TODDDIFFICULTY::HEROICM
    when 3
    enemy.params[param_id] * TODDDIFFICULTY::HARDM
    end
    end
    end
    #==============================================================================
    # ** Window_DifficultySelection
    #==============================================================================
    
    class Window_DifficultySelection < Window_HorzCommand
    #--------------------------------------------------------------------------
    # * Object Initialization
    #--------------------------------------------------------------------------
    def initialize
    super(0, 0)
    end
    #--------------------------------------------------------------------------
    # * Get Window Width
    #--------------------------------------------------------------------------
    def window_width
    Graphics.width/2 + 20
    end
    #--------------------------------------------------------------------------
    # * Get Digit Count
    #--------------------------------------------------------------------------
    def col_max
    return 4
    end
    #--------------------------------------------------------------------------
    # * Create Command List
    #--------------------------------------------------------------------------
    def make_command_list
    add_command(TODDDIFFICULTY::EASYT, :easy)
    add_command(TODDDIFFICULTY::NORMALT, :normal)
    add_command(TODDDIFFICULTY::HEROICT, :heroic)
    add_command(TODDDIFFICULTY::HARDT, :hard)
    end
    end
    #==============================================================================
    # ** Window_DifficultyName
    #==============================================================================
    
    class Window_DifficultyName < Window_Base
    #--------------------------------------------------------------------------
    # * Object Initialization
    #--------------------------------------------------------------------------
    def initialize
    super(0, 0, window_width, fitting_height(1))
    refresh
    end
    #--------------------------------------------------------------------------
    # * Get Window Width
    #--------------------------------------------------------------------------
    def window_width
    return Graphics.width/2 + 20
    end
    #--------------------------------------------------------------------------
    # * Refresh
    #--------------------------------------------------------------------------
    def refresh
    contents.clear
    draw_text(15, -27, 400, 80, TODDDIFFICULTY::TEXT)
    end
    end
    #==============================================================================
    # ** Scene_Difficulty
    #==============================================================================
    
    class Scene_Difficulty < Scene_MenuBase
    #--------------------------------------------------------------------------
    # * Start Processing
    #--------------------------------------------------------------------------
    def start
    super
    create_command_window
    create_name_window
    end
    #--------------------------------------------------------------------------
    # * Create Command Window
    #--------------------------------------------------------------------------
    def create_command_window
    @command_window = Window_DifficultySelection.new
    @command_window.set_handler(:easy, method(:command_easy))
    @command_window.set_handler(:normal, method(:command_normal))
    @command_window.set_handler(:heroic, method(:command_heroic))
    @command_window.set_handler(:hard, method(:command_hard))
    @command_window.set_handler(:cancel, method(:return_scene))if $game_switches[TODDDIFFICULTY::SWITCH] == true
    @command_window.x = Graphics.width/2 - 170
    @command_window.y = Graphics.height/2 - 50
    end
    #--------------------------------------------------------------------------
    # * Create Difficulty Window
    #--------------------------------------------------------------------------
    def create_name_window
    @name_window = Window_DifficultyName.new
    @name_window.x = Graphics.width/2 - 170
    @name_window.y = Graphics.height/2 - 97
    end
    #--------------------------------------------------------------------------
    # * [easy] Command
    #--------------------------------------------------------------------------
    def command_easy
    $difficulty = 0
    $game_switches[TODDDIFFICULTY::ES] = true
    Audio.se_play("Audio/SE/" + TODDDIFFICULTY::SE, 100, 100)
    return_scene
    end
    #--------------------------------------------------------------------------
    # * [normal] Command
    #--------------------------------------------------------------------------
    def command_normal
    $difficulty = 1
    $game_switches[TODDDIFFICULTY::NS] = true
    Audio.se_play("Audio/SE/" + TODDDIFFICULTY::SE, 100, 100)
    return_scene
    end
    #--------------------------------------------------------------------------
    # * [heroic] Command
    #--------------------------------------------------------------------------
    def command_heroic
    $difficulty = 2
    $game_switches[TODDDIFFICULTY::HS] = true
    Audio.se_play("Audio/SE/" + TODDDIFFICULTY::SE, 100, 100)
    return_scene
    end
    #--------------------------------------------------------------------------
    # * [hard] Command
    #--------------------------------------------------------------------------
    def command_hard
    $difficulty = 3
    $game_switches[TODDDIFFICULTY::HAS] = true
    Audio.se_play("Audio/SE/" + TODDDIFFICULTY::SE, 100, 100)
    return_scene
    end
    end
    if TODDDIFFICULTY::MENU == true
    #==============================================================================
    # ** Scene_Menu
    #------------------------------------------------------------------------------
    # This class performs the menu screen processing.
    #==============================================================================
    
    class Scene_Menu < Scene_MenuBase
    #--------------------------------------------------------------------------
    # * Create Command Window
    #--------------------------------------------------------------------------
    alias todd_dif_menu_add_menu_command create_command_window
    def create_command_window
    todd_dif_menu_add_menu_command
    @command_window.set_handler(:dif, method(:command_dif))
    end
    end
    #--------------------------------------------------------------------------
    # * [Difficulty] Command
    #--------------------------------------------------------------------------
    def command_dif
    SceneManager.call(Scene_Difficulty)
    end
    end
    
    if TODDDIFFICULTY::MENU == true
    #==============================================================================
    # ** Window_MenuCommand
    #------------------------------------------------------------------------------
    # This command window appears on the menu screen.
    #==============================================================================
    
    class Window_MenuCommand < Window_Command
    #--------------------------------------------------------------------------
    # * Add Main Commands to List
    #--------------------------------------------------------------------------
    alias todd_dif_menu_command_add_to_menu add_main_commands
    def add_main_commands
    todd_dif_menu_command_add_to_menu
    add_command("Difficulty", :dif, main_commands_enabled)
    end
    end
    end
     
    #11
  12. Lorenze

    Lorenze Veteran Veteran

    Messages:
    813
    Likes Received:
    437
    Location:
    United States
    First Language:
    English
    Primarily Uses:
    RMMV
    Oh my god, I love you. HAVE MY BABIES ;_;

    Really though, this is awesome, thanks!
     
    #12
  13. Todd

    Todd Game Developer Member

    Messages:
    269
    Likes Received:
    41
    First Language:
    English
    Primarily Uses:
    N/A
    Your welcome. :)
     
    #13
  14. Lorenze

    Lorenze Veteran Veteran

    Messages:
    813
    Likes Received:
    437
    Location:
    United States
    First Language:
    English
    Primarily Uses:
    RMMV
    I got this bug here:

    [​IMG]

    It only happens when I select the 'Normal' difficulty, it works fine with

    the others. I also should mention I'm using Yanfly's battle engine.
     
    #14
  15. Todd

    Todd Game Developer Member

    Messages:
    269
    Likes Received:
    41
    First Language:
    English
    Primarily Uses:
    N/A
    Oops, just change line 77 to this.



    Code:
    NS = 1
    
     
    #15
  16. Todd

    Todd Game Developer Member

    Messages:
    269
    Likes Received:
    41
    First Language:
    English
    Primarily Uses:
    N/A
    Recently I found out this script is incompatible with every ABS (Sapphire, XAS, ect... ). You can run the game but you can't load.
     
    #16
  17. hyde9318

    hyde9318 RMC Coordinator Veteran

    Messages:
    2,593
    Likes Received:
    680
    Location:
    Michigan, USA
    First Language:
    English
    Primarily Uses:
    RMMV
    Well now.. that is useful info. I was going to put this into a project that uses sapphire, so you couldnt have said that at a better time.
     
    #17
  18. amerk

    amerk Veteran Member

    Messages:
    1,439
    Likes Received:
    510
    First Language:
    English
    This is pretty dope, Todd, and a perfect solution to people who claim a game is too easy or too difficult without having to manually event all of this.
     
    #18
  19. Todd

    Todd Game Developer Member

    Messages:
    269
    Likes Received:
    41
    First Language:
    English
    Primarily Uses:
    N/A
    I'm glad you like it!
     
    #19
  20. Todd

    Todd Game Developer Member

    Messages:
    269
    Likes Received:
    41
    First Language:
    English
    Primarily Uses:
    N/A
    Fixed a massive bug that caused the need for a difficulty to be selected again when a game is loaded.

    Code:
    #===============================================================================
    #
    # DT's Difficulty
    # Author: DoctorTodd
    # Date (06/24/2012)
    # Version: (1.0.0) (VXA)
    # Level: (Medium)
    # Email: Todd@beacongames.com
    #
    #===============================================================================
    #
    # NOTES: 1)This script will only work with ace.
    #        2)A difficulty must be selected before the first battle or the game WILL
    #        CRASH.
    #
    #===============================================================================
    #
    # Description: Lets the player select the games difficulty.
    #
    # Credits: Me (DoctorTodd)
    #
    #===============================================================================
    #
    # Instructions
    # Paste above main.
    #
    #===============================================================================
    #
    # Free for any use as long as I'm credited.
    #
    #===============================================================================
    #
    # Editing begins 38 and ends on 71.
    #
    #===============================================================================
    module TODDDIFFICULTY
    
      #Easy Text.
      EASYT = "Easy"
    
      #Normal Text.
      NORMALT = "Normal"
    
      #Heroic Text.
      HEROICT = "Heroic"
    
      #Hard Text.
      HARDT = "Hard"
    
      #Easy enemy parameters multiplier.
      EASYM = 0.5
    
      #Heroic enemy parameters multiplier (Normal is skipped since it's what put
      #you into the database).
      HEROICM = 1.5
    
      #Hard enemy parameters multiplier.
      HARDM = 2
    
      #The text above where the selection is made.
      TEXT = "Please select a difficulty:"
    
      #Menu command?
      MENU = true
    
      #Sound effect to play when difficulty is selected.
      SE = "Darkness8"
    
      #Switch to allow cancelling the difficulty selection.
      #MUST NOT BE ON WHEN SELECTING FOR THE FIRST TIME.
      SWITCH = 5
    
    end
    #==============================================================================
    # ** Game_Enemy
    #------------------------------------------------------------------------------
    #  This class handles enemies. It used within the Game_Troop class
    # ($game_troop).
    #==============================================================================
    
    class Game_Enemy < Game_Battler
      #--------------------------------------------------------------------------
      # * Get Base Value of Parameter
      #--------------------------------------------------------------------------
      def param_base(param_id)
      case $difficulty
      when 0
      enemy.params[param_id] * TODDDIFFICULTY::EASYM
      when 1
      enemy.params[param_id]
      when 2
      enemy.params[param_id] * TODDDIFFICULTY::HEROICM
      when 3
      enemy.params[param_id] * TODDDIFFICULTY::HARDM
      else
      enemy.params[param_id]
      end
     end
    end
    #==============================================================================
    # ** BattleManager
    #------------------------------------------------------------------------------
    #  This module manages battle progress.
    #==============================================================================
    
    module BattleManager
      #--------------------------------------------------------------------------
      # * Setup
      #--------------------------------------------------------------------------
      def self.setup(troop_id, can_escape = true, can_lose = false)
        init_members
        $difficulty = $difficulty
        $game_troop.setup(troop_id)
        @can_escape = can_escape
        @can_lose = can_lose
        make_escape_ratio
      end
    end
    #==============================================================================
    # ** Window_DifficultySelection
    #==============================================================================
    
    class Window_DifficultySelection < Window_HorzCommand
      #--------------------------------------------------------------------------
      # * Object Initialization
      #--------------------------------------------------------------------------
      def initialize
        super(0, 0)
      end
      #--------------------------------------------------------------------------
      # * Get Window Width
      #--------------------------------------------------------------------------
      def window_width
        Graphics.width/2 + 20
      end
      #--------------------------------------------------------------------------
      # * Get Digit Count
      #--------------------------------------------------------------------------
      def col_max
        return 4
      end
      #--------------------------------------------------------------------------
      # * Create Command List
      #--------------------------------------------------------------------------
      def make_command_list
        add_command(TODDDIFFICULTY::EASYT,     :easy)
        add_command(TODDDIFFICULTY::NORMALT,   :normal)
        add_command(TODDDIFFICULTY::HEROICT,    :heroic)
        add_command(TODDDIFFICULTY::HARDT, :hard)
      end
    end
    #==============================================================================
    # ** Window_DifficultyName
    #==============================================================================
    
    class Window_DifficultyName < Window_Base
      #--------------------------------------------------------------------------
      # * Object Initialization
      #--------------------------------------------------------------------------
      def initialize
        super(0, 0, window_width, fitting_height(1))
        refresh
      end
      #--------------------------------------------------------------------------
      # * Get Window Width
      #--------------------------------------------------------------------------
      def window_width
        return Graphics.width/2 + 20
      end
      #--------------------------------------------------------------------------
      # * Refresh
      #--------------------------------------------------------------------------
      def refresh
        contents.clear
        draw_text(15, -27, 400, 80, TODDDIFFICULTY::TEXT)
      end
    end
    #==============================================================================
    # ** Scene_Difficulty
    #==============================================================================
    
    class Scene_Difficulty < Scene_MenuBase
      #--------------------------------------------------------------------------
      # * Start Processing
      #--------------------------------------------------------------------------
      def start
        super
        create_command_window
        create_name_window
      end
      #--------------------------------------------------------------------------
      # * Create Command Window
      #--------------------------------------------------------------------------
      def create_command_window
        @command_window = Window_DifficultySelection.new
        @command_window.set_handler(:easy,      method(:command_easy))
        @command_window.set_handler(:normal,     method(:command_normal))
        @command_window.set_handler(:heroic,     method(:command_heroic))
        @command_window.set_handler(:hard,    method(:command_hard))
        @command_window.set_handler(:cancel,    method(:return_scene))if $game_switches[TODDDIFFICULTY::SWITCH] == true
        @command_window.x = Graphics.width/2 - 170
        @command_window.y = Graphics.height/2 - 50
      end
      #--------------------------------------------------------------------------
      # * Create Difficulty Window
      #--------------------------------------------------------------------------
      def create_name_window
        @name_window = Window_DifficultyName.new
        @name_window.x = Graphics.width/2 - 170
        @name_window.y = Graphics.height/2 - 97
      end
      #--------------------------------------------------------------------------
      # * [easy] Command
      #--------------------------------------------------------------------------
      def command_easy
        $difficulty = 0
        Audio.se_play("Audio/SE/" + TODDDIFFICULTY::SE, 100, 100)
        return_scene
       end
      #--------------------------------------------------------------------------
      # * [normal] Command
      #--------------------------------------------------------------------------
      def command_normal
        $difficulty = 1
        Audio.se_play("Audio/SE/" + TODDDIFFICULTY::SE, 100, 100)
        return_scene
       end
      #--------------------------------------------------------------------------
      # * [heroic] Command
      #--------------------------------------------------------------------------
      def command_heroic
        $difficulty = 2
          Audio.se_play("Audio/SE/" + TODDDIFFICULTY::SE, 100, 100)
        return_scene
       end
      #--------------------------------------------------------------------------
      # * [hard] Command
      #--------------------------------------------------------------------------
      def command_hard
        $difficulty = 3
            Audio.se_play("Audio/SE/" + TODDDIFFICULTY::SE, 100, 100)
        return_scene
       end
     end
     if TODDDIFFICULTY::MENU == true
    #==============================================================================
    # ** Scene_Menu
    #------------------------------------------------------------------------------
    #  This class performs the menu screen processing.
    #==============================================================================
    
    class Scene_Menu < Scene_MenuBase
      #--------------------------------------------------------------------------
      # * Create Command Window
      #--------------------------------------------------------------------------
      alias todd_dif_menu_add_menu_command create_command_window
      def create_command_window
        todd_dif_menu_add_menu_command
        @command_window.set_handler(:dif,      method(:command_dif))
      end
    end
      #--------------------------------------------------------------------------
      # * [Difficulty] Command
      #--------------------------------------------------------------------------
      def command_dif
      SceneManager.call(Scene_Difficulty)
      end
    end
    
    if TODDDIFFICULTY::MENU == true
    #==============================================================================
    # ** Window_MenuCommand
    #------------------------------------------------------------------------------
    #  This command window appears on the menu screen.
    #==============================================================================
    
    class Window_MenuCommand < Window_Command
      #--------------------------------------------------------------------------
      # * Add Main Commands to List
      #--------------------------------------------------------------------------
      alias todd_dif_menu_command_add_to_menu add_main_commands
      def add_main_commands
         todd_dif_menu_command_add_to_menu
        add_command("Difficulty",   :dif,   main_commands_enabled)
      end
     end
    end
    
     
    #20

Share This Page