diff options
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 { |
