From 9666676766bf21364f4fc4d0d1d336e72f2a91b4 Mon Sep 17 00:00:00 2001 From: historia <[not public]> Date: Tue, 6 Oct 2026 12:57:23 -0400 Subject: refactor: split casino.go, dedup helpers, remove audit docs --- internal/game/render_prompt.go | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) (limited to 'internal/game/render_prompt.go') diff --git a/internal/game/render_prompt.go b/internal/game/render_prompt.go index 2b4f50c..4bf7977 100644 --- a/internal/game/render_prompt.go +++ b/internal/game/render_prompt.go @@ -62,11 +62,14 @@ func (g *Game) expandPromptVars(sess *net.Session, text string) string { continue } letter := exitPromptLetter(dir) - allExits += letter - if exitDef.Condition != nil && !g.checkCondition(sess, exitDef.Condition) { + ed := g.exitDisplayState(sess, p.RoomID, dir, exitDef) + if !ed.Visible { continue } - openExits += letter + allExits += letter + if !ed.Blocked { + openExits += letter + } } } text = strings.ReplaceAll(text, "%E", allExits) @@ -75,7 +78,7 @@ func (g *Game) expandPromptVars(sess *net.Session, text string) string { for _, sk := range player.AllSkills { tag := string(sk) text = strings.ReplaceAll(text, "%X_"+tag, fmt.Sprint(p.Skills[sk])) - text = strings.ReplaceAll(text, "%x_"+tag, fmt.Sprint(xpToLevel(p, sk))) + text = strings.ReplaceAll(text, "%x_"+tag, fmt.Sprint(player.XPForNextLevel(p.Skills[sk]))) } text = strings.ReplaceAll(text, "\x00", "%") @@ -110,13 +113,6 @@ func attackStyleLong(s player.AttackStyle) string { return "accurate" } -func xpToLevel(p *player.Player, sk player.SkillName) int { - currentXP := p.Skills[sk] - currentLevel := p.Level(sk) - nextLevelXP := player.XPForLevel(currentLevel + 1) - return nextLevelXP - currentXP -} - // Cardinal exits get uppercase single letters; intercardinal exits get lowercase // two-letter strings. This visual distinction helps players scan the prompt at a glance. func exitPromptLetter(dir world.ExitDir) string { -- cgit v1.2.3