package game import ( "strconv" "thehouseoficarus/internal/color" "thehouseoficarus/internal/net" "thehouseoficarus/internal/player" "thehouseoficarus/internal/ui" ) func (g *Game) executeSkills(sess *net.Session, args []string, rawInput string) { g.doSkills(sess) } func (g *Game) doSkills(sess *net.Session) { p := sess.Player mode := g.colorMode(sess) t := &ui.Table{Title: "Skills", Columns: []string{ color.Render(mode, color.Parse("4B"), "Skill"), color.Render(mode, color.Parse("F5"), "Abbr"), color.Render(mode, color.Parse("E6"), "Level"), color.Render(mode, color.Parse("DE"), "XP"), color.Render(mode, color.Parse("B3"), "XP to Next"), }} for _, s := range player.AllSkills { level := p.Level(s) xp := p.Skills[s] next := player.XPForNextLevel(xp) t.Rows = append(t.Rows, []string{ color.Render(mode, color.Parse("4B"), string(s)), color.Render(mode, color.Parse("F5"), player.SkillAbbr[s]), color.Render(mode, color.Parse("E6"), strconv.Itoa(level)), color.Render(mode, color.Parse("DE"), strconv.Itoa(xp)), color.Render(mode, color.Parse("B3"), strconv.Itoa(next)), }) } for _, line := range t.Render(p.OptionBool("unicode"), p.OptionInt("wrap_width")) { sess.WriteLine(line) } }