alias tmsksteal_game_battler_item_apply item_apply
def item_apply(user, item)
tmsksteal_game_battler_item_apply(user, item)
return if user.enemy?
if (user.id == 2 || item.steal_skill?) && @result.hit?
if enemy?
enemy.actions.each do |action|
skill = $data_skills[action.skill_id]
next if user.skill_learn?(skill) # すでに習得済み
@result.steal_skills.push(skill.id)
user.learn_steal_skill(skill.id)
end
else
skills.each do |skill|
next if user.skill_learn?(skill)
@result.steal_skills.push(skill.id)
user.learn_steal_skill(skill.id)
end
end
end
end