#encoding:utf-8
#==============================================================================
# ■ Game_Battler
#------------------------------------------------------------------------------
# 处理战斗者的类。Game_Actor 和 Game_Enemy 类的父类。
#==============================================================================
class Game_Battler < Game_BattlerBase
#--------------------------------------------------------------------------
# ● 应用技能/物品的效果
#--------------------------------------------------------------------------
alias old_item_apply item_apply
def item_apply(user, item)
old_item_apply(user, item)
chufa(user,item)
end
#--------------------------------------------------------------------------
# ● 触发
#--------------------------------------------------------------------------
def chufa(user,item)
#遍历本身所有状态
self.states.each do |i|
next if i.nil? #状态错误
next if i.note.nil? #状态无备注
#触发属性。
if i.note =~ /<触发属性 = (\d+)>/
if $1.to_i == item.damage.element_id
if i.note =~ /<触发目标 = (\d+)>/
action = Game_Action.new(user, true)
action.set_skill($1.to_i)
@actions.insert(0,action)
end
end
end
#触发技能
if i.note =~ /<触发技能 = (\d+)>/
if $1.to_i == item.id and item.is_a?(RPG::Skill)
if i.note =~ /<触发目标 = (\d+)>/
action = Game_Action.new(user, true)
action.set_skill($1.to_i)
@actions.insert(0,action)
end
end
end
#触发物品
if i.note =~ /<触发物品 = (\d+)>/
if $1.to_i == item.id and item.is_a?(RPG::Item)
if i.note =~ /<触发目标 = (\d+)>/
action = Game_Action.new(user, true)
action.set_item($1.to_i)
@actions.insert(0,action)
end
end
end
end
end
end