Max level in the Nethack logfile is actually the max dungeon level, not the max character level

This commit is contained in:
Eryn Wells 2022-12-05 08:14:39 -08:00
parent d88d34a00a
commit 2a4838e8a3
2 changed files with 22 additions and 3 deletions

View file

@ -24,7 +24,7 @@ DUNGEONS = {
3: 'The Quest',
4: 'Sokoban',
5: 'Fort Ludios',
6: "Vlad's Tower",
6: 'Vlads Tower',
7: 'The Elemental Planes',
}
@ -97,6 +97,12 @@ def main(argv):
else:
dungeon_level_descriptive = SPECIAL_DUNGEON_LEVELS[dungeon_level]
max_dungeon_level = int(fields[4])
if max_dungeon_level > 0:
max_dungeon_level_descriptive = f"Level {max_dungeon_level}"
else:
max_dungeon_level_descriptive = SPECIAL_DUNGEON_LEVELS[max_dungeon_level]
start_date = datetime.datetime.strptime(fields[9], '%Y%m%d').strftime('%Y-%m-%d')
end_date = datetime.datetime.strptime(fields[8], '%Y%m%d').strftime('%Y-%m-%d')
@ -112,13 +118,13 @@ def main(argv):
'n': int(fields[2]),
'name': dungeon_name,
'level': {'n': dungeon_level, 'descriptive': dungeon_level_descriptive},
'max_level': {'n': max_dungeon_level, 'descriptive': max_dungeon_level_descriptive},
},
'end_date': end_date,
'start_date': start_date,
'character': {
'name': name,
'descriptor': f'{name}-{role}-{race}-{gender}-{alignment}',
'max_level': int(fields[4]),
'hp': {'n': int(fields[5]), 'max': int(fields[6])},
'role': {'short': role, 'descriptive': ROLES[role]},
'race': {'short': race, 'descriptive': RACES[race]},