diff options
| author | historia <[not public]> | 2026-06-24 22:55:35 -0400 |
|---|---|---|
| committer | historia <[not public]> | 2026-06-24 22:55:35 -0400 |
| commit | 15b7e221b799ef107dec44ecdb294026dfd3d059 (patch) | |
| tree | 3748e464a77f0f082bea1567e9d6990052054961 /internal/game/sys_labor.go | |
| parent | 9d4b799db4868bcab291b83599ff088763cd4ed6 (diff) | |
| download | thehouseoficarus-15b7e221b799ef107dec44ecdb294026dfd3d059.tar.gz | |
refactor: pulled techs out to yaml files, unified numerous combat functions, broke up game object
Diffstat (limited to 'internal/game/sys_labor.go')
| -rw-r--r-- | internal/game/sys_labor.go | 36 |
1 files changed, 2 insertions, 34 deletions
diff --git a/internal/game/sys_labor.go b/internal/game/sys_labor.go index 102c54e..43f7bb2 100644 --- a/internal/game/sys_labor.go +++ b/internal/game/sys_labor.go @@ -2,7 +2,6 @@ package game import ( "fmt" - "strings" "thehouseoficarus/internal/net" "thehouseoficarus/internal/player" @@ -23,31 +22,7 @@ func taskWorkVerb(mob *world.MobInstance) string { // inverse of hpBar. It is used for task worksites whose internal HP drains to 0 // to complete the work (progress = MaxHP - HP). func (g *Game) progressBar(sess *net.Session, progress, max int) string { - if max <= 0 { - max = 1 - } - if progress < 0 { - progress = 0 - } - if progress > max { - progress = max - } - - pct := float64(progress) / float64(max) * 100.0 - var fgColor int - switch { - case pct >= 70: - fgColor = 82 - case pct >= 40: - fgColor = 220 - default: - fgColor = 39 - } - - unicode := sess.Player != nil && sess.Player.OptionBool("unicode") - style := &BarStyle{FilledColor: fgColor, EmptyColor: 238, EmptyDim: true} - bar := RenderColoredBar(progress, max, 10, unicode, style, g.colorMode(sess)) - return "[" + bar + "]" + return g.renderBar(sess, progress, max, 39) } // writeTaskProgress prints the per-tick progress line for a task worksite, @@ -69,13 +44,6 @@ func (g *Game) writeTaskProgress(sess *net.Session, p *player.Player, mob *world prefix := fmt.Sprintf("You advance the %s on %s.", noun, g.colorize(sess, "mob", mobDisplayName(mob, true))) line := fmt.Sprintf("%s %s %3d%%", prefix, g.progressBar(sess, progress, mob.MaxHP), pct) - - if p.OptionBool("xp_drops") && len(gains) > 0 { - var parts []string - for _, gain := range gains { - parts = append(parts, fmt.Sprintf("+%dxp %s", gain.XP, player.SkillAbbr[player.SkillName(gain.Skill)])) - } - line += g.colorize(sess, "xp", " ("+strings.Join(parts, ", ")+")") - } + line += g.formatXpDrop(sess, p, gains) sess.WriteLine(line) } |
