diff options
| author | historia <[not public]> | 2026-06-15 00:55:26 -0400 |
|---|---|---|
| committer | historia <[not public]> | 2026-06-15 00:56:27 -0400 |
| commit | 445c4612cc5cf2c226f85894b6ad1e2419a374e2 (patch) | |
| tree | df3c6d4702cbeb7bd1618f88e93eb9cd08bcfcf4 /internal/game/cmd_score.go | |
| parent | b6fdde0aa6fcefd735e7c550aaa7fca879023f1c (diff) | |
| download | thehouseoficarus-445c4612cc5cf2c226f85894b6ad1e2419a374e2.tar.gz | |
feat: walk command, improved tables and columns
Diffstat (limited to 'internal/game/cmd_score.go')
| -rw-r--r-- | internal/game/cmd_score.go | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/internal/game/cmd_score.go b/internal/game/cmd_score.go index 9b3904a..2c62839 100644 --- a/internal/game/cmd_score.go +++ b/internal/game/cmd_score.go @@ -2,6 +2,7 @@ package game import ( "fmt" + "strconv" "thirdcollapse/internal/net" "thirdcollapse/internal/player" @@ -15,13 +16,20 @@ func (g *Game) doScore(sess *net.Session) { fmt.Sprintf("Combat Level: %d", p.CombatLevel()), fmt.Sprintf("HP: %d/%d", p.HP, p.MaxHP()), fmt.Sprintf("Credits: %d", p.Credits), - "", - "Skills:", ) + + t := &Table{Title: "Skills", Columns: []string{"Skill", "Level", "XP"}} for _, s := range player.AllSkills { level := p.Level(s) xp := p.Skills[s] next := player.XPForNextLevel(xp) - sess.WriteLine(fmt.Sprintf(" %-12s Level: %2d XP: %d / %d", s, level, xp, xp+next)) + t.Rows = append(t.Rows, []string{ + string(s), + strconv.Itoa(level), + fmt.Sprintf("%d / %d XP", xp, xp+next), + }) + } + for _, line := range t.Render(p.OptionBool("unicode")) { + sess.WriteLine(line) } } |
