=begin
# 被动技能脚本(只针对人物,敌人无效,因为敌人没有学会技能这一说)
# 使用方法:在数据库-技能-备注栏里添加备注(可多行),其中:
# <atk = i> 代表atk增加i
# <def = i> 代表def增加i
# <mat = i> 代表mat增加i
# <mdf = i> 代表mdf增加i
# <agi = i> 代表agi增加i
# <luk = i> 代表luk增加i
# <mhp = i> 代表mhp增加i
# <mmp = i> 代表mmp增加i
#
# <ratk = i> 代表atk增加i%(如果学会多个这样的技能,最终增加的是(i1+i2+...+ix)%)
# <rdef = i> 代表def增加i%(如果学会多个这样的技能,最终增加的是(i1+i2+...+ix)%)
# <rmat = i> 代表mat增加i%(如果学会多个这样的技能,最终增加的是(i1+i2+...+ix)%)
# <rmdf = i> 代表mdf增加i%(如果学会多个这样的技能,最终增加的是(i1+i2+...+ix)%)
# <ragi = i> 代表agi增加i%(如果学会多个这样的技能,最终增加的是(i1+i2+...+ix)%)
# <rluk = i> 代表luk增加i%(如果学会多个这样的技能,最终增加的是(i1+i2+...+ix)%)
# <rmhp = i> 代表mhp增加i%(如果学会多个这样的技能,最终增加的是(i1+i2+...+ix)%)
# <rmmp = i> 代表mmp增加i%(如果学会多个这样的技能,最终增加的是(i1+i2+...+ix)%)
#
# <hit = i> 代表命中率增加i%
# <eva = i> 代表回避率增加i%
# <cri = i> 代表必杀率增加i%
# <cev = i> 代表必杀回避率增加i%
# <mev = i> 代表魔法回避率增加i%
# <mrf = i> 代表魔法反射率增加i%
# <cnt = i> 代表反击率增加i%
# <hrg = i> 代表HP再生率增加i%
# <mrg = i> 代表MP再生率增加i%
# <trg = i> 代表TP再生率增加i%
=end
class Game_Actor < Game_Battler
#--------------------------------------------------------------------------
# ● 获取技能数组的被动属性(加法)
#--------------------------------------------------------------------------
def get_skills_paramad(param_id)
ren = 0
case param_id
when 0 #HP
skills.each {|skill| ren += (skill.note =~ /<mhp = (\d+?)>/i ? $1.to_i : 0) }
when 1 #MP
skills.each {|skill| ren += (skill.note =~ /<mmp = (\d+?)>/i ? $1.to_i : 0) }
when 2 #atk
skills.each {|skill| ren += (skill.note =~ /<atk = (\d+?)>/i ? $1.to_i : 0) }
when 3 #def
skills.each {|skill| ren += (skill.note =~ /<def = (\d+?)>/i ? $1.to_i : 0) }
when 4 #mat
skills.each {|skill| ren += (skill.note =~ /<mat = (\d+?)>/i ? $1.to_i : 0) }
when 5 #mdf
skills.each {|skill| ren += (skill.note =~ /<mdf = (\d+?)>/i ? $1.to_i : 0) }
when 6 #agi
skills.each {|skill| ren += (skill.note =~ /<agi = (\d+?)>/i ? $1.to_i : 0) }
when 7 #luk
skills.each {|skill| ren += (skill.note =~ /<luk = (\d+?)>/i ? $1.to_i : 0) }
else
end
return ren
end
#--------------------------------------------------------------------------
# ● 获取技能数组的被动属性(乘法)
#--------------------------------------------------------------------------
def get_skills_parammu(param_id)
ren = 0
case param_id
when 0 #HP
skills.each {|skill| ren += (skill.note =~ /<rmhp = (\d+?)>/i ? $1.to_i : 0) }
when 1 #MP
skills.each {|skill| ren += (skill.note =~ /<rmmp = (\d+?)>/i ? $1.to_i : 0) }
when 2 #atk
skills.each {|skill| ren += (skill.note =~ /<ratk = (\d+?)>/i ? $1.to_i : 0) }
when 3 #def
skills.each {|skill| ren += (skill.note =~ /<rdef = (\d+?)>/i ? $1.to_i : 0) }
when 4 #mat
skills.each {|skill| ren += (skill.note =~ /<rmat = (\d+?)>/i ? $1.to_i : 0) }
when 5 #mdf
skills.each {|skill| ren += (skill.note =~ /<rmdf = (\d+?)>/i ? $1.to_i : 0) }
when 6 #agi
skills.each {|skill| ren += (skill.note =~ /<ragi = (\d+?)>/i ? $1.to_i : 0) }
when 7 #luk
skills.each {|skill| ren += (skill.note =~ /<rluk = (\d+?)>/i ? $1.to_i : 0) }
else
end
return ren * 0.01
end
#--------------------------------------------------------------------------
# ● 获取技能数组的被动特殊属性(加法)
#--------------------------------------------------------------------------
def get_skills_xparamad(xparam_id)
ren = 0
case xparam_id
when 0 #命中率hit
skills.each {|skill| ren += (skill.note =~ /<hit = (\d+?)>/i ? $1.to_i : 0) }
when 1 #闪避率eva
skills.each {|skill| ren += (skill.note =~ /<eva = (\d+?)>/i ? $1.to_i : 0) }
when 2 #必杀率cri
skills.each {|skill| ren += (skill.note =~ /<cri = (\d+?)>/i ? $1.to_i : 0) }
when 3 #必杀回避率cev
skills.each {|skill| ren += (skill.note =~ /<cev = (\d+?)>/i ? $1.to_i : 0) }
when 4 #魔法回避率mev
skills.each {|skill| ren += (skill.note =~ /<mev = (\d+?)>/i ? $1.to_i : 0) }
when 5 #魔法反射率mrf
skills.each {|skill| ren += (skill.note =~ /<mrf = (\d+?)>/i ? $1.to_i : 0) }
when 6 #反击率cnt
skills.each {|skill| ren += (skill.note =~ /<cnt = (\d+?)>/i ? $1.to_i : 0) }
when 7 #HP再生率hrg
skills.each {|skill| ren += (skill.note =~ /<hrg = (\d+?)>/i ? $1.to_i : 0) }
when 8 #MP再生率mrg
skills.each {|skill| ren += (skill.note =~ /<mrg = (\d+?)>/i ? $1.to_i : 0) }
when 9 #TP再生率trg
skills.each {|skill| ren += (skill.note =~ /<trg = (\d+?)>/i ? $1.to_i : 0) }
else
end
return ren * 0.01
end
#--------------------------------------------------------------------------
# ● 获取普通能力的基础值
#--------------------------------------------------------------------------
alias tan_game_actor_param_base param_base
def param_base(param_id)
tan_game_actor_param_base(param_id) + get_skills_paramad(param_id)
end
#--------------------------------------------------------------------------
# ● 获取普通能力
#--------------------------------------------------------------------------
alias tan_game_actor_param param
def param(param_id)
value = param_base(param_id) + param_plus(param_id)
value *= (param_rate(param_id) + get_skills_parammu(param_id)) * param_buff_rate(param_id)
[[value, param_max(param_id)].min, param_min(param_id)].max.to_i
end
#--------------------------------------------------------------------------
# ● 获取添加能力
#--------------------------------------------------------------------------
alias tan_game_actor_xparam xparam
def xparam(xparam_id)
tan_game_actor_xparam(xparam_id) + get_skills_xparamad(xparam_id)
end
end