aboutsummaryrefslogtreecommitdiff
path: root/internal/game/look_target.go
diff options
context:
space:
mode:
authorhistoria <[not public]>2026-07-07 00:22:32 -0400
committerhistoria <[not public]>2026-07-07 00:22:32 -0400
commita51f7a53aa2c487ebf94ba0363038574ae8bb590 (patch)
treeb393a8f9e4732b40f6fe8058d086bd631537ad3b /internal/game/look_target.go
parent9292634f2f8d71a53879ff07e1330c671b207d51 (diff)
downloadthehouseoficarus-a51f7a53aa2c487ebf94ba0363038574ae8bb590.tar.gz
feat: hidden exits (and related flags) work with commands that change room ids. exit code simplified and unified between impassable and blocked exits.
Diffstat (limited to 'internal/game/look_target.go')
-rw-r--r--internal/game/look_target.go23
1 files changed, 7 insertions, 16 deletions
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