diff options
| author | historia <[not public]> | 2026-06-28 02:40:30 -0400 |
|---|---|---|
| committer | historia <[not public]> | 2026-06-28 02:40:30 -0400 |
| commit | a1b6613c6c6a2f8d6e1ecd47e766bd40f92ac295 (patch) | |
| tree | 4ff8fefb029c93f2aa3db7361658b0b4e9805b66 /internal/game/look_target.go | |
| parent | 87dacfbb3dd16e7f55a82361eace98f9a39d75c8 (diff) | |
| download | thehouseoficarus-a1b6613c6c6a2f8d6e1ecd47e766bd40f92ac295.tar.gz | |
feat: admin accounts, god mode, OLC commands like dig/room, 'inline' objects changed to 'local' objects
Diffstat (limited to 'internal/game/look_target.go')
| -rw-r--r-- | internal/game/look_target.go | 32 |
1 files changed, 21 insertions, 11 deletions
diff --git a/internal/game/look_target.go b/internal/game/look_target.go index 743844f..915e4a7 100644 --- a/internal/game/look_target.go +++ b/internal/game/look_target.go @@ -27,12 +27,14 @@ func (g *Game) doLookTarget(sess *net.Session, input string) { return } if exitDef.Condition != nil && !g.checkCondition(sess, exitDef.Condition) { - msg := exitDef.BlockedMessage - if msg == "" { - msg = fmt.Sprintf("The way %s is blocked.", exitDir) + if !p.GodMode { + msg := exitDef.BlockedMessage + if msg == "" { + msg = fmt.Sprintf("The way %s is blocked.", exitDir) + } + sess.WriteLine(msg) + return } - sess.WriteLine(msg) - return } g.World.SeedGroundItems(exitDef.Room) g.seedRoomMobs(exitDef.Room) @@ -104,7 +106,7 @@ func (g *Game) doLookTarget(sess *net.Session, input string) { byDef := map[string][]world.ObjState{} descByDef := map[string]string{} for _, ist := range rawInstances { - def, err := g.resolveObjectDef(p.RoomID, ist.DefID) + def, _, err := g.resolveObjectDef(p.RoomID, ist.DefID) if err != nil { continue } @@ -122,7 +124,7 @@ func (g *Game) doLookTarget(sess *net.Session, input string) { if len(presentDefs) > 1 { sess.WriteLine("That's ambiguous, which one?") for _, defID := range presentDefs { - if def, err := g.resolveObjectDef(p.RoomID, defID); err == nil { + if def, _, err := g.resolveObjectDef(p.RoomID, defID); err == nil { sess.WriteLine(fmt.Sprintf(" %s", def.Name)) } } @@ -133,7 +135,7 @@ func (g *Game) doLookTarget(sess *net.Session, input string) { instances := byDef[presentDefs[0]] objDescText := descByDef[presentDefs[0]] st := &instances[0] - def, _ := g.resolveObjectDef(p.RoomID, st.DefID) + def, _, _ := g.resolveObjectDef(p.RoomID, st.DefID) if st.DefID == "estate_directory" { g.lookEstateDirectory(sess) @@ -199,9 +201,17 @@ func (g *Game) doLookTarget(sess *net.Session, input string) { } } - farmSuffix := g.farmObjSuffix(p, st.DefID, st.Index) - if farmSuffix != "" { - sess.WriteLine(farmSuffix) + if farmPatchDefIDs[st.DefID] { + prefix := farmFlagPrefix(st.DefID, st.Index) + if prefix != "" { + g.ensureFarmState(p, prefix) + g.ShowFarmPatchDetail(sess, p, prefix, st.DefID, st.Index) + } + } else { + farmSuffix := g.farmObjSuffix(p, st.DefID, st.Index) + if farmSuffix != "" { + sess.WriteLine(farmSuffix) + } } return } |
