=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 = 2
Tan_enemy_by_num = 1.1
Tan_enemy_by_egold = 2
Tan_enemy_by_eexp = 2
Tan_enemy_by_edrop = 2
#不会成为精英的敌人
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 + "(精英)" 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
module Tan_by_enemy_set
Boss_by = 15 #Boss出现几率
Boss_hp = 2
Boss_num = 1.2
Boss_gold = 2.5
Boss_exp = 2.5
Boss_drop = 2.5
NO_BOSS = [2,3]#不会成为BOSS的敌人
BB_by = 10 #Boss+精英出现几率
BB_hp = 2
BB_num = 1.3
BB_gold = 3
BB_exp = 3
BB_drop = 3
end
class Game_Enemy < Game_Battler
attr_reader :is_by_boss # 是否boss
attr_reader :is_bb # 是否boss+精英
def init_by_enemy
@is_by = false
@is_by_boss = false
@is_bb = false
@is_by = true if rand(100) <= Tan_by_enemy_set::Tan_enemy_by && !Tan_by_enemy_set::NO_BY_ENEMY.include?(enemy_id)
@is_by_boss = true if rand(100)+100 <= Tan_by_enemy_set::Boss_by+100 && !Tan_by_enemy_set::NO_BOSS.include?(enemy_id)
@is_bb = true if rand(100)+200 <= Tan_by_enemy_set::BB_by+200 && !Tan_by_enemy_set::NO_BOSS.include?(enemy_id) && !Tan_by_enemy_set::NO_BY_ENEMY.include?(enemy_id)
@is_by = false if @is_by_boss == true || @is_bb == true
@is_by_boss = false if @is_by == true || @is_bb == true
@is_bb = false if @is_by == true || @is_by_boss == true
@original_name = @original_name + "(精英)" if @is_by == true
@original_name = @original_name + "(boss)" if @is_by_boss == true
@original_name = @original_name + "(boss+精英)" if @is_bb == true
@hp = mhp
@mp = mmp
end
def is_by_boss?
return true if @is_by_boss
return false
end
def is_bb?
return true if @is_bb
return false
end
alias boss_param_base param_base
def param_base(param_id)
v = boss_param_base(param_id)
v *= Tan_by_enemy_set::Boss_num if is_by_boss?
v *= Tan_by_enemy_set::BB_num if is_bb?
return v.to_i
end
alias boss_exp exp
def exp
v = boss_exp
v *= Tan_by_enemy_set::Boss_exp if is_by_boss?
v *= Tan_by_enemy_set::BB_exp if is_bb?
return v.to_i
end
alias boss_mhp mhp
def mhp
v = boss_mhp
v *= Tan_by_enemy_set::Boss_hp if is_by_boss?
v *= Tan_by_enemy_set::BB_hp if is_bb?
return v.to_i
end
alias boss_gold gold
def gold
v = boss_gold
v *= Tan_by_enemy_set::Boss_gold if is_by_boss?
v *= Tan_by_enemy_set::BB_gold if is_bb?
return v.to_i
end
alias boss_drop_item_rate drop_item_rate
def drop_item_rate
v = boss_drop_item_rate
v *= Tan_by_enemy_set::Boss_drop if is_by_boss?
v *= Tan_by_enemy_set::BB_drop if is_bb?
return v
end
end