feat(gear): add weapon tier gain tracking
- Add English tier pattern: 'Your Weapon has reached tier X'
- Track weapon tier progression in real-time
- Display ⬆️ TIER UP notifications
- Include weapon_tiers in session summary
Gear progression now tracked alongside skills and loot.
This commit is contained in:
parent
555bea7c33
commit
0f19155dd8
|
|
@ -154,12 +154,19 @@ class LogWatcher:
|
||||||
|
|
||||||
# WEAPON TIER/LEVEL UP
|
# WEAPON TIER/LEVEL UP
|
||||||
# Swedish: "Din Piron PBP-17 (L) har nått nivå 0.38"
|
# Swedish: "Din Piron PBP-17 (L) har nått nivå 0.38"
|
||||||
|
# English: "Your Piron PBP-17 (L) has reached tier 2.68"
|
||||||
PATTERN_WEAPON_TIER_SV = re.compile(
|
PATTERN_WEAPON_TIER_SV = re.compile(
|
||||||
r'^(\d{4}-\d{2}-\d{2}\s+\d{2}:\d{2}:\d{2})\s+\[System\]\s+'
|
r'^(\d{4}-\d{2}-\d{2}\s+\d{2}:\d{2}:\d{2})\s+\[System\]\s+\[?\]?\s*'
|
||||||
r'Din\s+([\w\s\-()]+?)\s+har\s+nått\s+nivå\s+(\d+(?:\.\d+)?)',
|
r'Din\s+([\w\s\-()]+?)\s+har\s+nått\s+nivå\s+(\d+(?:\.\d+)?)',
|
||||||
re.IGNORECASE
|
re.IGNORECASE
|
||||||
)
|
)
|
||||||
|
|
||||||
|
PATTERN_WEAPON_TIER_EN = re.compile(
|
||||||
|
r'^(\d{4}-\d{2}-\d{2}\s+\d{2}:\d{2}:\d{2})\s+\[System\]\s+\[?\]?\s*'
|
||||||
|
r'Your\s+([\w\s\-()]+?)\s+has\s+reached\s+tier\s+(\d+(?:\.\d+)?)',
|
||||||
|
re.IGNORECASE
|
||||||
|
)
|
||||||
|
|
||||||
# COMBAT EVADE/DODGE/MISS
|
# COMBAT EVADE/DODGE/MISS
|
||||||
# English: "You Evaded", "The target Evaded your attack", "The attack missed you"
|
# English: "You Evaded", "The target Evaded your attack", "The attack missed you"
|
||||||
PATTERN_EVADE = re.compile(
|
PATTERN_EVADE = re.compile(
|
||||||
|
|
@ -440,7 +447,7 @@ class LogWatcher:
|
||||||
data={'heal_amount': Decimal(match.group(2))}
|
data={'heal_amount': Decimal(match.group(2))}
|
||||||
)
|
)
|
||||||
|
|
||||||
# WEAPON TIER/LEVEL
|
# WEAPON TIER/LEVEL - Swedish
|
||||||
match = self.PATTERN_WEAPON_TIER_SV.match(line)
|
match = self.PATTERN_WEAPON_TIER_SV.match(line)
|
||||||
if match:
|
if match:
|
||||||
return LogEvent(
|
return LogEvent(
|
||||||
|
|
@ -449,7 +456,22 @@ class LogWatcher:
|
||||||
raw_line=line,
|
raw_line=line,
|
||||||
data={
|
data={
|
||||||
'weapon_name': match.group(2).strip(),
|
'weapon_name': match.group(2).strip(),
|
||||||
'new_tier': Decimal(match.group(3))
|
'new_tier': Decimal(match.group(3)),
|
||||||
|
'language': 'swedish'
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
# WEAPON TIER/LEVEL - English
|
||||||
|
match = self.PATTERN_WEAPON_TIER_EN.match(line)
|
||||||
|
if match:
|
||||||
|
return LogEvent(
|
||||||
|
timestamp=self._parse_timestamp(match.group(1)),
|
||||||
|
event_type='weapon_tier',
|
||||||
|
raw_line=line,
|
||||||
|
data={
|
||||||
|
'weapon_name': match.group(2).strip(),
|
||||||
|
'new_tier': Decimal(match.group(3)),
|
||||||
|
'language': 'english'
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
8
main.py
8
main.py
|
|
@ -207,7 +207,7 @@ class LemontropiaApp:
|
||||||
logger.info(f"Using REAL log: {log_path}")
|
logger.info(f"Using REAL log: {log_path}")
|
||||||
|
|
||||||
# Stats tracking
|
# Stats tracking
|
||||||
stats = {'loot': 0, 'globals': 0, 'hofs': 0, 'skills': 0, 'level_ups': 0, 'damage_dealt': 0, 'damage_taken': 0, 'evades': 0, 'total_ped': Decimal('0.0')}
|
stats = {'loot': 0, 'globals': 0, 'hofs': 0, 'skills': 0, 'level_ups': 0, 'weapon_tiers': 0, 'damage_dealt': 0, 'damage_taken': 0, 'evades': 0, 'total_ped': Decimal('0.0')}
|
||||||
|
|
||||||
def on_event(event):
|
def on_event(event):
|
||||||
"""Handle log events."""
|
"""Handle log events."""
|
||||||
|
|
@ -240,6 +240,10 @@ class LemontropiaApp:
|
||||||
stats['level_ups'] += 1
|
stats['level_ups'] += 1
|
||||||
print(f" 🎉 LEVEL UP: {event.data.get('skill_name')} reached level {event.data.get('new_level')}!")
|
print(f" 🎉 LEVEL UP: {event.data.get('skill_name')} reached level {event.data.get('new_level')}!")
|
||||||
|
|
||||||
|
elif event.event_type == 'weapon_tier':
|
||||||
|
stats['weapon_tiers'] += 1
|
||||||
|
print(f" ⬆️ TIER UP: {event.data.get('weapon_name')} reached tier {event.data.get('new_tier')}!")
|
||||||
|
|
||||||
elif event.event_type == 'damage_dealt':
|
elif event.event_type == 'damage_dealt':
|
||||||
stats['damage_dealt'] += 1
|
stats['damage_dealt'] += 1
|
||||||
print(f" 💥 Damage Dealt: {event.data.get('damage')} pts")
|
print(f" 💥 Damage Dealt: {event.data.get('damage')} pts")
|
||||||
|
|
@ -258,6 +262,7 @@ class LemontropiaApp:
|
||||||
self.watcher.subscribe('hof', on_event)
|
self.watcher.subscribe('hof', on_event)
|
||||||
self.watcher.subscribe('skill', on_event)
|
self.watcher.subscribe('skill', on_event)
|
||||||
self.watcher.subscribe('level_up', on_event)
|
self.watcher.subscribe('level_up', on_event)
|
||||||
|
self.watcher.subscribe('weapon_tier', on_event)
|
||||||
self.watcher.subscribe('damage_dealt', on_event)
|
self.watcher.subscribe('damage_dealt', on_event)
|
||||||
self.watcher.subscribe('damage_taken', on_event)
|
self.watcher.subscribe('damage_taken', on_event)
|
||||||
self.watcher.subscribe('evade', on_event)
|
self.watcher.subscribe('evade', on_event)
|
||||||
|
|
@ -292,6 +297,7 @@ class LemontropiaApp:
|
||||||
print(f" HoFs: {stats['hofs']}")
|
print(f" HoFs: {stats['hofs']}")
|
||||||
print(f" Skills: {stats['skills']}")
|
print(f" Skills: {stats['skills']}")
|
||||||
print(f" Level Ups: {stats['level_ups']}")
|
print(f" Level Ups: {stats['level_ups']}")
|
||||||
|
print(f" Weapon Tiers: {stats['weapon_tiers']}")
|
||||||
print(f" Damage Dealt: {stats['damage_dealt']}")
|
print(f" Damage Dealt: {stats['damage_dealt']}")
|
||||||
print(f" Damage Taken: {stats['damage_taken']}")
|
print(f" Damage Taken: {stats['damage_taken']}")
|
||||||
print(f" Evades/Misses: {stats['evades']}")
|
print(f" Evades/Misses: {stats['evades']}")
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue