diff options
Diffstat (limited to 'app/lib/activity_processor.rb')
-rw-r--r-- | app/lib/activity_processor.rb | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/app/lib/activity_processor.rb b/app/lib/activity_processor.rb index d995e06..cca2185 100644 --- a/app/lib/activity_processor.rb +++ b/app/lib/activity_processor.rb @@ -125,11 +125,13 @@ class ActivityProcessor required_skill_gids = @activity.whatnot[:requirements].select { |r| r[:type] == "skill" }.map { |r| r[:gid] }.uniq required_skill_gids.each do |required_skill_gid| skill = Skill.find_by_gid(required_skill_gid) - @character.do_skill_based_equipment_break_checks(skill).each do |broken_item| + broken_item = @character.do_equipment_break_check(skill: skill) + if broken_item @results.push({ type: "warning", message: "Your #{broken_item.name} was damaged beyond repair!" }) end - @character.do_skill_based_item_infix_break_checks(skill).each do |broken_item| - @results.push({ type: "warning", message: "Your #{broken_item.name} omen faded away." }) + broken_infix_item = @character.do_item_infix_break_check(skill: skill) + if broken_infix_item + @results.push({ type: "warning", message: "Your #{broken_infix_item.name} omen faded away." }) end end end @@ -317,7 +319,8 @@ class ActivityProcessor end if char_hp < 1 || mon_hp < 1 - @character.do_equipment_break_checks.each do |broken_item| + broken_item = @character.do_equipment_break_check + if broken_item @results.push({ type: "warning", message: "Your #{broken_item.name} was damaged beyond repair!" }) end |