#==============================================================================
# ■ 困难模式
#------------------------------------------------------------------------------
# 游戏中控制难度的方法:事件脚本中写
# $game_system.hard_mode = 布尔值
# 布尔值可以是true 或 false,分别代表开启困难模式、关闭困难模式
#==============================================================================
class Game_System
#--------------------------------------------------------------------------
# ● 常量
#--------------------------------------------------------------------------
# 是否自动开启困难模式
DEFAULT_HARD_MODE = false
# 困难模式下敌人各项属性的倍数
HARD_MODE_PARAMS_ZOOM = {
:maxhp => 1,
:maxmp => 1,
:atk => 2,
:def => 2,
:spi => 2,
:agi => 2,
:hit => 1,
:eva => 1,
:cri => 1,
}
# 困难模式下敌人各项属性的增加值
HARD_MODE_PARAMS_ADD = {
:maxhp => 0,
:maxmp => 0,
:atk => 0,
:def => 0,
:spi => 0,
:agi => 0,
:hit => 0,
:eva => 0,
:cri => 0,
}
#--------------------------------------------------------------------------
# ● 定义实例变量
#--------------------------------------------------------------------------
attr_accessor :hard_mode # 困难模式
#--------------------------------------------------------------------------
# ● [别名修改]初始化对像
#--------------------------------------------------------------------------
alias initialize_for_hard_mode initialize
def initialize
initialize_for_hard_mode
@hard_mode = DEFAULT_HARD_MODE
end
end
#==============================================================================
# ■ Game_Enemy
#------------------------------------------------------------------------------
# 处理敌人的类。本类在 Game_Troop 类 ($game_troop) 的 内部使用。
#==============================================================================
class Game_Enemy
#--------------------------------------------------------------------------
# ● [追加]计算不同难度下的属性
#--------------------------------------------------------------------------
def calculate_param(param_type, param)
return param if !$game_system.hard_mode
param * Game_System::HARD_MODE_PARAMS_ZOOM[param_type] +
Game_System::HARD_MODE_PARAMS_ADD[param_type]
end
#--------------------------------------------------------------------------
# ● [别名修改]获取基本体力最大值
#--------------------------------------------------------------------------
alias base_maxhp_for_hard_mode base_maxhp
def base_maxhp
return calculate_param(:maxhp, base_maxhp_for_hard_mode)
end
#--------------------------------------------------------------------------
# ● [别名修改]获取基本魔力最大值
#--------------------------------------------------------------------------
alias base_maxmp_for_hard_mode base_maxmp
def base_maxmp
return calculate_param(:maxmp, base_maxmp_for_hard_mode)
end
#--------------------------------------------------------------------------
# ● [别名修改]获取基本攻击力
#--------------------------------------------------------------------------
alias base_atk_for_hard_mode base_atk
def base_atk
return calculate_param(:atk, base_atk_for_hard_mode)
end
#--------------------------------------------------------------------------
# ● [别名修改]获取基本防御力
#--------------------------------------------------------------------------
alias base_def_for_hard_mode base_def
def base_def
return calculate_param(:def, base_def_for_hard_mode)
end
#--------------------------------------------------------------------------
# ● [别名修改]获取基本精神力
#--------------------------------------------------------------------------
alias base_spi_for_hard_mode base_spi
def base_spi
return calculate_param(:spi, base_spi_for_hard_mode)
end
#--------------------------------------------------------------------------
# ● [别名修改]获取基本敏捷
#--------------------------------------------------------------------------
alias base_agi_for_hard_mode base_agi
def base_agi
return calculate_param(:agi, base_agi_for_hard_mode)
end
#--------------------------------------------------------------------------
# ● [别名修改]获取命中率
#--------------------------------------------------------------------------
alias hit_for_hard_mode hit
def hit
return calculate_param(:hit, hit_for_hard_mode)
end
#--------------------------------------------------------------------------
# ● [别名修改]获取闪躲率
#--------------------------------------------------------------------------
alias eva_for_hard_mode eva
def eva
return calculate_param(:eva, eva_for_hard_mode)
end
#--------------------------------------------------------------------------
# ● [别名修改]获取会心一击率
#--------------------------------------------------------------------------
alias cri_for_hard_mode cri
def cri
return calculate_param(:cri, cri_for_hard_mode)
end
end