diff options
| author | historia <[not public]> | 2026-10-06 12:57:23 -0400 |
|---|---|---|
| committer | historia <[not public]> | 2026-10-06 12:57:23 -0400 |
| commit | 9666676766bf21364f4fc4d0d1d336e72f2a91b4 (patch) | |
| tree | 0cade34091d7602790dc38cd44053f0b74bbadf2 /internal/game/render_prompt.go | |
| parent | 4bc1daaf259e0c19c5fe4a12ec8bc7f6e5a735c1 (diff) | |
| download | thehouseoficarus-9666676766bf21364f4fc4d0d1d336e72f2a91b4.tar.gz | |
refactor: split casino.go, dedup helpers, remove audit docs
Diffstat (limited to 'internal/game/render_prompt.go')
| -rw-r--r-- | internal/game/render_prompt.go | 18 |
1 files changed, 7 insertions, 11 deletions
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 { |
