aboutsummaryrefslogtreecommitdiff
path: root/internal/game/cmd_score.go
diff options
context:
space:
mode:
authorhistoria <[not public]>2026-06-15 00:55:26 -0400
committerhistoria <[not public]>2026-06-15 00:56:27 -0400
commit445c4612cc5cf2c226f85894b6ad1e2419a374e2 (patch)
treedf3c6d4702cbeb7bd1618f88e93eb9cd08bcfcf4 /internal/game/cmd_score.go
parentb6fdde0aa6fcefd735e7c550aaa7fca879023f1c (diff)
downloadthehouseoficarus-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.go14
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)
}
}