#==============================================================================
# ** Difficulties
#------------------------------------------------------------------------------
# © Dargor, 2008
# 24/06/08
# Version 1.1
# Pedido do van hellblaze
# Tradução para português: Rafidelis
# www.ReinoRpg.com
#------------------------------------------------------------------------------
# HISTORICO DAS VERSÕES
# - 1.0 (24/06/08), Versão inicial
# - 1.1 (24/06/08),Adicionada EXP e Gold modificações
#------------------------------------------------------------------------------
# INSTRUÇÕES:
# - Cole Acima do Main
# - Edit as constates no modulo de Dificuldade
#==============================================================================
#==============================================================================
# ** Modulo de Configyração da Dificuldade
#==============================================================================
module Difficulty
# Default difficulty
Default = 1 # medium
# Difficulty names
Names = [
'Easy',
'Normal',
'Difficult',
'Extreme'
]
# Descrições das dificuldades
Descriptions = [
'Settings for beginners',
'Normal Settings',
'Settings for advanced players',
"Settings for players that are ready to die"
]
# Modificar estados do inimigo
# HP MP ATK DEF SPI AGI Hit de Evasão 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]
]
# Disponivel na tela de Titulo?
In_Title = true
end
#==============================================================================
# ** Game_System
#------------------------------------------------------------------------------
# Esta classe manipula dados relacionados com o sistema.Também gerencia veículos e BGM, etc
# A instância desta classe é referenciado por $ game_system.
#==============================================================================
class Game_System
#--------------------------------------------------------------------------
# * Variaveis de Instacia Publica
#--------------------------------------------------------------------------
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
#------------------------------------------------------------------------------
# Esta classe manipula os characters dos inimigos.Ele é utilizado dentro da classe Game_Troop
# ($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
#--------------------------------------------------------------------------
# * Recebe o Maximo de HP
#--------------------------------------------------------------------------
def maxhp
difficulty = $game_system.difficulty
result = dargor_vx_difficulty_enemy_maxhp * difficulty[0]
return result.round
end
#--------------------------------------------------------------------------
# *Recebe o Maximo de MP
#--------------------------------------------------------------------------
def maxmp
difficulty = $game_system.difficulty
result = dargor_vx_difficulty_enemy_maxmp * difficulty[1]
return result.round
end
#--------------------------------------------------------------------------
# * Recebe Ataque
#--------------------------------------------------------------------------
def atk
difficulty = $game_system.difficulty
result = dargor_vx_difficulty_enemy_atk * difficulty[2]
return result.round
end
#--------------------------------------------------------------------------
# *Recebe Defesa
#--------------------------------------------------------------------------
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
#--------------------------------------------------------------------------
# * Recebe Agilidade
#--------------------------------------------------------------------------
def agi
difficulty = $game_system.difficulty
result = dargor_vx_difficulty_enemy_agi * difficulty[5]
return result.round
end
#--------------------------------------------------------------------------
# * Recebe a taxa de HIT
#--------------------------------------------------------------------------
def hit
difficulty = $game_system.difficulty
result = dargor_vx_difficulty_enemy_hit * difficulty[6]
result = [result, 100].min
return result.round
end
#--------------------------------------------------------------------------
# * Recebe a taxa de Evasão
#--------------------------------------------------------------------------
def eva
difficulty = $game_system.difficulty
result = dargor_vx_difficulty_enemy_eva * difficulty[7]
result = [result, 100].min
return result.round
end
#--------------------------------------------------------------------------
# * Recebe EXP
#--------------------------------------------------------------------------
def exp
difficulty = $game_system.difficulty
result = dargor_vx_difficulty_enemy_exp * difficulty[6]
return result.round
end
#--------------------------------------------------------------------------
# * Recebe Gold
#--------------------------------------------------------------------------
def gold
difficulty = $game_system.difficulty
result = dargor_vx_difficulty_enemy_gold * difficulty[7]
return result.round
end
end
#==============================================================================
# ** Scene_Title
#------------------------------------------------------------------------------
# Esta classe realiza a tranformação da tela de título.
#==============================================================================
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
#--------------------------------------------------------------------------
# * Inicio do processo
#--------------------------------------------------------------------------
def start
dargor_vx_difficulty_title_start
create_difficulty_window
end
#--------------------------------------------------------------------------
# * Termino do processo
#--------------------------------------------------------------------------
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