{{- $cause := .death.cause -}} {{- $didAscend := eq $cause "ascended" -}} {{- $level := (cond (gt .dungeon.level.n 0) (.dungeon.level.descriptive | lower) .dungeon.level.descriptive) -}}
{{- if $didAscend -}}✨{{- else -}}🪦{{- end -}}

{{ time.Format "January 2, 2006" .end_date }}

{{ with .character.descriptor -}}

{{ . }}

{{ end }}

{{- $name := .character.name -}} {{- $descriptiveAlignment := .character.alignment.descriptive | lower -}} {{- $descriptiveRace := .character.race.descriptive | lower -}} {{- $descriptiveRole := .character.role.descriptive -}} {{- if $didAscend -}} {{ $name }}, a {{ $descriptiveAlignment }} {{ $descriptiveRace }} {{ $descriptiveRole }}, ascended. {{- else -}} {{ $name }}, a {{ $descriptiveAlignment }} {{ $descriptiveRace }} {{ $descriptiveRole }}, died {{ if gt .death.count 1 -}}for the last time{{- end }} in {{ .dungeon.name }} on {{ $level }}. She was {{ .death.cause }}. {{- end -}}

{{/* 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 -}} {{ else -}} {{ with .character.max_level -}} {{ end }} {{ end }}
{{ i18n "nethackBegan" }} {{ i18n "nethackScore" }} {{ if .dungeon.max_level }} {{ i18n "nethackDungeonLevel" }} {{ else }} {{ i18n "nethackCharacterLevel" }} {{ end }} {{ i18n "nethackHP" }}
{{- $startDate := time.Format "2006-01-02" .start_date -}} {{- $startDatetime := time.Format "2006-01-02" .start_date -}} {{- .score | lang.FormatNumber 0 -}} {{ .n }}{{ . }} {{- $hp := float .character.hp.n -}} {{- $hpMax := .character.hp.max -}} {{- if gt $hp 0 }}{{ $hp }} / {{ $hpMax }}{{ else }}{{ $hp }}{{ end }}