At the moment I'm trying to mod the fuck out of a bunch of gubids and blizzards scripts. As a result, Ive come across a few problems where me and my ameteur ability to script have run into problems.
Secondly, I'm editing blizzards Difficulty system to make it so the difficulties are interchangeable through the menu.
Look for Scene_Diff on line 30. Whenever I call Scene_Diff, the script gets depressed and hangs itself. I can't figure out why and its driving me nuts. Thoughts?
Secondly, I'm editing blizzards Difficulty system to make it so the difficulties are interchangeable through the menu.
Code:
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
# Different Difficulties by Blizzard
# Version: 1.1b
# Date: 24.3.2007
# Date: 27.3.2008
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
#
# Instructions:
#
# Â You can always check the current difficulty of the game by using
# Â
# Â Â $game_system.difficulty_name == 'NAME'
# Â
# Â in your conditional branch. The NAMEs are the same as you specify in the
# Â configuration below.
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
Â
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# START Congfiguration
#
# Use the following template to create difficulties in your game
# ['NAME', EXP_RATE, GOLD_RATE, ACTOR_DAMAGE_RATE, ENEMY_DAMAGE_RATE]
# Note that all the "rates" are in %. Values over 100 will increase, values
# under 100 will decrease the given attribute. Of course you can add/remove
# any difficulties you want, be sure to separate them with commas.
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
Â
DIFFICULTIES = [['Pussy', 70, 50, 120, 70],
        ['Easier', 85, 90, 110, 85],
        ['Normal', 100, 100, 100, 100],
        ['Harder', 115, 110, 90, 115],
        ['Brutal', 130, 150, 80, 130]]
Â
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# END Congfiguration
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
Â
#==============================================================================
# Game_System
#==============================================================================
Â
class Game_System
Â
 attr_reader :difficulty_name
 attr_reader :exp_rate
 attr_reader :gold_rate
 attr_reader :actor_rate
 attr_reader :enemy_rate
Â
 def init_difficulty(index)
  @difficulty_name, @exp_rate, @gold_rate, @actor_rate, @enemy_rate =
    DIFFICULTIES[index]
 end
Â
end
Â
#==============================================================================
# Window_BattleResult
#==============================================================================
Â
class Window_BattleResult
Â
 attr_accessor :gold
 attr_accessor :exp
Â
end
Â
#==============================================================================
# Window_BattleStatus
#==============================================================================
Â
class Window_BattleStatus
Â
 attr_accessor :level_up_flags
Â
end
Â
#==============================================================================
# Game_Battler
#==============================================================================
Â
class Game_Battler
Â
 alias attack_effect_difficulty_later attack_effect
 def attack_effect(attacker)
  unless TONS_OF_ADDONS::DIFFICULTY
   return attack_effect_difficulty_later(attacker)
  end
  last_sr = self.sr if $crls && self.is_a?(Game_Actor)
  last_hp = self.hp
  result = attack_effect_difficulty_later(attacker)
  if result && self.damage.is_a?(Numeric)
   self.hp = last_hp
   self.hp = self.hp
   if attacker.is_a?(Game_Actor)
    self.sr = last_sr if $crls && self.is_a?(Game_Actor)
    self.damage = self.damage * $game_system.actor_rate / 100
   elsif attacker.is_a?(Game_Enemy)
    self.damage = self.damage * $game_system.enemy_rate / 100
   end
   self.hp -= self.damage
  end
  return result
 end
Â
 alias skill_effect_difficulty_later skill_effect
 def skill_effect(user, skill)
  unless TONS_OF_ADDONS::DIFFICULTY
   return skill_effect_difficulty_later(user, skill)
  end
  last_sr = self.sr if $crls && self.is_a?(Game_Actor)
  last_hp = self.hp
  result = skill_effect_difficulty_later(user, skill)
  if result && self.damage.is_a?(Numeric)
   self.hp = last_hp
   self.hp = self.hp
   if user.is_a?(Game_Actor)
    self.damage = self.damage * $game_system.actor_rate / 100
    self.sr = last_sr if $crls
   elsif user.is_a?(Game_Enemy)
    self.damage = self.damage * $game_system.enemy_rate / 100
   end
   self.hp -= self.damage
  end
  return result
 end
Â
end
Â
#==============================================================================
# Scene_Diff
#==============================================================================
Â
class Scene_Diff
Â
 def main
  $game_system.se_play($data_system.decision_se)
  d = []
  DIFFICULTIES.each {|diff| d.push(diff[0])}
  @difficulty_window = Window_Command.new(192, d)
  @difficulty_window.x = 320
  @difficulty_window.y = 280 -
    (@difficulty_window.height - 280) / 2
  @difficulty_window.back_opacity = 160
 end
 def update
  if @difficulty_window == nil
  else
   @difficulty_window.update
   if Input.trigger?(Input::B)
    $game_system.se_play($data_system.cancel_se)
    @difficulty_window.dispose
    @difficulty_window = nil
   elsif Input.trigger?(Input::C)
    $game_system.init_difficulty(@difficulty_window.index)
   end
  end
 end
Â
end
Â
#==============================================================================
# Scene_Battle
#==============================================================================
Â
class Scene_Battle
Â
 alias start_phase5_difficulty_later start_phase5
 def start_phase5
  unless TONS_OF_ADDONS::DIFFICULTY
   start_phase5_difficulty_later
   return
  end
  old_gold, old_exp = $game_party.gold, []
  $game_party.actors.each {|actor| old_exp.push(actor.exp)}
  start_phase5_difficulty_later
  new_gold = $game_party.gold - old_gold
  $game_party.lose_gold(new_gold)
  @result_window.gold = new_gold * $game_system.gold_rate / 100
  $game_party.gain_gold(@result_window.gold)
  new_exp = 0
  $game_party.actors.each_index {|i|
    new_exp = $game_party.actors[i].exp - old_exp[i]
    $game_party.actors[i].exp = old_exp[i]}
  @result_window.exp = new_exp * $game_system.exp_rate / 100
  @result_window.refresh
  $game_party.actors.each_index {|i|
    @status_window.level_up_flags[i] = false
    unless $game_party.actors[i].cant_get_exp?
     last_level = $game_party.actors[i].level
     $game_party.actors[i].exp += @result_window.exp
     @status_window.level_up(i) if $game_party.actors[i].level > last_level
    end}
 end
Â
end