Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #==============================================================================
- # Battle Difficulties
- # Version 1.1
- # By Szyu
- #
- # About:
- # Enables stronger and weaker battle difficulies
- #
- # Instructions:
- # - Place below "▼ Materials" but above "▼ Main Process".
- #
- # How to Use:
- # Call script with "$game_party.set_difficulty(x)", where x represents one of
- # the keys in the difficulty set GAME_DIFFICULTIES
- # $game_party.set_difficulty(:normal)
- #
- # Updates (Pastebin):
- # http://adf.ly/4920670/battle-difficulties
- #
- #==============================================================
- # * Configuration
- #==============================================================
- # Set of difficulties
- GAME_DIFFICULTIES = {
- :easy => 0.75,
- :normal => 1.0,
- :hard => 1.35,
- :insane => 4.0
- }
- # Difficulty when started new game
- START_DIFFICULTY = :normal
- #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- #==============================================================
- # * Game_Party
- #==============================================================
- class Game_Party < Game_Unit
- alias init_game_dif_sz initialize
- attr_reader :game_difficulty
- attr_reader :difficulty_rate
- def initialize
- init_game_dif_sz
- @game_difficulty = START_DIFFICULTY
- set_difficulty(@game_difficulty)
- end
- def set_difficulty(dif)
- @game_difficulty = dif
- @difficulty_rate = GAME_DIFFICULTIES[@game_difficulty]
- apply_new_difficulty
- end
- def get_difficulty_text
- return @game_difficulty.to_s
- end
- def apply_new_difficulty
- db_en = load_data("Data/Enemies.rvdata2")
- $data_enemies.each do |en|
- next if en.nil?
- en.gold = (db_en[en.id].gold * @difficulty_rate).to_i
- en.exp = (db_en[en.id].exp * @difficulty_rate).to_i
- for i in 0..en.params.size-1
- en.params[i] = (db_en[en.id].params[i] * @difficulty_rate).to_i
- end
- for i in 0..en.drop_items.size-1
- en.drop_items[i].denominator = (db_en[en.id].drop_items[i].denominator * @difficulty_rate).to_i
- end
- end
- end
- end
- #==============================================================
- # * DataManager
- #==============================================================
- class << DataManager
- alias load_dif_sz extract_save_contents
- def extract_save_contents(contents)
- load_dif_sz(contents)
- $game_party.set_difficulty($game_party.game_difficulty)
- end
- end
Add Comment
Please, Sign In to add comment