diff options
| author | historia <[not public]> | 2026-07-07 00:22:32 -0400 |
|---|---|---|
| committer | historia <[not public]> | 2026-07-07 00:22:32 -0400 |
| commit | a51f7a53aa2c487ebf94ba0363038574ae8bb590 (patch) | |
| tree | b393a8f9e4732b40f6fe8058d086bd631537ad3b /internal/game/look_target.go | |
| parent | 9292634f2f8d71a53879ff07e1330c671b207d51 (diff) | |
| download | thehouseoficarus-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.go | 23 |
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 |
