package game import ( "strconv" "thehouseoficarus/internal/color" "thehouseoficarus/internal/net" "thehouseoficarus/internal/player" ) 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 := &Table{Title: "Skills", Columns: []string{ color.Render(mode, color.Parse("75"), "Skill"), color.Render(mode, color.Parse("245"), "Abbr"), color.Render(mode, color.Parse("230"), "Level"), color.Render(mode, color.Parse("222"), "XP"), color.Render(mode, color.Parse("179"), "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("75"), string(s)), color.Render(mode, color.Parse("245"), player.SkillAbbr[s]), color.Render(mode, color.Parse("230"), strconv.Itoa(level)), color.Render(mode, color.Parse("222"), strconv.Itoa(xp)), color.Render(mode, color.Parse("179"), strconv.Itoa(next)), }) } for _, line := range t.Render(p.OptionBool("unicode")) { sess.WriteLine(line) } }