diff options
| author | historia <[not public]> | 2026-06-29 17:19:40 -0400 |
|---|---|---|
| committer | historia <[not public]> | 2026-06-29 17:19:40 -0400 |
| commit | feb80b7dde200d4121cd9f9c583a08f9869c5588 (patch) | |
| tree | 3271cae1d74c8f3b84ef3ae84f8f62e563029dff /internal/game/render_prompt.go | |
| parent | c6cbf76b33ac20d071d25e74b70f6901476193a6 (diff) | |
| download | thehouseoficarus-feb80b7dde200d4121cd9f9c583a08f9869c5588.tar.gz | |
feat: incardinal directions (nw, ne, sw, se). probably janky in ways I haven't yet discovered.
Diffstat (limited to 'internal/game/render_prompt.go')
| -rw-r--r-- | internal/game/render_prompt.go | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/internal/game/render_prompt.go b/internal/game/render_prompt.go index b992c8c..68f1a9a 100644 --- a/internal/game/render_prompt.go +++ b/internal/game/render_prompt.go @@ -59,7 +59,7 @@ func (g *Game) expandPromptVars(sess *net.Session, text string) string { if !ok { continue } - letter := strings.ToUpper(string(dir)[:1]) + letter := exitPromptLetter(dir) allExits += letter if exitDef.Condition != nil && !g.checkCondition(sess, exitDef.Condition) { continue @@ -114,3 +114,31 @@ func xpToLevel(p *player.Player, sk player.SkillName) int { 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 { + switch dir { + case world.North: + return "N" + case world.South: + return "S" + case world.East: + return "E" + case world.West: + return "W" + case world.Northeast: + return "ne" + case world.Northwest: + return "nw" + case world.Southeast: + return "se" + case world.Southwest: + return "sw" + case world.Up: + return "U" + case world.Down: + return "D" + } + return "?" +} |
