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

@ -13,7 +13,20 @@
{{- $startDatetime := time.Format "2006-01-02" .start_date -}}
<td class="began">Began <time class="nobreak" datetime="{{ $startDatetime }}">{{ $startDate }}</time></td>
<td class="score">{{ .score | lang.FormatNumber 0 }} points</td>
<td class="level">Level {{ .character.max_level }}</td>
{{/*
When I first wrote the importer script, I read about the log file
format on the Nethackwiki. It labeled a field as "maximum level",
which I interpreted as maximum character level. Turns out it's
actually maximum *dungeon* level. The script has been updated, but I
won't be able to update all the imported logfiles.
https://nethackwiki.com/wiki/Logfile
*/}}
{{ with .dungeon.max_level }}
<td class="level">{{ .descriptive }}</td>
{{ else }}
{{ with .character.max_level }}<td class="level">Level {{ . }}</td>{{ end }}
{{ end }}
<td class="hp">{{ cond (gt .character.hp.n 0) (printf "%s / %s" .character.hp.n .character.hp.max)
.character.hp.max }} hp</td>
</tr>