fix(hud): improved kill tracking with Shrapnel heuristic
- Non-Shrapnel loot = definite kill - Shrapnel: every 2 Shrapnel = 1 kill (since mobs drop 1-2 Shrapnel) - This handles mobs that drop only Shrapnel - Reset Shrapnel counter on session start
This commit is contained in:
parent
647728a1d4
commit
ff7b304c78
|
|
@ -890,6 +890,9 @@ class MainWindow(QMainWindow):
|
||||||
self.set_session_state(SessionState.RUNNING)
|
self.set_session_state(SessionState.RUNNING)
|
||||||
self.current_session_id = project_id
|
self.current_session_id = project_id
|
||||||
|
|
||||||
|
# Reset shrapnel counter for kill tracking
|
||||||
|
self._shrapnel_count = 0
|
||||||
|
|
||||||
# Emit signal
|
# Emit signal
|
||||||
self.session_started.emit(project_id)
|
self.session_started.emit(project_id)
|
||||||
|
|
||||||
|
|
@ -958,10 +961,21 @@ class MainWindow(QMainWindow):
|
||||||
if item_name == 'Universal Ammo':
|
if item_name == 'Universal Ammo':
|
||||||
return
|
return
|
||||||
|
|
||||||
# Count kills (excluding Shrapnel which is from every mob)
|
# Kill tracking heuristic:
|
||||||
# Real loot items indicate a kill
|
# - Non-Shrapnel loot = definite kill
|
||||||
|
# - Shrapnel: count as kill every 2 Shrapnel (since mobs drop 1-2 Shrapnel)
|
||||||
if item_name != 'Shrapnel':
|
if item_name != 'Shrapnel':
|
||||||
self.hud.update_stats({'kills_add': 1})
|
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)
|
# Queue database write for main thread (SQLite thread safety)
|
||||||
if self._current_db_session_id:
|
if self._current_db_session_id:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue