diff options
| author | historia <[not public]> | 2026-06-25 15:40:48 -0400 |
|---|---|---|
| committer | historia <[not public]> | 2026-06-25 15:40:48 -0400 |
| commit | abd612c15799f604e671e83dc7c410ed2b44185f (patch) | |
| tree | 0597ca92350de73aac2a7cf26b2f2d6595dac0cc /internal/game/ui_combat.go | |
| parent | 2725e2927a1595c7b100d942d1f14146252adeb7 (diff) | |
| download | thehouseoficarus-abd612c15799f604e671e83dc7c410ed2b44185f.tar.gz | |
slop refactor
Diffstat (limited to 'internal/game/ui_combat.go')
| -rw-r--r-- | internal/game/ui_combat.go | 38 |
1 files changed, 0 insertions, 38 deletions
diff --git a/internal/game/ui_combat.go b/internal/game/ui_combat.go deleted file mode 100644 index 77faae8..0000000 --- a/internal/game/ui_combat.go +++ /dev/null @@ -1,38 +0,0 @@ -package game - -import "thehouseoficarus/internal/net" - -// renderBar is the shared bar renderer for both HP bars and task-progress bars. -// lowColor is the color used when the value falls below 40% (160 red for HP, -// 39 cyan for progress). -func (g *Game) renderBar(sess *net.Session, current, max, lowColor int) string { - if max <= 0 { - max = 1 - } - if current < 0 { - current = 0 - } - if current > max { - current = max - } - - pct := float64(current) / float64(max) * 100.0 - var fgColor int - switch { - case pct >= 70: - fgColor = 82 - case pct >= 40: - fgColor = 220 - default: - fgColor = lowColor - } - - unicode := sess.Player != nil && sess.Player.OptionBool("unicode") - style := &BarStyle{FilledColor: fgColor, EmptyColor: 238, EmptyDim: true} - bar := RenderColoredBar(current, max, 10, unicode, style, g.colorMode(sess)) - return "[" + bar + "]" -} - -func (g *Game) hpBar(sess *net.Session, current, max int) string { - return g.renderBar(sess, current, max, 160) -} |
