=begin
# 精英敌人,作者:66RPG的tan12345
# 功能:遇敌时,敌人有一定几率(可设定)变成精英,精英怪比普通怪属性有加成(可修改),
# 当然了,精英怪的经验、金钱、掉落率也同样有加成。
# 也可以设定指定的敌人不会变成精英(比如BOSS)
#
# 使用方法:将脚本插入到main上
#
=end
module Tan_by_enemy_set
#精英怪出现几率,30代表30%
Tan_enemy_by = 20
#Tan_enemy_by_num = 2 2倍属性
#~ Tan_enemy_by_egold = 3 3倍金钱
#~ Tan_enemy_by_eexp = 3 3倍经验
#~ Tan_enemy_by_edrop = 3 3倍掉落率
Tan_enemy_by_emhp = 3
Tan_enemy_by_num = 1.2
Tan_enemy_by_egold = 10
Tan_enemy_by_eexp = 5
Tan_enemy_by_edrop = 5
#不会成为精英的敌人
NO_BY_ENEMY = [2,3]#表示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 + "(boss)" 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_eexp if is_by?
return v.to_i
end
#--------------------------------------------------------------------------
# ● 获取hp
#--------------------------------------------------------------------------
alias tan_by_enemy_mhp mhp
def mhp
v = tan_by_enemy_mhp
v *= Tan_by_enemy_set::Tan_enemy_by_emhp 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_egold 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_edrop if is_by?
return v
end
end