summaryrefslogtreecommitdiff
path: root/app/lib/activity_processor.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/lib/activity_processor.rb')
-rw-r--r--app/lib/activity_processor.rb12
1 files changed, 9 insertions, 3 deletions
diff --git a/app/lib/activity_processor.rb b/app/lib/activity_processor.rb
index bc0d058..72c7ddd 100644
--- a/app/lib/activity_processor.rb
+++ b/app/lib/activity_processor.rb
@@ -272,7 +272,10 @@ class ActivityProcessor
elsif evasion_roll > accuracy_roll
combat_message.call("#{target.name} evaded #{actor.name}'s attack.")
end
+
if char_hp < 1 || mon_hp < 1
+ break_check
+
if monster_spawn
hp_lost = monster_spawn.remaining_hp - mon_hp
if hp_lost > 0
@@ -310,11 +313,14 @@ class ActivityProcessor
end
end
end
- @character.do_equipment_break_checks.each do |broken_item|
- @results.push({ type: "warning", message: "Your #{broken_item.name} was damaged beyond repair!" })
- end
break
end
end
end
+
+ def break_check
+ @character.do_equipment_break_checks.each do |broken_item|
+ @results.push({ type: "warning", message: "Your #{broken_item.name} was damaged beyond repair!" })
+ end
+ end
end