=begin
# 精英敌人,作者:66RPG的tan12345
# 功能:遇敌时,敌人有一定几率(可设定)变成精英,精英怪比普通怪属性有加成(可修改),
# 当然了,精英怪的经验、金钱、掉落率也同样有加成。
# 也可以设定指定的敌人不会变成精英(比如BOSS)
#
# 使用方法:将脚本插入到main上
#
=end
module Tan_by_enemy_set
#精英怪出现几率,30代表30%
Tan_enemy_by = 30
#精英怪属性加成比例(同时也是经验、金钱、掉落率加成比例),1.3代表属性是普通怪的1.3倍
Tan_enemy_by_num = 1.3
#不会成为精英的敌人
NO_BY_ENEMY = [4,5]#表示2号和3号敌人不会变成精英,适合设定BOSS
end
class Game_Enemy < Game_Battler
attr_reader :is_by # 是否精英
#--------------------------------------------------------------------------
# ● 精英初始化
#--------------------------------------------------------------------------
def init_by_enemy
@is_by = false
@is_by = true if rand(100) <= Tan_by_enemy_set::Tan_enemy_by && !Tan_by_enemy_set::NO_BY_ENEMY.include?(enemy_id)
@original_name = @original_name + "(精英)" if @is_by == true
@hp = mhp
@mp = mmp
end
#--------------------------------------------------------------------------
# ● 是否精英
#--------------------------------------------------------------------------
def is_by?
return true if @is_by
return false
end
#--------------------------------------------------------------------------
# ● 初始化对象
#--------------------------------------------------------------------------
alias tan_by_enemy_initialize initialize
def initialize(index, enemy_id)
tan_by_enemy_initialize(index, enemy_id)
init_by_enemy
end
#--------------------------------------------------------------------------
# ● 获取普通能力的基础值
#--------------------------------------------------------------------------
alias tan_by_enemy_param_base param_base
def param_base(param_id)
v = tan_by_enemy_param_base(param_id)
v *= Tan_by_enemy_set::Tan_enemy_by_num if is_by?
return v.to_i
end
#--------------------------------------------------------------------------
# ● 获取经验值
#--------------------------------------------------------------------------
alias tan_by_enemy_exp exp
def exp
v = tan_by_enemy_exp
v *= Tan_by_enemy_set::Tan_enemy_by_num if is_by?
return v.to_i
end
#--------------------------------------------------------------------------
# ● 获取金钱
#--------------------------------------------------------------------------
alias tan_by_enemy_gold gold
def gold
v = tan_by_enemy_gold
v *= Tan_by_enemy_set::Tan_enemy_by_num if is_by?
return v.to_i
end
#--------------------------------------------------------------------------
# ● 获取物品掉率的倍率
#--------------------------------------------------------------------------
alias tan_by_enemy_drop_item_rate drop_item_rate
def drop_item_rate
v = tan_by_enemy_drop_item_rate
v *= Tan_by_enemy_set::Tan_enemy_by_num if is_by?
return v
end
end