diff --git a/ui/main_window.py b/ui/main_window.py index b743be7..fb1c03a 100644 --- a/ui/main_window.py +++ b/ui/main_window.py @@ -890,6 +890,9 @@ class MainWindow(QMainWindow): self.set_session_state(SessionState.RUNNING) self.current_session_id = project_id + # Reset shrapnel counter for kill tracking + self._shrapnel_count = 0 + # Emit signal self.session_started.emit(project_id) @@ -958,10 +961,21 @@ class MainWindow(QMainWindow): if item_name == 'Universal Ammo': return - # Count kills (excluding Shrapnel which is from every mob) - # Real loot items indicate a kill + # Kill tracking heuristic: + # - Non-Shrapnel loot = definite kill + # - Shrapnel: count as kill every 2 Shrapnel (since mobs drop 1-2 Shrapnel) if item_name != 'Shrapnel': self.hud.update_stats({'kills_add': 1}) + else: + # Track Shrapnel count for this session + if not hasattr(self, '_shrapnel_count'): + self._shrapnel_count = 0 + self._shrapnel_count += quantity + # Every 2 Shrapnel = 1 kill (approximate) + kills_from_shrapnel = self._shrapnel_count // 2 + if kills_from_shrapnel > 0: + self.hud.update_stats({'kills_add': kills_from_shrapnel}) + self._shrapnel_count -= kills_from_shrapnel * 2 # Queue database write for main thread (SQLite thread safety) if self._current_db_session_id: