赞 | 12 |
VIP | 2 |
好人卡 | 5 |
积分 | 13 |
经验 | 24311 |
最后登录 | 2023-9-26 |
在线时间 | 378 小时 |
Lv3.寻梦者
- 梦石
- 0
- 星屑
- 1345
- 在线时间
- 378 小时
- 注册时间
- 2015-6-16
- 帖子
- 571
|
=begin # 精英敌人,作者:66RPG的tan12345 # 功能:遇敌时,敌人有一定几率(可设定)变成精英,精英怪比普通怪属性有加成(可修改), # 当然了,精英怪的经验、金钱、掉落率也同样有加成。 # 也可以设定指定的敌人不会变成精英(比如BOSS) # # 使用方法:将脚本插入到main上 # =end module Tan_by_enemy_set #精英怪出现几率,30代表30% Tan_enemy_by = 10 #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_num = 2 Tan_enemy_by_egold = 3 Tan_enemy_by_eexp = 3 Tan_enemy_by_edrop = 3 #不会成为精英的敌人 NO_BY_ENEMY = [2,3,28,29,30,31,32,33,34,35,36,37,38,39,40,43,44,45,46,47,48,49,50,52,51,53,54,55,61,62,63,65,66,67,68,69,70,71,72,73,75,74,76]#表示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 + "(BOOS)" 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 #-------------------------------------------------------------------------- # ● 获取金钱 #-------------------------------------------------------------------------- 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
=begin
# 精英敌人,作者:66RPG的tan12345
# 功能:遇敌时,敌人有一定几率(可设定)变成精英,精英怪比普通怪属性有加成(可修改),
# 当然了,精英怪的经验、金钱、掉落率也同样有加成。
# 也可以设定指定的敌人不会变成精英(比如BOSS)
#
# 使用方法:将脚本插入到main上
#
=end
module Tan_by_enemy_set
#精英怪出现几率,30代表30%
Tan_enemy_by = 10
#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_num = 2
Tan_enemy_by_egold = 3
Tan_enemy_by_eexp = 3
Tan_enemy_by_edrop = 3
#不会成为精英的敌人
NO_BY_ENEMY = [2,3,28,29,30,31,32,33,34,35,36,37,38,39,40,43,44,45,46,47,48,49,50,52,51,53,54,55,61,62,63,65,66,67,68,69,70,71,72,73,75,74,76]#表示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 + "(BOOS)" 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
#--------------------------------------------------------------------------
# ● 获取金钱
#--------------------------------------------------------------------------
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
修改了里面的东西,自行修改吧,网上只有单一(也就是金钱什么的全是固定的,不能经验1.5倍,金钱5倍这样分散。他全都统一,我这边能分散设置) |
评分
-
查看全部评分
|