- Joined
- May 16, 2020
- Messages
- 187
- Reaction score
- 6
- First Language
- English
- Primarily Uses
- RMXP
i have this script called Different Difficulties for Tons of Add-ons
but it errors at line 98
vvvvvvvv
do you have any ideas how to fix it?
Code:
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
# Different Difficulties by Blizzard
# Version: 1.3b
# Date: 24.3.2007
# Date v1.1b: 27.3.2008
# Date v1.2b: 18.4.2008
# Date v1.3b: 22.4.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.
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
if TONS_OF_ADDONS::DIFFICULTY
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# 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 = [['Peaceful', 250, 250, 200, 50],
['Easy', 150, 150, 160, 75],
['Normal', 100, 100, 100, 100],
['Hard', 80, 80, 80, 160],
['Hardcore', 50, 50, 50, 200]]
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# 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)
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)
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_Title
#==============================================================================
class Scene_Title
alias main_difficulties_later main
def main
main_difficulties_later
@difficulty_window.dispose if @difficulty_window != nil
end
alias command_new_game_difficulties_later command_new_game
def command_new_game
$game_system.se_play($data_system.decision_se)
d = []
DIFFICULTIES.each {|diff| d.push(diff[0])}
@difficulty_window = Window_Command.new(@command_window.width, d)
@difficulty_window.x = @command_window.x
@difficulty_window.y = @command_window.y -
(@difficulty_window.height - @command_window.height) / 2
@difficulty_window.back_opacity = @command_window.back_opacity
@command_window.active = @command_window.visible = false
end
alias upd_difficulties_later update
def update
if @difficulty_window == nil
upd_difficulties_later
return
end
@difficulty_window.update unless defined?(SDK)
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
@command_window.active = @command_window.visible = true
@difficulty_window.dispose
@difficulty_window = nil
elsif Input.trigger?(Input::C)
command_new_game_difficulties_later
$game_system.init_difficulty(@difficulty_window.index)
end
end
end
#==============================================================================
# Scene_Battle
#==============================================================================
class Scene_Battle
alias start_phase5_difficulty_later start_phase5
def start_phase5
old_gold, old_exp, old_levels = $game_party.gold, [], []
$game_party.actors.each {|actor|
old_exp.push(actor.exp)
old_levels.push(actor.level)}
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|
if $game_party.actors[i].exp - old_exp[i] > 0
new_exp = $game_party.actors[i].exp - old_exp[i]
end
$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?
$game_party.actors[i].exp += @result_window.exp
@status_window.level_up(i) if $game_party.actors[i].level > old_levels[i]
end}
end
end
end
vvvvvvvv
Code:
self.damage = self.damage * $game_system.actor_rate / 100





















