From a51f7a53aa2c487ebf94ba0363038574ae8bb590 Mon Sep 17 00:00:00 2001 From: historia <[not public]> Date: Tue, 7 Jul 2026 00:22:32 -0400 Subject: feat: hidden exits (and related flags) work with commands that change room ids. exit code simplified and unified between impassable and blocked exits. --- internal/game/look_target.go | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) (limited to 'internal/game/look_target.go') diff --git a/internal/game/look_target.go b/internal/game/look_target.go index ead38a7..8b0a57c 100644 --- a/internal/game/look_target.go +++ b/internal/game/look_target.go @@ -26,28 +26,19 @@ func (g *Game) doLookTarget(sess *net.Session, input string) { sess.WriteLine("You can't see anything that way.") return } - if !p.GodMode && exitDef.AlwaysBlocked { + ed := g.exitDisplayState(sess, p.RoomID, exitDir, exitDef) + if !ed.Visible { + sess.WriteLine("You can't see anything that way.") + return + } + if ed.Blocked { msg := exitDef.BlockedMessage if msg == "" { - msg = fmt.Sprintf("The way %s is impassable.", exitDir) + msg = fmt.Sprintf("The way %s is blocked.", exitDir) } sess.WriteLine(msg) return } - if exitDef.Hidden && !g.exitDiscovered(p, p.RoomID, exitDir) { - sess.WriteLine("You can't see anything that way.") - return - } - if exitDef.Condition != nil && !g.checkCondition(sess, exitDef.Condition) { - if !p.GodMode { - msg := exitDef.BlockedMessage - if msg == "" { - msg = fmt.Sprintf("The way %s is blocked.", exitDir) - } - sess.WriteLine(msg) - return - } - } g.World.SeedGroundItems(exitDef.Room) g.seedRoomMobs(exitDef.Room) origRoom := p.RoomID -- cgit v1.2.3