# [精英敌人] 原作 tan12345(va) 移植 hyrious(xp)
class Game_Enemy < Game_Battler
# 精英怪出现几率,30代表30%
BY = 30
# 精英怪属性加成比例(同时也是经验,金钱,掉落率加成比例),1.3代表属性是普通怪的1.3倍
BYP = 1.5
# 不会成为精英的敌人
NO_BY = [7,8] #表示2号和3号敌人不会变成精英,适合设定BOSS
attr_reader :is_by # 是否精英
#--------------------------------------------------------------------------
# ● 是否精英
#--------------------------------------------------------------------------
def is_by?
return true if @is_by
return false
end
#--------------------------------------------------------------------------
# ● 初始化对象(包括精英初始化)
#--------------------------------------------------------------------------
alias tan_initialize initialize
def initialize(troop_id, member_index)
tan_initialize(troop_id, member_index)
@is_by = (rand(100) <= BY && !NO_BY.include?(@enemy_id))
@hp = (@hp * BYP).to_i if @is_by
@sp = (@sp * BYP).to_i if @is_by
end
#--------------------------------------------------------------------------
# ● 精英改名
#--------------------------------------------------------------------------
alias hy_name name
def name
is_by? ? hy_name + "(精英)" : hy_name
end
#--------------------------------------------------------------------------
# ● 获取经验值
#--------------------------------------------------------------------------
alias tan_exp exp
def exp
return (tan_exp * BYP).to_i if @is_by
tan_exp
end
#--------------------------------------------------------------------------
# ● 获取金钱
#--------------------------------------------------------------------------
alias tan_gold gold
def gold
return (tan_gold * BYP).to_i if @is_by
tan_gold
end
#--------------------------------------------------------------------------
# ● 获取物品掉率的倍率
#--------------------------------------------------------------------------
alias tan_treasure_prob treasure_prob
def treasure_prob
return (tan_treasure_prob * BYP).to_i if @is_by
tan_treasure_prob
end
#--------------------------------------------------------------------------
# ● 属性值增强(很多)
# 嫌不够可以自行调整算式, 更多base_请参考Game_Enemy
#--------------------------------------------------------------------------
alias hy_base_maxhp base_maxhp
def base_maxhp
return (hy_base_maxhp * BYP).to_i if @is_by
hy_base_maxhp
end
alias hy_base_maxsp base_maxsp
def base_maxsp
return (hy_base_maxsp * BYP).to_i if @is_by
hy_base_maxsp
end
alias hy_base_atk base_atk
def base_atk
return (hy_base_atk * BYP).to_i if @is_by
hy_base_atk
end
alias hy_base_pdef base_pdef
def base_pdef
return (hy_base_pdef * BYP).to_i if @is_by
hy_base_pdef
end
alias hy_base_mdef base_mdef
def base_mdef
return (hy_base_mdef * BYP).to_i if @is_by
hy_base_mdef
end
alias hy_base_eva base_eva
def base_eva
return (hy_base_eva * BYP).to_i if @is_by
hy_base_eva
end
end